Add names for composite constants in SPIR-V
Consider the following code:
layout(constant_id=0) const int Y = 1;
layout(constant_id=1) const int Z = 2;
layout(constant_id=3) const int X = Y + Z;
Previously, it would produce SPIR-V decorations like this:
Decorate 21(Y) SpecId 1
Decorate 22 SpecId 3
Decorate 33(Z) SpecId 0
This seems inaccurate, since the spec constant `X` that is dependent on
the two others did not get a name in the SPIR-V decorations. This behavior
may potentially negatively affect shader introspection capabilities.
This change alters the behavior to always add a name, which results in the code
above producing the following decorations:
Decorate 21(Y) SpecId 1
Decorate 22(X) SpecId 3
Decorate 33(Z) SpecId 0
This commit is contained in:
committed by
nicebyte
parent
b2b3d81e9b
commit
4c9876b34c
@@ -114,6 +114,10 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
|
||||
Name 526 "sf16"
|
||||
Name 527 "sf"
|
||||
Name 528 "sd"
|
||||
Name 529 "f16_to_f"
|
||||
Name 531 "f16_to_d"
|
||||
Name 532 "f_to_f16"
|
||||
Name 533 "d_to_f16"
|
||||
Decorate 512 ArrayStride 16
|
||||
Decorate 513 ArrayStride 32
|
||||
MemberDecorate 514(S) 0 Offset 0
|
||||
@@ -235,11 +239,11 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
|
||||
526(sf16):28(float16_t) SpecConstant 12288
|
||||
527(sf): 164(float) SpecConstant 1048576000
|
||||
528(sd):172(float64_t) SpecConstant 0 1071644672
|
||||
529: 164(float) SpecConstantOp 115 526(sf16)
|
||||
529(f16_to_f): 164(float) SpecConstantOp 115 526(sf16)
|
||||
530: 164(float) SpecConstantOp 115 526(sf16)
|
||||
531:172(float64_t) SpecConstantOp 115 530
|
||||
532:28(float16_t) SpecConstantOp 115 527(sf)
|
||||
533:28(float16_t) SpecConstantOp 115 528(sd)
|
||||
531(f16_to_d):172(float64_t) SpecConstantOp 115 530
|
||||
532(f_to_f16):28(float16_t) SpecConstantOp 115 527(sf)
|
||||
533(d_to_f16):28(float16_t) SpecConstantOp 115 528(sd)
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
Return
|
||||
|
||||
Reference in New Issue
Block a user