Handle naming structs properly

This commit is contained in:
baldurk
2020-04-30 17:47:10 +01:00
parent 98f0a926b8
commit 4b45c6be96
2 changed files with 18 additions and 3 deletions
@@ -1721,9 +1721,9 @@ void Debugger::AddSourceVars(rdcarray<SourceVariableMapping> &sourceVars, const
sourceVar.name = name;
sourceVar.offset = 0;
sourceVar.type = var.type;
sourceVar.rows = var.rows;
sourceVar.columns = var.columns;
for(uint32_t x = 0; x < uint32_t(var.rows) * var.columns; x++)
sourceVar.rows = RDCMAX(1U, (uint32_t)var.rows);
sourceVar.columns = RDCMAX(1U, (uint32_t)var.columns);
for(uint32_t x = 0; x < sourceVar.rows * sourceVar.columns; x++)
sourceVar.variables.push_back(DebugVariableReference(DebugVariableType::Variable, var.name, x));
sourceVars.push_back(sourceVar);
@@ -2599,6 +2599,21 @@ void main()
%_out_float4 = OpFAdd %float4 %_x %float4_1234
)EOTEST",
});
// test naming structs. Since we can't easily name auto-generated IDs we use a guid to give the
// ID a unique name
append_tests({
R"EOTEST(
%_a = OpCompositeConstruct %float4 %float_dyn_4_2 %float_dyn_1_0 %float_dyn_9_5 %float_dyn_0_01
%C14FA880_4F83_4982_BEAD_CE9103446C76 = OpCompositeInsert %parent %_a %null_parent 0
%_out_float4 = OpCompositeExtract %float4 %C14FA880_4F83_4982_BEAD_CE9103446C76 0
)EOTEST",
});
spv_debug +=
"OpName %C14FA880_4F83_4982_BEAD_CE9103446C76 \"C14FA880_4F83_4982_BEAD_CE9103446C76\"\n";
}
std::string make_pixel_asm()