SPIRV-Tools/tools
qining 01df41dfdb Command line option for set default value for spec constant
Format:
```
--set-spec-constant-default-value "<spec id A>:<default value A> <spec id
B>:<default value B> ..."
```

Example:
  shader: `test.vert`
```

layout(constant_id = 100) const int myint = 10;
layout(constant_id = 101) const int myuint = 100;
layout(constant_id = 200) const float myfloat = 1.25;
layout(constant_id = 201) const double mydouble = 2.34;

void main() {}
```
  command line:
```
spirv-opt --set-spec-const-default-value "100:12   101:200 200:1.2323
201:1.2345" test.vert -o output.spv
```
  output:
```
      ...
               OpDecorate %7 SpecId 100
               OpDecorate %8 SpecId 101
               OpDecorate %10 SpecId 200
               OpDecorate %12 SpecId 201
       %void = OpTypeVoid
          %3 = OpTypeFunction %void
        %int = OpTypeInt 32 1
          %7 = OpSpecConstant %int 12
          %8 = OpSpecConstant %int 200
      %float = OpTypeFloat 32
         %10 = OpSpecConstant %float 1.23232
     %double = OpTypeFloat 64
         %12 = OpSpecConstant %double 2.34232
      ...
```
2016-09-22 14:28:59 -04:00
..
as Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
cfg Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
dis Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
emacs Update CMake condition for Emacs load/save helper 2016-09-12 16:51:35 -04:00
lesspipe Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
opt Command line option for set default value for spec constant 2016-09-22 14:28:59 -04:00
val Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
CMakeLists.txt add spirv-dis/spirv-as support for emacs when loading .spv binaries 2016-09-11 09:55:15 -06:00
io.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00