From 58c4d7ea7375ec836ad87ea60009f5ec1f72dd74 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 Jun 2021 14:21:17 -0700 Subject: [PATCH] Generate uniform IO slot. --- .../impeller/compiler/code_gen_template.h | 16 ++++++++++++++++ .../flutter/impeller/primitives/box_primitive.mm | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/impeller/compiler/code_gen_template.h b/engine/src/flutter/impeller/compiler/code_gen_template.h index 66eaac36868..61124296c9b 100644 --- a/engine/src/flutter/impeller/compiler/code_gen_template.h +++ b/engine/src/flutter/impeller/compiler/code_gen_template.h @@ -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 ============================================================== // =========================================================================== diff --git a/engine/src/flutter/impeller/primitives/box_primitive.mm b/engine/src/flutter/impeller/primitives/box_primitive.mm index 6d35ae62951..e967440222c 100644 --- a/engine/src/flutter/impeller/primitives/box_primitive.mm +++ b/engine/src/flutter/impeller/primitives/box_primitive.mm @@ -47,7 +47,7 @@ BoxPrimitive::BoxPrimitive(std::shared_ptr 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;