[spv-out] Write debug names for all types, not just structs.

This affects a lot of snapshots, so it's in its own commit, for easier review.
This commit is contained in:
Jim Blandy 2021-08-28 21:51:49 -07:00 committed by Dzmitry Malyshau
parent 6b72099d76
commit 5b1c2e59f6
8 changed files with 18 additions and 18 deletions

View File

@ -770,12 +770,6 @@ impl Writer {
ref members,
span: _,
} => {
if self.flags.contains(WriterFlags::DEBUG) {
if let Some(ref name) = ty.name {
self.debugs.push(Instruction::name(id, name));
}
}
if top_level {
self.decorate(id, Decoration::Block, &[]);
}
@ -853,6 +847,12 @@ impl Writer {
// Add this handle as a new alias for that type.
self.lookup_type.insert(LookupType::Handle(handle), id);
if self.flags.contains(WriterFlags::DEBUG) {
if let Some(ref name) = ty.name {
self.debugs.push(Instruction::name(id, name));
}
}
Ok(id)
}

View File

@ -10,11 +10,11 @@ OpEntryPoint Vertex %39 "foo" %34 %37
OpEntryPoint GLCompute %84 "atomics"
OpExecutionMode %84 LocalSize 1 1 1
OpSource GLSL 450
OpName %25 "Bar"
OpMemberName %25 0 "matrix"
OpMemberName %25 1 "atom"
OpMemberName %25 2 "arr"
OpMemberName %25 3 "data"
OpName %25 "Bar"
OpName %27 "bar"
OpName %29 "foo"
OpName %31 "c"

View File

@ -10,10 +10,9 @@ OpEntryPoint GLCompute %43 "main" %40
OpExecutionMode %43 LocalSize 64 1 1
OpSource GLSL 450
OpName %3 "NUM_PARTICLES"
OpName %16 "Particle"
OpMemberName %16 0 "pos"
OpMemberName %16 1 "vel"
OpName %17 "SimParams"
OpName %16 "Particle"
OpMemberName %17 0 "deltaT"
OpMemberName %17 1 "rule1Distance"
OpMemberName %17 2 "rule2Distance"
@ -21,8 +20,9 @@ OpMemberName %17 3 "rule3Distance"
OpMemberName %17 4 "rule1Scale"
OpMemberName %17 5 "rule2Scale"
OpMemberName %17 6 "rule3Scale"
OpName %19 "Particles"
OpName %17 "SimParams"
OpMemberName %19 0 "particles"
OpName %19 "Particles"
OpName %21 "params"
OpName %23 "particlesSrc"
OpName %25 "particlesDst"

View File

@ -9,8 +9,8 @@ OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %48 "main" %45
OpExecutionMode %48 LocalSize 1 1 1
OpSource GLSL 450
OpName %9 "PrimeIndices"
OpMemberName %9 0 "data"
OpName %9 "PrimeIndices"
OpName %11 "v_indices"
OpName %13 "n"
OpName %15 "i"

View File

@ -10,7 +10,6 @@ OpEntryPoint Vertex %42 "main" %29 %31 %33 %35 %37 %39 %40 %41
OpEntryPoint Fragment %106 "main" %85 %88 %91 %94 %97 %100 %102 %104
OpExecutionMode %106 OriginUpperLeft
OpSource GLSL 450
OpName %25 "FragmentInput"
OpMemberName %25 0 "position"
OpMemberName %25 1 "flat"
OpMemberName %25 2 "linear"
@ -19,6 +18,7 @@ OpMemberName %25 4 "linear_sample"
OpMemberName %25 5 "perspective"
OpMemberName %25 6 "perspective_centroid"
OpMemberName %25 7 "perspective_sample"
OpName %25 "FragmentInput"
OpName %26 "out"
OpName %29 "position"
OpName %31 "flat"

View File

@ -9,10 +9,10 @@ OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpSource GLSL 450
OpName %15 "InStorage"
OpMemberName %15 0 "a"
OpName %17 "InUniform"
OpName %15 "InStorage"
OpMemberName %17 0 "a"
OpName %17 "InUniform"
OpName %23 "in_storage"
OpName %25 "in_uniform"
OpName %27 "image_2d_array"

View File

@ -12,9 +12,9 @@ OpExecutionMode %45 OriginUpperLeft
OpExecutionMode %61 OriginUpperLeft
OpSource GLSL 450
OpName %3 "c_scale"
OpName %10 "VertexOutput"
OpMemberName %10 0 "uv"
OpMemberName %10 1 "position"
OpName %10 "VertexOutput"
OpName %13 "u_texture"
OpName %15 "u_sampler"
OpName %18 "pos"

View File

@ -10,14 +10,14 @@ OpEntryPoint Fragment %77 "fs_main" %69 %72 %75
OpExecutionMode %77 OriginUpperLeft
OpSource GLSL 450
OpName %9 "c_max_lights"
OpName %14 "Globals"
OpMemberName %14 0 "num_lights"
OpName %17 "Light"
OpName %14 "Globals"
OpMemberName %17 0 "proj"
OpMemberName %17 1 "pos"
OpMemberName %17 2 "color"
OpName %19 "Lights"
OpName %17 "Light"
OpMemberName %19 0 "data"
OpName %19 "Lights"
OpName %24 "c_ambient"
OpName %25 "u_globals"
OpName %27 "s_lights"