From 9ad432463c8d05713f3f93da99de30cd63f22df4 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 21 Jun 2018 09:24:22 -0700 Subject: [PATCH] Prefix integer types with underscore --- .../aliased-entry-point-names.asm.multi.json | 2 +- .../comp/struct-layout.comp.json | 14 ++-- .../comp/struct-packing.comp.json | 76 +++++++++---------- .../frag/push-constant.vk.frag.json | 4 +- .../frag/spec-constant.vk.frag.json | 2 +- .../vert/read-from-row-major-array.vert.json | 6 +- .../vert/texture_buffer.vert.json | 2 +- spirv_reflect.cpp | 6 +- 8 files changed, 56 insertions(+), 56 deletions(-) diff --git a/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json b/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json index 2cd56064..45adf50b 100644 --- a/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json +++ b/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json @@ -18,7 +18,7 @@ } ], "types" : { - "8" : { + "_8" : { "name" : "_8", "members" : [ { diff --git a/reference/shaders-reflection/comp/struct-layout.comp.json b/reference/shaders-reflection/comp/struct-layout.comp.json index 9874d2be..3004454b 100644 --- a/reference/shaders-reflection/comp/struct-layout.comp.json +++ b/reference/shaders-reflection/comp/struct-layout.comp.json @@ -6,7 +6,7 @@ } ], "types" : { - "19" : { + "_19" : { "name" : "Foo", "members" : [ { @@ -16,12 +16,12 @@ } ] }, - "21" : { + "_21" : { "name" : "SSBO2", "members" : [ { "name" : "out_data", - "type" : "19", + "type" : "_19", "array" : [ 0 ], @@ -29,12 +29,12 @@ } ] }, - "28" : { + "_28" : { "name" : "SSBO", "members" : [ { "name" : "in_data", - "type" : "19", + "type" : "_19", "array" : [ 0 ], @@ -45,7 +45,7 @@ }, "ssbos" : [ { - "type" : "21", + "type" : "_21", "name" : "SSBO2", "writeonly" : true, "block_size" : 0, @@ -53,7 +53,7 @@ "binding" : 1 }, { - "type" : "28", + "type" : "_28", "name" : "SSBO", "readonly" : true, "block_size" : 0, diff --git a/reference/shaders-reflection/comp/struct-packing.comp.json b/reference/shaders-reflection/comp/struct-packing.comp.json index e18e4be9..22a41584 100644 --- a/reference/shaders-reflection/comp/struct-packing.comp.json +++ b/reference/shaders-reflection/comp/struct-packing.comp.json @@ -6,7 +6,7 @@ } ], "types" : { - "11" : { + "_11" : { "name" : "S0", "members" : [ { @@ -24,7 +24,7 @@ } ] }, - "14" : { + "_14" : { "name" : "S1", "members" : [ { @@ -39,7 +39,7 @@ } ] }, - "17" : { + "_17" : { "name" : "S2", "members" : [ { @@ -57,7 +57,7 @@ } ] }, - "19" : { + "_19" : { "name" : "S3", "members" : [ { @@ -72,7 +72,7 @@ } ] }, - "20" : { + "_20" : { "name" : "S4", "members" : [ { @@ -82,12 +82,12 @@ } ] }, - "23" : { + "_23" : { "name" : "Content", "members" : [ { "name" : "m0s", - "type" : "11", + "type" : "_11", "array" : [ 1 ], @@ -95,7 +95,7 @@ }, { "name" : "m1s", - "type" : "14", + "type" : "_14", "array" : [ 1 ], @@ -103,7 +103,7 @@ }, { "name" : "m2s", - "type" : "17", + "type" : "_17", "array" : [ 1 ], @@ -111,22 +111,22 @@ }, { "name" : "m0", - "type" : "11", + "type" : "_11", "offset" : 64 }, { "name" : "m1", - "type" : "14", + "type" : "_14", "offset" : 80 }, { "name" : "m2", - "type" : "17", + "type" : "_17", "offset" : 96 }, { "name" : "m3", - "type" : "19", + "type" : "_19", "offset" : 128 }, { @@ -136,7 +136,7 @@ }, { "name" : "m3s", - "type" : "20", + "type" : "_20", "array" : [ 8 ], @@ -144,17 +144,17 @@ } ] }, - "36" : { + "_36" : { "name" : "SSBO1", "members" : [ { "name" : "content", - "type" : "23", + "type" : "_23", "offset" : 0 }, { "name" : "content1", - "type" : "23", + "type" : "_23", "array" : [ 2 ], @@ -162,7 +162,7 @@ }, { "name" : "content2", - "type" : "23", + "type" : "_23", "offset" : 672 }, { @@ -229,7 +229,7 @@ } ] }, - "42" : { + "_42" : { "name" : "S0", "members" : [ { @@ -247,7 +247,7 @@ } ] }, - "44" : { + "_44" : { "name" : "S1", "members" : [ { @@ -262,7 +262,7 @@ } ] }, - "47" : { + "_47" : { "name" : "S2", "members" : [ { @@ -280,7 +280,7 @@ } ] }, - "49" : { + "_49" : { "name" : "S3", "members" : [ { @@ -295,7 +295,7 @@ } ] }, - "50" : { + "_50" : { "name" : "S4", "members" : [ { @@ -305,12 +305,12 @@ } ] }, - "52" : { + "_52" : { "name" : "Content", "members" : [ { "name" : "m0s", - "type" : "42", + "type" : "_42", "array" : [ 1 ], @@ -318,7 +318,7 @@ }, { "name" : "m1s", - "type" : "44", + "type" : "_44", "array" : [ 1 ], @@ -326,7 +326,7 @@ }, { "name" : "m2s", - "type" : "47", + "type" : "_47", "array" : [ 1 ], @@ -334,22 +334,22 @@ }, { "name" : "m0", - "type" : "42", + "type" : "_42", "offset" : 80 }, { "name" : "m1", - "type" : "44", + "type" : "_44", "offset" : 112 }, { "name" : "m2", - "type" : "47", + "type" : "_47", "offset" : 128 }, { "name" : "m3", - "type" : "49", + "type" : "_49", "offset" : 160 }, { @@ -359,7 +359,7 @@ }, { "name" : "m3s", - "type" : "50", + "type" : "_50", "array" : [ 8 ], @@ -367,17 +367,17 @@ } ] }, - "59" : { + "_59" : { "name" : "SSBO0", "members" : [ { "name" : "content", - "type" : "52", + "type" : "_52", "offset" : 0 }, { "name" : "content1", - "type" : "52", + "type" : "_52", "array" : [ 2 ], @@ -385,7 +385,7 @@ }, { "name" : "content2", - "type" : "52", + "type" : "_52", "offset" : 960 }, { @@ -455,7 +455,7 @@ }, "ssbos" : [ { - "type" : "36", + "type" : "_36", "name" : "SSBO1", "restrict" : true, "block_size" : 1472, @@ -463,7 +463,7 @@ "binding" : 1 }, { - "type" : "59", + "type" : "_59", "name" : "SSBO0", "restrict" : true, "block_size" : 2256, diff --git a/reference/shaders-reflection/frag/push-constant.vk.frag.json b/reference/shaders-reflection/frag/push-constant.vk.frag.json index 11ab6ab0..f72a8fd6 100644 --- a/reference/shaders-reflection/frag/push-constant.vk.frag.json +++ b/reference/shaders-reflection/frag/push-constant.vk.frag.json @@ -6,7 +6,7 @@ } ], "types" : { - "13" : { + "_13" : { "name" : "PushConstants", "members" : [ { @@ -38,7 +38,7 @@ ], "push_constants" : [ { - "type" : "13", + "type" : "_13", "name" : "push", "push_constant" : true } diff --git a/reference/shaders-reflection/frag/spec-constant.vk.frag.json b/reference/shaders-reflection/frag/spec-constant.vk.frag.json index a1b05efa..0add2986 100644 --- a/reference/shaders-reflection/frag/spec-constant.vk.frag.json +++ b/reference/shaders-reflection/frag/spec-constant.vk.frag.json @@ -6,7 +6,7 @@ } ], "types" : { - "137" : { + "_137" : { "name" : "Foo", "members" : [ { diff --git a/reference/shaders-reflection/vert/read-from-row-major-array.vert.json b/reference/shaders-reflection/vert/read-from-row-major-array.vert.json index 3d73504d..d92fb67f 100644 --- a/reference/shaders-reflection/vert/read-from-row-major-array.vert.json +++ b/reference/shaders-reflection/vert/read-from-row-major-array.vert.json @@ -6,7 +6,7 @@ } ], "types" : { - "89" : { + "_89" : { "name" : "gl_PerVertex", "members" : [ { @@ -19,7 +19,7 @@ } ] }, - "102" : { + "_102" : { "name" : "Block", "members" : [ { @@ -51,7 +51,7 @@ ], "ubos" : [ { - "type" : "102", + "type" : "_102", "name" : "Block", "block_size" : 576, "set" : 0, diff --git a/reference/shaders-reflection/vert/texture_buffer.vert.json b/reference/shaders-reflection/vert/texture_buffer.vert.json index dbaee24a..3c69e24c 100644 --- a/reference/shaders-reflection/vert/texture_buffer.vert.json +++ b/reference/shaders-reflection/vert/texture_buffer.vert.json @@ -6,7 +6,7 @@ } ], "types" : { - "8" : { + "_8" : { "name" : "gl_PerVertex", "members" : [ { diff --git a/spirv_reflect.cpp b/spirv_reflect.cpp index 8239acd6..29ca36d0 100644 --- a/spirv_reflect.cpp +++ b/spirv_reflect.cpp @@ -295,7 +295,7 @@ void CompilerReflection::emit_type(const SPIRType &type, bool &emitted_open_tag) json_stream->emit_json_key_object("types"); emitted_open_tag = true; } - json_stream->emit_json_key_object(std::to_string(type.self)); + json_stream->emit_json_key_object("_" + std::to_string(type.self)); json_stream->emit_json_key_value("name", name); json_stream->emit_json_key_array("members"); // FIXME ideally we'd like to emit the size of a structure as a @@ -328,7 +328,7 @@ void CompilerReflection::emit_type_member(const SPIRType &type, uint32_t index) json_stream->emit_json_key_value("name", name); if (membertype.basetype == SPIRType::Struct) { - json_stream->emit_json_key_value("type", std::to_string(membertype.self)); + json_stream->emit_json_key_value("type", "_" + std::to_string(membertype.self)); } else { @@ -454,7 +454,7 @@ void CompilerReflection::emit_resources(const char *tag, const vector if (type.basetype == SPIRType::Struct) { - json_stream->emit_json_key_value("type", std::to_string(res.base_type_id)); + json_stream->emit_json_key_value("type", "_" + std::to_string(res.base_type_id)); } else {