File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ ErrMsg YamlGenerator::generate(const GenInput& gen) {
6565 l_open (" attrs:\n " );
6666 for (const auto & attr: prog.vs ().inputs ) {
6767 if (attr.slot >= 0 ) {
68- gen_attr (attr, slang);
68+ gen_attr (gen, attr, slang);
6969 }
7070 }
7171 l_close ();
@@ -124,11 +124,14 @@ ErrMsg YamlGenerator::generate(const GenInput& gen) {
124124 return ErrMsg ();
125125}
126126
127- void YamlGenerator::gen_attr (const StageAttr& attr, Slang::Enum slang) {
127+ void YamlGenerator::gen_attr (const GenInput& gen, const StageAttr& attr, Slang::Enum slang) {
128128 l_open (" -\n " );
129129 l (" slot: {}\n " , attr.slot );
130130 l (" type: {}\n " , uniform_type (attr.type_info .type ));
131131 l (" base_type: {}\n " , attr_basetype (attr.type_info .basetype ()));
132+ if (gen.args .reflection ) {
133+ l (" name: {}\n " , attr.name );
134+ }
132135 if (Slang::is_glsl (slang)) {
133136 l (" glsl_name: {}\n " , attr.name );
134137 } else if (Slang::is_hlsl (slang)) {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class YamlGenerator: public BareGenerator {
1616 virtual std::string sampler_type (refl::SamplerType::Enum e);
1717 virtual std::string storage_pixel_format (refl::StoragePixelFormat::Enum e);
1818private:
19- void gen_attr (const refl::StageAttr& attr, Slang::Enum slang);
19+ void gen_attr (const GenInput& gen, const refl::StageAttr& attr, Slang::Enum slang);
2020 void gen_uniform_block (const GenInput& gen, const refl::UniformBlock& ub, Slang::Enum slang);
2121 void gen_uniform_block_refl (const refl::UniformBlock& ub);
2222 void gen_storage_buffer (const refl::StorageBuffer& sbuf, Slang::Enum slang);
You can’t perform that action at this time.
0 commit comments