Generate uniform IO slot.

This commit is contained in:
Chinmay Garde 2021-06-11 14:21:17 -07:00 committed by Dan Field
parent 36373c0e04
commit 58c4d7ea73
2 changed files with 17 additions and 1 deletions

View File

@ -26,6 +26,22 @@ struct {{camel_case(shader_name)}}{{camel_case(shader_stage)}}Info {
static constexpr std::string_view kEntrypointName = "{{entrypoint}}";
static constexpr ShaderStage kShaderStage = {{to_shader_stage(shader_stage)}};
// ===========================================================================
// Stage Uniforms ============================================================
// ===========================================================================
{% for uniform in uniform_buffers %}
static constexpr auto kUniform{{camel_case(uniform.name)}} = ShaderStageIOSlot { // {{uniform.name}}
"{{uniform.name}}", // name
{{uniform.location}}u, // attribute location
{{uniform.type.type_name}}, // type
{{uniform.type.bit_width}}u, // bit width of type
{{uniform.type.vec_size}}u, // vec size
{{uniform.type.columns}}u // number of columns
};
{% endfor %}
// ===========================================================================
// Stage Inputs ==============================================================
// ===========================================================================

View File

@ -47,7 +47,7 @@ BoxPrimitive::BoxPrimitive(std::shared_ptr<Context> context)
{
// Configure the stencil attachment.
// TODO(wip): Make this configurable if possible as the D32 compoment is
// TODO(wip): Make this configurable if possible as the D32 component is
// wasted.
const auto combined_depth_stencil_format =
PixelFormat::kPixelFormat_D32_Float_S8_UNormInt;