Fix OpImageRead result type when compiling HLSL (#2706)

Fix OpImageRead result type when compiling HLSL

- Per the Vulkan spec, OpImageRead must return a 4-component vector always. When compiling HLSL, loads from a RWTexture of a template type with < 4 components would incorrectly generate an OpImageRead with a < 4 component result, resulting in validation errors.
- This was previously fixed for OpImageFetch in commit 4425f24; this commit does the same thing for OpImageRead.
- Added associated tests and expanded existing image fetch tests to check all the different types of textures, in both float and int incarnations, for completeness.
- Update other HLSL tests involving OpImageRead
This commit is contained in:
Nathan Reed 2021-07-28 08:29:17 -07:00 committed by GitHub
parent 4a12ee1ae3
commit fc9897d1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2907 additions and 1673 deletions

View File

@ -5317,7 +5317,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
int components = node->getType().getVectorSize();
if (node->getOp() == glslang::EOpTextureFetch) {
if (node->getOp() == glslang::EOpImageLoad ||
node->getOp() == glslang::EOpImageLoadLod ||
node->getOp() == glslang::EOpTextureFetch ||
node->getOp() == glslang::EOpTextureFetchOffset) {
// These must produce 4 components, per SPIR-V spec. We'll add a conversion constructor if needed.
// This will only happen through the HLSL path for operator[], so we do not have to handle e.g.
// the EOpTexture/Proj/Lod/etc family. It would be harmless to do so, but would need more logic

View File

@ -2,35 +2,204 @@ hlsl.imagefetch-subvec4.comp
Shader version: 500
local_size = (8, 8, 8)
0:? Sequence
0:6 Function Definition: @main(vu3; ( temp void)
0:6 Function Parameters:
0:6 'tid' ( in 3-component vector of uint)
0:21 Function Definition: @main(vu3; ( temp void)
0:21 Function Parameters:
0:21 'tid' ( in 3-component vector of uint)
0:? Sequence
0:7 Sequence
0:7 move second child to first child ( temp uint)
0:7 'storeTemp' ( temp uint)
0:7 Convert int to uint ( temp uint)
0:7 textureFetch ( temp int)
0:7 'IN' (layout( binding=0) uniform itexture3D)
0:7 'tid' ( in 3-component vector of uint)
0:7 Constant:
0:7 0 (const int)
0:7 imageStore ( temp void)
0:7 'OUT' (layout( binding=1 r32ui) uniform uimage3D)
0:7 'tid' ( in 3-component vector of uint)
0:7 'storeTemp' ( temp uint)
0:7 'storeTemp' ( temp uint)
0:6 Function Definition: main( ( temp void)
0:6 Function Parameters:
0:22 Sequence
0:22 move second child to first child ( temp float)
0:22 'f' ( temp float)
0:22 Constant:
0:22 0.000000
0:23 add second child into first child ( temp float)
0:23 'f' ( temp float)
0:23 textureFetch ( temp float)
0:23 'i1D' (layout( binding=0) uniform texture1D)
0:23 direct index ( temp uint)
0:23 'tid' ( in 3-component vector of uint)
0:23 Constant:
0:23 0 (const int)
0:23 Constant:
0:23 0 (const int)
0:24 add second child into first child ( temp float)
0:24 'f' ( temp float)
0:24 textureFetch ( temp float)
0:24 'i2D' (layout( binding=1) uniform texture2D)
0:24 vector swizzle ( temp 2-component vector of uint)
0:24 'tid' ( in 3-component vector of uint)
0:24 Sequence
0:24 Constant:
0:24 0 (const int)
0:24 Constant:
0:24 1 (const int)
0:24 Constant:
0:24 0 (const int)
0:25 add second child into first child ( temp float)
0:25 'f' ( temp float)
0:25 textureFetch ( temp float)
0:25 'i3D' (layout( binding=2) uniform texture3D)
0:25 'tid' ( in 3-component vector of uint)
0:25 Constant:
0:25 0 (const int)
0:26 add second child into first child ( temp float)
0:26 'f' ( temp float)
0:26 textureFetch ( temp float)
0:26 'i1DArray' (layout( binding=3) uniform texture1DArray)
0:26 vector swizzle ( temp 2-component vector of uint)
0:26 'tid' ( in 3-component vector of uint)
0:26 Sequence
0:26 Constant:
0:26 0 (const int)
0:26 Constant:
0:26 1 (const int)
0:26 Constant:
0:26 0 (const int)
0:27 add second child into first child ( temp float)
0:27 'f' ( temp float)
0:27 textureFetch ( temp float)
0:27 'i2DArray' (layout( binding=4) uniform texture2DArray)
0:27 'tid' ( in 3-component vector of uint)
0:27 Constant:
0:27 0 (const int)
0:28 add second child into first child ( temp float)
0:28 'f' ( temp float)
0:28 Construct float ( temp float)
0:? textureFetch ( temp 4-component vector of float)
0:28 'i2DMS' (layout( binding=5) uniform texture2DMS)
0:28 Convert uint to int ( temp 2-component vector of int)
0:28 vector swizzle ( temp 2-component vector of uint)
0:28 'tid' ( in 3-component vector of uint)
0:28 Sequence
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:28 Constant:
0:28 1 (const int)
0:29 add second child into first child ( temp float)
0:29 'f' ( temp float)
0:29 Construct float ( temp float)
0:? textureFetch ( temp 4-component vector of float)
0:29 'i2DMSArray' (layout( binding=6) uniform texture2DMSArray)
0:29 Convert uint to int ( temp 3-component vector of int)
0:29 'tid' ( in 3-component vector of uint)
0:29 Constant:
0:29 3 (const int)
0:31 Sequence
0:31 move second child to first child ( temp int)
0:31 'i' ( temp int)
0:31 Constant:
0:31 0 (const int)
0:32 add second child into first child ( temp int)
0:32 'i' ( temp int)
0:32 textureFetch ( temp int)
0:32 'ii1D' (layout( binding=7) uniform itexture1D)
0:32 direct index ( temp uint)
0:32 'tid' ( in 3-component vector of uint)
0:32 Constant:
0:32 0 (const int)
0:32 Constant:
0:32 0 (const int)
0:33 add second child into first child ( temp int)
0:33 'i' ( temp int)
0:33 textureFetch ( temp int)
0:33 'ii2D' (layout( binding=8) uniform itexture2D)
0:33 vector swizzle ( temp 2-component vector of uint)
0:33 'tid' ( in 3-component vector of uint)
0:33 Sequence
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 0 (const int)
0:34 add second child into first child ( temp int)
0:34 'i' ( temp int)
0:34 textureFetch ( temp int)
0:34 'ii3D' (layout( binding=9) uniform itexture3D)
0:34 'tid' ( in 3-component vector of uint)
0:34 Constant:
0:34 0 (const int)
0:35 add second child into first child ( temp int)
0:35 'i' ( temp int)
0:35 textureFetch ( temp int)
0:35 'ii1DArray' (layout( binding=10) uniform itexture1DArray)
0:35 vector swizzle ( temp 2-component vector of uint)
0:35 'tid' ( in 3-component vector of uint)
0:35 Sequence
0:35 Constant:
0:35 0 (const int)
0:35 Constant:
0:35 1 (const int)
0:35 Constant:
0:35 0 (const int)
0:36 add second child into first child ( temp int)
0:36 'i' ( temp int)
0:36 textureFetch ( temp int)
0:36 'ii2DArray' (layout( binding=11) uniform itexture2DArray)
0:36 'tid' ( in 3-component vector of uint)
0:36 Constant:
0:36 0 (const int)
0:37 add second child into first child ( temp int)
0:37 'i' ( temp int)
0:37 Construct int ( temp int)
0:? textureFetch ( temp 4-component vector of int)
0:37 'ii2DMS' (layout( binding=12) uniform itexture2DMS)
0:37 Convert uint to int ( temp 2-component vector of int)
0:37 vector swizzle ( temp 2-component vector of uint)
0:37 'tid' ( in 3-component vector of uint)
0:37 Sequence
0:37 Constant:
0:37 0 (const int)
0:37 Constant:
0:37 1 (const int)
0:37 Constant:
0:37 1 (const int)
0:38 add second child into first child ( temp int)
0:38 'i' ( temp int)
0:38 Construct int ( temp int)
0:? textureFetch ( temp 4-component vector of int)
0:38 'ii2DMSArray' (layout( binding=13) uniform itexture2DMSArray)
0:38 Convert uint to int ( temp 3-component vector of int)
0:38 'tid' ( in 3-component vector of uint)
0:38 Constant:
0:38 3 (const int)
0:40 Sequence
0:40 move second child to first child ( temp float)
0:40 'storeTemp' ( temp float)
0:40 add ( temp float)
0:40 'f' ( temp float)
0:40 Convert int to float ( temp float)
0:40 'i' ( temp int)
0:40 imageStore ( temp void)
0:40 'OUT' (layout( binding=0 r32f) uniform image3D)
0:40 'tid' ( in 3-component vector of uint)
0:40 'storeTemp' ( temp float)
0:40 'storeTemp' ( temp float)
0:21 Function Definition: main( ( temp void)
0:21 Function Parameters:
0:? Sequence
0:6 move second child to first child ( temp 3-component vector of uint)
0:21 move second child to first child ( temp 3-component vector of uint)
0:? 'tid' ( temp 3-component vector of uint)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
0:6 Function Call: @main(vu3; ( temp void)
0:21 Function Call: @main(vu3; ( temp void)
0:? 'tid' ( temp 3-component vector of uint)
0:? Linker Objects
0:? 'IN' (layout( binding=0) uniform itexture3D)
0:? 'OUT' (layout( binding=1 r32ui) uniform uimage3D)
0:? 'i1D' (layout( binding=0) uniform texture1D)
0:? 'i2D' (layout( binding=1) uniform texture2D)
0:? 'i3D' (layout( binding=2) uniform texture3D)
0:? 'i1DArray' (layout( binding=3) uniform texture1DArray)
0:? 'i2DArray' (layout( binding=4) uniform texture2DArray)
0:? 'i2DMS' (layout( binding=5) uniform texture2DMS)
0:? 'i2DMSArray' (layout( binding=6) uniform texture2DMSArray)
0:? 'ii1D' (layout( binding=7) uniform itexture1D)
0:? 'ii2D' (layout( binding=8) uniform itexture2D)
0:? 'ii3D' (layout( binding=9) uniform itexture3D)
0:? 'ii1DArray' (layout( binding=10) uniform itexture1DArray)
0:? 'ii2DArray' (layout( binding=11) uniform itexture2DArray)
0:? 'ii2DMS' (layout( binding=12) uniform itexture2DMS)
0:? 'ii2DMSArray' (layout( binding=13) uniform itexture2DMSArray)
0:? 'OUT' (layout( binding=0 r32f) uniform image3D)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
@ -40,103 +209,477 @@ Linked compute stage:
Shader version: 500
local_size = (8, 8, 8)
0:? Sequence
0:6 Function Definition: @main(vu3; ( temp void)
0:6 Function Parameters:
0:6 'tid' ( in 3-component vector of uint)
0:21 Function Definition: @main(vu3; ( temp void)
0:21 Function Parameters:
0:21 'tid' ( in 3-component vector of uint)
0:? Sequence
0:7 Sequence
0:7 move second child to first child ( temp uint)
0:7 'storeTemp' ( temp uint)
0:7 Convert int to uint ( temp uint)
0:7 textureFetch ( temp int)
0:7 'IN' (layout( binding=0) uniform itexture3D)
0:7 'tid' ( in 3-component vector of uint)
0:7 Constant:
0:7 0 (const int)
0:7 imageStore ( temp void)
0:7 'OUT' (layout( binding=1 r32ui) uniform uimage3D)
0:7 'tid' ( in 3-component vector of uint)
0:7 'storeTemp' ( temp uint)
0:7 'storeTemp' ( temp uint)
0:6 Function Definition: main( ( temp void)
0:6 Function Parameters:
0:22 Sequence
0:22 move second child to first child ( temp float)
0:22 'f' ( temp float)
0:22 Constant:
0:22 0.000000
0:23 add second child into first child ( temp float)
0:23 'f' ( temp float)
0:23 textureFetch ( temp float)
0:23 'i1D' (layout( binding=0) uniform texture1D)
0:23 direct index ( temp uint)
0:23 'tid' ( in 3-component vector of uint)
0:23 Constant:
0:23 0 (const int)
0:23 Constant:
0:23 0 (const int)
0:24 add second child into first child ( temp float)
0:24 'f' ( temp float)
0:24 textureFetch ( temp float)
0:24 'i2D' (layout( binding=1) uniform texture2D)
0:24 vector swizzle ( temp 2-component vector of uint)
0:24 'tid' ( in 3-component vector of uint)
0:24 Sequence
0:24 Constant:
0:24 0 (const int)
0:24 Constant:
0:24 1 (const int)
0:24 Constant:
0:24 0 (const int)
0:25 add second child into first child ( temp float)
0:25 'f' ( temp float)
0:25 textureFetch ( temp float)
0:25 'i3D' (layout( binding=2) uniform texture3D)
0:25 'tid' ( in 3-component vector of uint)
0:25 Constant:
0:25 0 (const int)
0:26 add second child into first child ( temp float)
0:26 'f' ( temp float)
0:26 textureFetch ( temp float)
0:26 'i1DArray' (layout( binding=3) uniform texture1DArray)
0:26 vector swizzle ( temp 2-component vector of uint)
0:26 'tid' ( in 3-component vector of uint)
0:26 Sequence
0:26 Constant:
0:26 0 (const int)
0:26 Constant:
0:26 1 (const int)
0:26 Constant:
0:26 0 (const int)
0:27 add second child into first child ( temp float)
0:27 'f' ( temp float)
0:27 textureFetch ( temp float)
0:27 'i2DArray' (layout( binding=4) uniform texture2DArray)
0:27 'tid' ( in 3-component vector of uint)
0:27 Constant:
0:27 0 (const int)
0:28 add second child into first child ( temp float)
0:28 'f' ( temp float)
0:28 Construct float ( temp float)
0:? textureFetch ( temp 4-component vector of float)
0:28 'i2DMS' (layout( binding=5) uniform texture2DMS)
0:28 Convert uint to int ( temp 2-component vector of int)
0:28 vector swizzle ( temp 2-component vector of uint)
0:28 'tid' ( in 3-component vector of uint)
0:28 Sequence
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:28 Constant:
0:28 1 (const int)
0:29 add second child into first child ( temp float)
0:29 'f' ( temp float)
0:29 Construct float ( temp float)
0:? textureFetch ( temp 4-component vector of float)
0:29 'i2DMSArray' (layout( binding=6) uniform texture2DMSArray)
0:29 Convert uint to int ( temp 3-component vector of int)
0:29 'tid' ( in 3-component vector of uint)
0:29 Constant:
0:29 3 (const int)
0:31 Sequence
0:31 move second child to first child ( temp int)
0:31 'i' ( temp int)
0:31 Constant:
0:31 0 (const int)
0:32 add second child into first child ( temp int)
0:32 'i' ( temp int)
0:32 textureFetch ( temp int)
0:32 'ii1D' (layout( binding=7) uniform itexture1D)
0:32 direct index ( temp uint)
0:32 'tid' ( in 3-component vector of uint)
0:32 Constant:
0:32 0 (const int)
0:32 Constant:
0:32 0 (const int)
0:33 add second child into first child ( temp int)
0:33 'i' ( temp int)
0:33 textureFetch ( temp int)
0:33 'ii2D' (layout( binding=8) uniform itexture2D)
0:33 vector swizzle ( temp 2-component vector of uint)
0:33 'tid' ( in 3-component vector of uint)
0:33 Sequence
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 0 (const int)
0:34 add second child into first child ( temp int)
0:34 'i' ( temp int)
0:34 textureFetch ( temp int)
0:34 'ii3D' (layout( binding=9) uniform itexture3D)
0:34 'tid' ( in 3-component vector of uint)
0:34 Constant:
0:34 0 (const int)
0:35 add second child into first child ( temp int)
0:35 'i' ( temp int)
0:35 textureFetch ( temp int)
0:35 'ii1DArray' (layout( binding=10) uniform itexture1DArray)
0:35 vector swizzle ( temp 2-component vector of uint)
0:35 'tid' ( in 3-component vector of uint)
0:35 Sequence
0:35 Constant:
0:35 0 (const int)
0:35 Constant:
0:35 1 (const int)
0:35 Constant:
0:35 0 (const int)
0:36 add second child into first child ( temp int)
0:36 'i' ( temp int)
0:36 textureFetch ( temp int)
0:36 'ii2DArray' (layout( binding=11) uniform itexture2DArray)
0:36 'tid' ( in 3-component vector of uint)
0:36 Constant:
0:36 0 (const int)
0:37 add second child into first child ( temp int)
0:37 'i' ( temp int)
0:37 Construct int ( temp int)
0:? textureFetch ( temp 4-component vector of int)
0:37 'ii2DMS' (layout( binding=12) uniform itexture2DMS)
0:37 Convert uint to int ( temp 2-component vector of int)
0:37 vector swizzle ( temp 2-component vector of uint)
0:37 'tid' ( in 3-component vector of uint)
0:37 Sequence
0:37 Constant:
0:37 0 (const int)
0:37 Constant:
0:37 1 (const int)
0:37 Constant:
0:37 1 (const int)
0:38 add second child into first child ( temp int)
0:38 'i' ( temp int)
0:38 Construct int ( temp int)
0:? textureFetch ( temp 4-component vector of int)
0:38 'ii2DMSArray' (layout( binding=13) uniform itexture2DMSArray)
0:38 Convert uint to int ( temp 3-component vector of int)
0:38 'tid' ( in 3-component vector of uint)
0:38 Constant:
0:38 3 (const int)
0:40 Sequence
0:40 move second child to first child ( temp float)
0:40 'storeTemp' ( temp float)
0:40 add ( temp float)
0:40 'f' ( temp float)
0:40 Convert int to float ( temp float)
0:40 'i' ( temp int)
0:40 imageStore ( temp void)
0:40 'OUT' (layout( binding=0 r32f) uniform image3D)
0:40 'tid' ( in 3-component vector of uint)
0:40 'storeTemp' ( temp float)
0:40 'storeTemp' ( temp float)
0:21 Function Definition: main( ( temp void)
0:21 Function Parameters:
0:? Sequence
0:6 move second child to first child ( temp 3-component vector of uint)
0:21 move second child to first child ( temp 3-component vector of uint)
0:? 'tid' ( temp 3-component vector of uint)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
0:6 Function Call: @main(vu3; ( temp void)
0:21 Function Call: @main(vu3; ( temp void)
0:? 'tid' ( temp 3-component vector of uint)
0:? Linker Objects
0:? 'IN' (layout( binding=0) uniform itexture3D)
0:? 'OUT' (layout( binding=1 r32ui) uniform uimage3D)
0:? 'i1D' (layout( binding=0) uniform texture1D)
0:? 'i2D' (layout( binding=1) uniform texture2D)
0:? 'i3D' (layout( binding=2) uniform texture3D)
0:? 'i1DArray' (layout( binding=3) uniform texture1DArray)
0:? 'i2DArray' (layout( binding=4) uniform texture2DArray)
0:? 'i2DMS' (layout( binding=5) uniform texture2DMS)
0:? 'i2DMSArray' (layout( binding=6) uniform texture2DMSArray)
0:? 'ii1D' (layout( binding=7) uniform itexture1D)
0:? 'ii2D' (layout( binding=8) uniform itexture2D)
0:? 'ii3D' (layout( binding=9) uniform itexture3D)
0:? 'ii1DArray' (layout( binding=10) uniform itexture1DArray)
0:? 'ii2DArray' (layout( binding=11) uniform itexture2DArray)
0:? 'ii2DMS' (layout( binding=12) uniform itexture2DMS)
0:? 'ii2DMSArray' (layout( binding=13) uniform itexture2DMSArray)
0:? 'OUT' (layout( binding=0 r32f) uniform image3D)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 39
// Id's are bound by 186
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 34
EntryPoint GLCompute 4 "main" 181
ExecutionMode 4 LocalSize 8 8 8
Source HLSL 500
Name 4 "main"
Name 11 "@main(vu3;"
Name 10 "tid"
Name 14 "storeTemp"
Name 18 "IN"
Name 28 "OUT"
Name 32 "tid"
Name 34 "tid"
Name 36 "param"
Decorate 18(IN) DescriptorSet 0
Decorate 18(IN) Binding 0
Decorate 28(OUT) DescriptorSet 0
Decorate 28(OUT) Binding 1
Decorate 34(tid) BuiltIn GlobalInvocationId
Name 15 "f"
Name 19 "i1D"
Name 34 "i2D"
Name 45 "i3D"
Name 54 "i1DArray"
Name 64 "i2DArray"
Name 73 "i2DMS"
Name 86 "i2DMSArray"
Name 97 "i"
Name 100 "ii1D"
Name 111 "ii2D"
Name 121 "ii3D"
Name 130 "ii1DArray"
Name 140 "ii2DArray"
Name 149 "ii2DMS"
Name 160 "ii2DMSArray"
Name 168 "storeTemp"
Name 175 "OUT"
Name 179 "tid"
Name 181 "tid"
Name 183 "param"
Decorate 19(i1D) DescriptorSet 0
Decorate 19(i1D) Binding 0
Decorate 34(i2D) DescriptorSet 0
Decorate 34(i2D) Binding 1
Decorate 45(i3D) DescriptorSet 0
Decorate 45(i3D) Binding 2
Decorate 54(i1DArray) DescriptorSet 0
Decorate 54(i1DArray) Binding 3
Decorate 64(i2DArray) DescriptorSet 0
Decorate 64(i2DArray) Binding 4
Decorate 73(i2DMS) DescriptorSet 0
Decorate 73(i2DMS) Binding 5
Decorate 86(i2DMSArray) DescriptorSet 0
Decorate 86(i2DMSArray) Binding 6
Decorate 100(ii1D) DescriptorSet 0
Decorate 100(ii1D) Binding 7
Decorate 111(ii2D) DescriptorSet 0
Decorate 111(ii2D) Binding 8
Decorate 121(ii3D) DescriptorSet 0
Decorate 121(ii3D) Binding 9
Decorate 130(ii1DArray) DescriptorSet 0
Decorate 130(ii1DArray) Binding 10
Decorate 140(ii2DArray) DescriptorSet 0
Decorate 140(ii2DArray) Binding 11
Decorate 149(ii2DMS) DescriptorSet 0
Decorate 149(ii2DMS) Binding 12
Decorate 160(ii2DMSArray) DescriptorSet 0
Decorate 160(ii2DMSArray) Binding 13
Decorate 175(OUT) DescriptorSet 0
Decorate 175(OUT) Binding 0
Decorate 181(tid) BuiltIn GlobalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 3
8: TypePointer Function 7(ivec3)
9: TypeFunction 2 8(ptr)
13: TypePointer Function 6(int)
15: TypeInt 32 1
16: TypeImage 15(int) 3D sampled format:Unknown
17: TypePointer UniformConstant 16
18(IN): 17(ptr) Variable UniformConstant
21: 15(int) Constant 0
22: TypeVector 15(int) 4
26: TypeImage 6(int) 3D nonsampled format:R32ui
27: TypePointer UniformConstant 26
28(OUT): 27(ptr) Variable UniformConstant
33: TypePointer Input 7(ivec3)
34(tid): 33(ptr) Variable Input
13: TypeFloat 32
14: TypePointer Function 13(float)
16: 13(float) Constant 0
17: TypeImage 13(float) 1D sampled format:Unknown
18: TypePointer UniformConstant 17
19(i1D): 18(ptr) Variable UniformConstant
21: 6(int) Constant 0
22: TypePointer Function 6(int)
25: TypeInt 32 1
26: 25(int) Constant 0
27: TypeVector 13(float) 4
32: TypeImage 13(float) 2D sampled format:Unknown
33: TypePointer UniformConstant 32
34(i2D): 33(ptr) Variable UniformConstant
36: TypeVector 6(int) 2
43: TypeImage 13(float) 3D sampled format:Unknown
44: TypePointer UniformConstant 43
45(i3D): 44(ptr) Variable UniformConstant
52: TypeImage 13(float) 1D array sampled format:Unknown
53: TypePointer UniformConstant 52
54(i1DArray): 53(ptr) Variable UniformConstant
62: TypeImage 13(float) 2D array sampled format:Unknown
63: TypePointer UniformConstant 62
64(i2DArray): 63(ptr) Variable UniformConstant
71: TypeImage 13(float) 2D multi-sampled sampled format:Unknown
72: TypePointer UniformConstant 71
73(i2DMS): 72(ptr) Variable UniformConstant
77: TypeVector 25(int) 2
79: 25(int) Constant 1
84: TypeImage 13(float) 2D array multi-sampled sampled format:Unknown
85: TypePointer UniformConstant 84
86(i2DMSArray): 85(ptr) Variable UniformConstant
89: TypeVector 25(int) 3
91: 25(int) Constant 3
96: TypePointer Function 25(int)
98: TypeImage 25(int) 1D sampled format:Unknown
99: TypePointer UniformConstant 98
100(ii1D): 99(ptr) Variable UniformConstant
104: TypeVector 25(int) 4
109: TypeImage 25(int) 2D sampled format:Unknown
110: TypePointer UniformConstant 109
111(ii2D): 110(ptr) Variable UniformConstant
119: TypeImage 25(int) 3D sampled format:Unknown
120: TypePointer UniformConstant 119
121(ii3D): 120(ptr) Variable UniformConstant
128: TypeImage 25(int) 1D array sampled format:Unknown
129: TypePointer UniformConstant 128
130(ii1DArray): 129(ptr) Variable UniformConstant
138: TypeImage 25(int) 2D array sampled format:Unknown
139: TypePointer UniformConstant 138
140(ii2DArray): 139(ptr) Variable UniformConstant
147: TypeImage 25(int) 2D multi-sampled sampled format:Unknown
148: TypePointer UniformConstant 147
149(ii2DMS): 148(ptr) Variable UniformConstant
158: TypeImage 25(int) 2D array multi-sampled sampled format:Unknown
159: TypePointer UniformConstant 158
160(ii2DMSArray): 159(ptr) Variable UniformConstant
173: TypeImage 13(float) 3D nonsampled format:R32f
174: TypePointer UniformConstant 173
175(OUT): 174(ptr) Variable UniformConstant
180: TypePointer Input 7(ivec3)
181(tid): 180(ptr) Variable Input
4(main): 2 Function None 3
5: Label
32(tid): 8(ptr) Variable Function
36(param): 8(ptr) Variable Function
35: 7(ivec3) Load 34(tid)
Store 32(tid) 35
37: 7(ivec3) Load 32(tid)
Store 36(param) 37
38: 2 FunctionCall 11(@main(vu3;) 36(param)
179(tid): 8(ptr) Variable Function
183(param): 8(ptr) Variable Function
182: 7(ivec3) Load 181(tid)
Store 179(tid) 182
184: 7(ivec3) Load 179(tid)
Store 183(param) 184
185: 2 FunctionCall 11(@main(vu3;) 183(param)
Return
FunctionEnd
11(@main(vu3;): 2 Function None 9
10(tid): 8(ptr) FunctionParameter
12: Label
14(storeTemp): 13(ptr) Variable Function
19: 16 Load 18(IN)
20: 7(ivec3) Load 10(tid)
23: 22(ivec4) ImageFetch 19 20 Lod 21
24: 15(int) CompositeExtract 23 0
25: 6(int) Bitcast 24
Store 14(storeTemp) 25
29: 26 Load 28(OUT)
30: 7(ivec3) Load 10(tid)
31: 6(int) Load 14(storeTemp)
ImageWrite 29 30 31
15(f): 14(ptr) Variable Function
97(i): 96(ptr) Variable Function
168(storeTemp): 14(ptr) Variable Function
Store 15(f) 16
20: 17 Load 19(i1D)
23: 22(ptr) AccessChain 10(tid) 21
24: 6(int) Load 23
28: 27(fvec4) ImageFetch 20 24 Lod 26
29: 13(float) CompositeExtract 28 0
30: 13(float) Load 15(f)
31: 13(float) FAdd 30 29
Store 15(f) 31
35: 32 Load 34(i2D)
37: 7(ivec3) Load 10(tid)
38: 36(ivec2) VectorShuffle 37 37 0 1
39: 27(fvec4) ImageFetch 35 38 Lod 26
40: 13(float) CompositeExtract 39 0
41: 13(float) Load 15(f)
42: 13(float) FAdd 41 40
Store 15(f) 42
46: 43 Load 45(i3D)
47: 7(ivec3) Load 10(tid)
48: 27(fvec4) ImageFetch 46 47 Lod 26
49: 13(float) CompositeExtract 48 0
50: 13(float) Load 15(f)
51: 13(float) FAdd 50 49
Store 15(f) 51
55: 52 Load 54(i1DArray)
56: 7(ivec3) Load 10(tid)
57: 36(ivec2) VectorShuffle 56 56 0 1
58: 27(fvec4) ImageFetch 55 57 Lod 26
59: 13(float) CompositeExtract 58 0
60: 13(float) Load 15(f)
61: 13(float) FAdd 60 59
Store 15(f) 61
65: 62 Load 64(i2DArray)
66: 7(ivec3) Load 10(tid)
67: 27(fvec4) ImageFetch 65 66 Lod 26
68: 13(float) CompositeExtract 67 0
69: 13(float) Load 15(f)
70: 13(float) FAdd 69 68
Store 15(f) 70
74: 71 Load 73(i2DMS)
75: 7(ivec3) Load 10(tid)
76: 36(ivec2) VectorShuffle 75 75 0 1
78: 77(ivec2) Bitcast 76
80: 27(fvec4) ImageFetch 74 78 Sample 79
81: 13(float) CompositeExtract 80 0
82: 13(float) Load 15(f)
83: 13(float) FAdd 82 81
Store 15(f) 83
87: 84 Load 86(i2DMSArray)
88: 7(ivec3) Load 10(tid)
90: 89(ivec3) Bitcast 88
92: 27(fvec4) ImageFetch 87 90 Sample 91
93: 13(float) CompositeExtract 92 0
94: 13(float) Load 15(f)
95: 13(float) FAdd 94 93
Store 15(f) 95
Store 97(i) 26
101: 98 Load 100(ii1D)
102: 22(ptr) AccessChain 10(tid) 21
103: 6(int) Load 102
105: 104(ivec4) ImageFetch 101 103 Lod 26
106: 25(int) CompositeExtract 105 0
107: 25(int) Load 97(i)
108: 25(int) IAdd 107 106
Store 97(i) 108
112: 109 Load 111(ii2D)
113: 7(ivec3) Load 10(tid)
114: 36(ivec2) VectorShuffle 113 113 0 1
115: 104(ivec4) ImageFetch 112 114 Lod 26
116: 25(int) CompositeExtract 115 0
117: 25(int) Load 97(i)
118: 25(int) IAdd 117 116
Store 97(i) 118
122: 119 Load 121(ii3D)
123: 7(ivec3) Load 10(tid)
124: 104(ivec4) ImageFetch 122 123 Lod 26
125: 25(int) CompositeExtract 124 0
126: 25(int) Load 97(i)
127: 25(int) IAdd 126 125
Store 97(i) 127
131: 128 Load 130(ii1DArray)
132: 7(ivec3) Load 10(tid)
133: 36(ivec2) VectorShuffle 132 132 0 1
134: 104(ivec4) ImageFetch 131 133 Lod 26
135: 25(int) CompositeExtract 134 0
136: 25(int) Load 97(i)
137: 25(int) IAdd 136 135
Store 97(i) 137
141: 138 Load 140(ii2DArray)
142: 7(ivec3) Load 10(tid)
143: 104(ivec4) ImageFetch 141 142 Lod 26
144: 25(int) CompositeExtract 143 0
145: 25(int) Load 97(i)
146: 25(int) IAdd 145 144
Store 97(i) 146
150: 147 Load 149(ii2DMS)
151: 7(ivec3) Load 10(tid)
152: 36(ivec2) VectorShuffle 151 151 0 1
153: 77(ivec2) Bitcast 152
154: 104(ivec4) ImageFetch 150 153 Sample 79
155: 25(int) CompositeExtract 154 0
156: 25(int) Load 97(i)
157: 25(int) IAdd 156 155
Store 97(i) 157
161: 158 Load 160(ii2DMSArray)
162: 7(ivec3) Load 10(tid)
163: 89(ivec3) Bitcast 162
164: 104(ivec4) ImageFetch 161 163 Sample 91
165: 25(int) CompositeExtract 164 0
166: 25(int) Load 97(i)
167: 25(int) IAdd 166 165
Store 97(i) 167
169: 13(float) Load 15(f)
170: 25(int) Load 97(i)
171: 13(float) ConvertSToF 170
172: 13(float) FAdd 169 171
Store 168(storeTemp) 172
176: 173 Load 175(OUT)
177: 7(ivec3) Load 10(tid)
178: 13(float) Load 168(storeTemp)
ImageWrite 176 177 178
Return
FunctionEnd

View File

@ -0,0 +1,477 @@
hlsl.imageload-subvec4.comp
Shader version: 500
local_size = (8, 8, 8)
0:? Sequence
0:17 Function Definition: @main(vu3; ( temp void)
0:17 Function Parameters:
0:17 'tid' ( in 3-component vector of uint)
0:? Sequence
0:18 Sequence
0:18 move second child to first child ( temp float)
0:18 'f' ( temp float)
0:18 Constant:
0:18 0.000000
0:19 add second child into first child ( temp float)
0:19 'f' ( temp float)
0:19 imageLoad ( temp float)
0:19 'i1D' (layout( binding=0 r32f) uniform image1D)
0:19 direct index ( temp uint)
0:19 'tid' ( in 3-component vector of uint)
0:19 Constant:
0:19 0 (const int)
0:20 add second child into first child ( temp float)
0:20 'f' ( temp float)
0:20 imageLoad ( temp float)
0:20 'i2D' (layout( binding=1 r32f) uniform image2D)
0:20 vector swizzle ( temp 2-component vector of uint)
0:20 'tid' ( in 3-component vector of uint)
0:20 Sequence
0:20 Constant:
0:20 0 (const int)
0:20 Constant:
0:20 1 (const int)
0:21 add second child into first child ( temp float)
0:21 'f' ( temp float)
0:21 imageLoad ( temp float)
0:21 'i3D' (layout( binding=2 r32f) uniform image3D)
0:21 'tid' ( in 3-component vector of uint)
0:22 add second child into first child ( temp float)
0:22 'f' ( temp float)
0:22 imageLoad ( temp float)
0:22 'i1DArray' (layout( binding=3 r32f) uniform image1DArray)
0:22 vector swizzle ( temp 2-component vector of uint)
0:22 'tid' ( in 3-component vector of uint)
0:22 Sequence
0:22 Constant:
0:22 0 (const int)
0:22 Constant:
0:22 1 (const int)
0:23 add second child into first child ( temp float)
0:23 'f' ( temp float)
0:23 imageLoad ( temp float)
0:23 'i2DArray' (layout( binding=4 r32f) uniform image2DArray)
0:23 'tid' ( in 3-component vector of uint)
0:25 Sequence
0:25 move second child to first child ( temp int)
0:25 'i' ( temp int)
0:25 Constant:
0:25 0 (const int)
0:26 add second child into first child ( temp int)
0:26 'i' ( temp int)
0:26 imageLoad ( temp int)
0:26 'ii1D' (layout( binding=5 r32i) uniform iimage1D)
0:26 direct index ( temp uint)
0:26 'tid' ( in 3-component vector of uint)
0:26 Constant:
0:26 0 (const int)
0:27 add second child into first child ( temp int)
0:27 'i' ( temp int)
0:27 imageLoad ( temp int)
0:27 'ii2D' (layout( binding=6 r32i) uniform iimage2D)
0:27 vector swizzle ( temp 2-component vector of uint)
0:27 'tid' ( in 3-component vector of uint)
0:27 Sequence
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 1 (const int)
0:28 add second child into first child ( temp int)
0:28 'i' ( temp int)
0:28 imageLoad ( temp int)
0:28 'ii3D' (layout( binding=7 r32i) uniform iimage3D)
0:28 'tid' ( in 3-component vector of uint)
0:29 add second child into first child ( temp int)
0:29 'i' ( temp int)
0:29 imageLoad ( temp int)
0:29 'ii1DArray' (layout( binding=8 r32i) uniform iimage1DArray)
0:29 vector swizzle ( temp 2-component vector of uint)
0:29 'tid' ( in 3-component vector of uint)
0:29 Sequence
0:29 Constant:
0:29 0 (const int)
0:29 Constant:
0:29 1 (const int)
0:30 add second child into first child ( temp int)
0:30 'i' ( temp int)
0:30 imageLoad ( temp int)
0:30 'ii2DArray' (layout( binding=9 r32i) uniform iimage2DArray)
0:30 'tid' ( in 3-component vector of uint)
0:32 Sequence
0:32 move second child to first child ( temp float)
0:32 'storeTemp' ( temp float)
0:32 add ( temp float)
0:32 'f' ( temp float)
0:32 Convert int to float ( temp float)
0:32 'i' ( temp int)
0:32 imageStore ( temp void)
0:32 'OUT' (layout( binding=10 r32f) uniform image3D)
0:32 'tid' ( in 3-component vector of uint)
0:32 'storeTemp' ( temp float)
0:32 'storeTemp' ( temp float)
0:17 Function Definition: main( ( temp void)
0:17 Function Parameters:
0:? Sequence
0:17 move second child to first child ( temp 3-component vector of uint)
0:? 'tid' ( temp 3-component vector of uint)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
0:17 Function Call: @main(vu3; ( temp void)
0:? 'tid' ( temp 3-component vector of uint)
0:? Linker Objects
0:? 'i1D' (layout( binding=0 r32f) uniform image1D)
0:? 'i2D' (layout( binding=1 r32f) uniform image2D)
0:? 'i3D' (layout( binding=2 r32f) uniform image3D)
0:? 'i1DArray' (layout( binding=3 r32f) uniform image1DArray)
0:? 'i2DArray' (layout( binding=4 r32f) uniform image2DArray)
0:? 'ii1D' (layout( binding=5 r32i) uniform iimage1D)
0:? 'ii2D' (layout( binding=6 r32i) uniform iimage2D)
0:? 'ii3D' (layout( binding=7 r32i) uniform iimage3D)
0:? 'ii1DArray' (layout( binding=8 r32i) uniform iimage1DArray)
0:? 'ii2DArray' (layout( binding=9 r32i) uniform iimage2DArray)
0:? 'OUT' (layout( binding=10 r32f) uniform image3D)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
Linked compute stage:
Shader version: 500
local_size = (8, 8, 8)
0:? Sequence
0:17 Function Definition: @main(vu3; ( temp void)
0:17 Function Parameters:
0:17 'tid' ( in 3-component vector of uint)
0:? Sequence
0:18 Sequence
0:18 move second child to first child ( temp float)
0:18 'f' ( temp float)
0:18 Constant:
0:18 0.000000
0:19 add second child into first child ( temp float)
0:19 'f' ( temp float)
0:19 imageLoad ( temp float)
0:19 'i1D' (layout( binding=0 r32f) uniform image1D)
0:19 direct index ( temp uint)
0:19 'tid' ( in 3-component vector of uint)
0:19 Constant:
0:19 0 (const int)
0:20 add second child into first child ( temp float)
0:20 'f' ( temp float)
0:20 imageLoad ( temp float)
0:20 'i2D' (layout( binding=1 r32f) uniform image2D)
0:20 vector swizzle ( temp 2-component vector of uint)
0:20 'tid' ( in 3-component vector of uint)
0:20 Sequence
0:20 Constant:
0:20 0 (const int)
0:20 Constant:
0:20 1 (const int)
0:21 add second child into first child ( temp float)
0:21 'f' ( temp float)
0:21 imageLoad ( temp float)
0:21 'i3D' (layout( binding=2 r32f) uniform image3D)
0:21 'tid' ( in 3-component vector of uint)
0:22 add second child into first child ( temp float)
0:22 'f' ( temp float)
0:22 imageLoad ( temp float)
0:22 'i1DArray' (layout( binding=3 r32f) uniform image1DArray)
0:22 vector swizzle ( temp 2-component vector of uint)
0:22 'tid' ( in 3-component vector of uint)
0:22 Sequence
0:22 Constant:
0:22 0 (const int)
0:22 Constant:
0:22 1 (const int)
0:23 add second child into first child ( temp float)
0:23 'f' ( temp float)
0:23 imageLoad ( temp float)
0:23 'i2DArray' (layout( binding=4 r32f) uniform image2DArray)
0:23 'tid' ( in 3-component vector of uint)
0:25 Sequence
0:25 move second child to first child ( temp int)
0:25 'i' ( temp int)
0:25 Constant:
0:25 0 (const int)
0:26 add second child into first child ( temp int)
0:26 'i' ( temp int)
0:26 imageLoad ( temp int)
0:26 'ii1D' (layout( binding=5 r32i) uniform iimage1D)
0:26 direct index ( temp uint)
0:26 'tid' ( in 3-component vector of uint)
0:26 Constant:
0:26 0 (const int)
0:27 add second child into first child ( temp int)
0:27 'i' ( temp int)
0:27 imageLoad ( temp int)
0:27 'ii2D' (layout( binding=6 r32i) uniform iimage2D)
0:27 vector swizzle ( temp 2-component vector of uint)
0:27 'tid' ( in 3-component vector of uint)
0:27 Sequence
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 1 (const int)
0:28 add second child into first child ( temp int)
0:28 'i' ( temp int)
0:28 imageLoad ( temp int)
0:28 'ii3D' (layout( binding=7 r32i) uniform iimage3D)
0:28 'tid' ( in 3-component vector of uint)
0:29 add second child into first child ( temp int)
0:29 'i' ( temp int)
0:29 imageLoad ( temp int)
0:29 'ii1DArray' (layout( binding=8 r32i) uniform iimage1DArray)
0:29 vector swizzle ( temp 2-component vector of uint)
0:29 'tid' ( in 3-component vector of uint)
0:29 Sequence
0:29 Constant:
0:29 0 (const int)
0:29 Constant:
0:29 1 (const int)
0:30 add second child into first child ( temp int)
0:30 'i' ( temp int)
0:30 imageLoad ( temp int)
0:30 'ii2DArray' (layout( binding=9 r32i) uniform iimage2DArray)
0:30 'tid' ( in 3-component vector of uint)
0:32 Sequence
0:32 move second child to first child ( temp float)
0:32 'storeTemp' ( temp float)
0:32 add ( temp float)
0:32 'f' ( temp float)
0:32 Convert int to float ( temp float)
0:32 'i' ( temp int)
0:32 imageStore ( temp void)
0:32 'OUT' (layout( binding=10 r32f) uniform image3D)
0:32 'tid' ( in 3-component vector of uint)
0:32 'storeTemp' ( temp float)
0:32 'storeTemp' ( temp float)
0:17 Function Definition: main( ( temp void)
0:17 Function Parameters:
0:? Sequence
0:17 move second child to first child ( temp 3-component vector of uint)
0:? 'tid' ( temp 3-component vector of uint)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
0:17 Function Call: @main(vu3; ( temp void)
0:? 'tid' ( temp 3-component vector of uint)
0:? Linker Objects
0:? 'i1D' (layout( binding=0 r32f) uniform image1D)
0:? 'i2D' (layout( binding=1 r32f) uniform image2D)
0:? 'i3D' (layout( binding=2 r32f) uniform image3D)
0:? 'i1DArray' (layout( binding=3 r32f) uniform image1DArray)
0:? 'i2DArray' (layout( binding=4 r32f) uniform image2DArray)
0:? 'ii1D' (layout( binding=5 r32i) uniform iimage1D)
0:? 'ii2D' (layout( binding=6 r32i) uniform iimage2D)
0:? 'ii3D' (layout( binding=7 r32i) uniform iimage3D)
0:? 'ii1DArray' (layout( binding=8 r32i) uniform iimage1DArray)
0:? 'ii2DArray' (layout( binding=9 r32i) uniform iimage2DArray)
0:? 'OUT' (layout( binding=10 r32f) uniform image3D)
0:? 'tid' ( in 3-component vector of uint GlobalInvocationID)
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 138
Capability Shader
Capability Image1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 133
ExecutionMode 4 LocalSize 8 8 8
Source HLSL 500
Name 4 "main"
Name 11 "@main(vu3;"
Name 10 "tid"
Name 15 "f"
Name 19 "i1D"
Name 32 "i2D"
Name 43 "i3D"
Name 52 "i1DArray"
Name 62 "i2DArray"
Name 71 "i"
Name 75 "ii1D"
Name 86 "ii2D"
Name 96 "ii3D"
Name 105 "ii1DArray"
Name 115 "ii2DArray"
Name 122 "storeTemp"
Name 127 "OUT"
Name 131 "tid"
Name 133 "tid"
Name 135 "param"
Decorate 19(i1D) DescriptorSet 0
Decorate 19(i1D) Binding 0
Decorate 32(i2D) DescriptorSet 0
Decorate 32(i2D) Binding 1
Decorate 43(i3D) DescriptorSet 0
Decorate 43(i3D) Binding 2
Decorate 52(i1DArray) DescriptorSet 0
Decorate 52(i1DArray) Binding 3
Decorate 62(i2DArray) DescriptorSet 0
Decorate 62(i2DArray) Binding 4
Decorate 75(ii1D) DescriptorSet 0
Decorate 75(ii1D) Binding 5
Decorate 86(ii2D) DescriptorSet 0
Decorate 86(ii2D) Binding 6
Decorate 96(ii3D) DescriptorSet 0
Decorate 96(ii3D) Binding 7
Decorate 105(ii1DArray) DescriptorSet 0
Decorate 105(ii1DArray) Binding 8
Decorate 115(ii2DArray) DescriptorSet 0
Decorate 115(ii2DArray) Binding 9
Decorate 127(OUT) DescriptorSet 0
Decorate 127(OUT) Binding 10
Decorate 133(tid) BuiltIn GlobalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 3
8: TypePointer Function 7(ivec3)
9: TypeFunction 2 8(ptr)
13: TypeFloat 32
14: TypePointer Function 13(float)
16: 13(float) Constant 0
17: TypeImage 13(float) 1D nonsampled format:R32f
18: TypePointer UniformConstant 17
19(i1D): 18(ptr) Variable UniformConstant
21: 6(int) Constant 0
22: TypePointer Function 6(int)
25: TypeVector 13(float) 4
30: TypeImage 13(float) 2D nonsampled format:R32f
31: TypePointer UniformConstant 30
32(i2D): 31(ptr) Variable UniformConstant
34: TypeVector 6(int) 2
41: TypeImage 13(float) 3D nonsampled format:R32f
42: TypePointer UniformConstant 41
43(i3D): 42(ptr) Variable UniformConstant
50: TypeImage 13(float) 1D array nonsampled format:R32f
51: TypePointer UniformConstant 50
52(i1DArray): 51(ptr) Variable UniformConstant
60: TypeImage 13(float) 2D array nonsampled format:R32f
61: TypePointer UniformConstant 60
62(i2DArray): 61(ptr) Variable UniformConstant
69: TypeInt 32 1
70: TypePointer Function 69(int)
72: 69(int) Constant 0
73: TypeImage 69(int) 1D nonsampled format:R32i
74: TypePointer UniformConstant 73
75(ii1D): 74(ptr) Variable UniformConstant
79: TypeVector 69(int) 4
84: TypeImage 69(int) 2D nonsampled format:R32i
85: TypePointer UniformConstant 84
86(ii2D): 85(ptr) Variable UniformConstant
94: TypeImage 69(int) 3D nonsampled format:R32i
95: TypePointer UniformConstant 94
96(ii3D): 95(ptr) Variable UniformConstant
103: TypeImage 69(int) 1D array nonsampled format:R32i
104: TypePointer UniformConstant 103
105(ii1DArray): 104(ptr) Variable UniformConstant
113: TypeImage 69(int) 2D array nonsampled format:R32i
114: TypePointer UniformConstant 113
115(ii2DArray): 114(ptr) Variable UniformConstant
127(OUT): 42(ptr) Variable UniformConstant
132: TypePointer Input 7(ivec3)
133(tid): 132(ptr) Variable Input
4(main): 2 Function None 3
5: Label
131(tid): 8(ptr) Variable Function
135(param): 8(ptr) Variable Function
134: 7(ivec3) Load 133(tid)
Store 131(tid) 134
136: 7(ivec3) Load 131(tid)
Store 135(param) 136
137: 2 FunctionCall 11(@main(vu3;) 135(param)
Return
FunctionEnd
11(@main(vu3;): 2 Function None 9
10(tid): 8(ptr) FunctionParameter
12: Label
15(f): 14(ptr) Variable Function
71(i): 70(ptr) Variable Function
122(storeTemp): 14(ptr) Variable Function
Store 15(f) 16
20: 17 Load 19(i1D)
23: 22(ptr) AccessChain 10(tid) 21
24: 6(int) Load 23
26: 25(fvec4) ImageRead 20 24
27: 13(float) CompositeExtract 26 0
28: 13(float) Load 15(f)
29: 13(float) FAdd 28 27
Store 15(f) 29
33: 30 Load 32(i2D)
35: 7(ivec3) Load 10(tid)
36: 34(ivec2) VectorShuffle 35 35 0 1
37: 25(fvec4) ImageRead 33 36
38: 13(float) CompositeExtract 37 0
39: 13(float) Load 15(f)
40: 13(float) FAdd 39 38
Store 15(f) 40
44: 41 Load 43(i3D)
45: 7(ivec3) Load 10(tid)
46: 25(fvec4) ImageRead 44 45
47: 13(float) CompositeExtract 46 0
48: 13(float) Load 15(f)
49: 13(float) FAdd 48 47
Store 15(f) 49
53: 50 Load 52(i1DArray)
54: 7(ivec3) Load 10(tid)
55: 34(ivec2) VectorShuffle 54 54 0 1
56: 25(fvec4) ImageRead 53 55
57: 13(float) CompositeExtract 56 0
58: 13(float) Load 15(f)
59: 13(float) FAdd 58 57
Store 15(f) 59
63: 60 Load 62(i2DArray)
64: 7(ivec3) Load 10(tid)
65: 25(fvec4) ImageRead 63 64
66: 13(float) CompositeExtract 65 0
67: 13(float) Load 15(f)
68: 13(float) FAdd 67 66
Store 15(f) 68
Store 71(i) 72
76: 73 Load 75(ii1D)
77: 22(ptr) AccessChain 10(tid) 21
78: 6(int) Load 77
80: 79(ivec4) ImageRead 76 78
81: 69(int) CompositeExtract 80 0
82: 69(int) Load 71(i)
83: 69(int) IAdd 82 81
Store 71(i) 83
87: 84 Load 86(ii2D)
88: 7(ivec3) Load 10(tid)
89: 34(ivec2) VectorShuffle 88 88 0 1
90: 79(ivec4) ImageRead 87 89
91: 69(int) CompositeExtract 90 0
92: 69(int) Load 71(i)
93: 69(int) IAdd 92 91
Store 71(i) 93
97: 94 Load 96(ii3D)
98: 7(ivec3) Load 10(tid)
99: 79(ivec4) ImageRead 97 98
100: 69(int) CompositeExtract 99 0
101: 69(int) Load 71(i)
102: 69(int) IAdd 101 100
Store 71(i) 102
106: 103 Load 105(ii1DArray)
107: 7(ivec3) Load 10(tid)
108: 34(ivec2) VectorShuffle 107 107 0 1
109: 79(ivec4) ImageRead 106 108
110: 69(int) CompositeExtract 109 0
111: 69(int) Load 71(i)
112: 69(int) IAdd 111 110
Store 71(i) 112
116: 113 Load 115(ii2DArray)
117: 7(ivec3) Load 10(tid)
118: 79(ivec4) ImageRead 116 117
119: 69(int) CompositeExtract 118 0
120: 69(int) Load 71(i)
121: 69(int) IAdd 120 119
Store 71(i) 121
123: 13(float) Load 15(f)
124: 69(int) Load 71(i)
125: 13(float) ConvertSToF 124
126: 13(float) FAdd 123 125
Store 122(storeTemp) 126
128: 41 Load 127(OUT)
129: 7(ivec3) Load 10(tid)
130: 13(float) Load 122(storeTemp)
ImageWrite 128 129 130
Return
FunctionEnd

View File

@ -97,17 +97,16 @@ gl_FragCoord origin is upper left
0:? 'g_tBuf1du1' (layout( binding=3 r32ui) uniform uimageBuffer)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
Validation failed
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 42
// Id's are bound by 45
Capability Shader
Capability Image1D
Capability ImageBuffer
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 39
EntryPoint Fragment 4 "main" 42
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@ -116,15 +115,15 @@ Validation failed
Name 10 "@main("
Name 13 "r00"
Name 16 "g_tTex1df1"
Name 23 "r01"
Name 26 "g_tBuf1du1"
Name 30 "psout"
Name 39 "@entryPointOutput.Color"
Name 24 "r01"
Name 27 "g_tBuf1du1"
Name 33 "psout"
Name 42 "@entryPointOutput.Color"
Decorate 16(g_tTex1df1) DescriptorSet 0
Decorate 16(g_tTex1df1) Binding 2
Decorate 26(g_tBuf1du1) DescriptorSet 0
Decorate 26(g_tBuf1du1) Binding 3
Decorate 39(@entryPointOutput.Color) Location 0
Decorate 27(g_tBuf1du1) DescriptorSet 0
Decorate 27(g_tBuf1du1) Binding 3
Decorate 42(@entryPointOutput.Color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -137,37 +136,40 @@ Validation failed
16(g_tTex1df1): 15(ptr) Variable UniformConstant
18: TypeInt 32 1
19: 18(int) Constant 0
21: TypeInt 32 0
22: TypePointer Function 21(int)
24: TypeImage 21(int) Buffer nonsampled format:R32ui
25: TypePointer UniformConstant 24
26(g_tBuf1du1): 25(ptr) Variable UniformConstant
29: TypePointer Function 8(PS_OUTPUT)
31: 6(float) Constant 1065353216
32: 7(fvec4) ConstantComposite 31 31 31 31
33: TypePointer Function 7(fvec4)
38: TypePointer Output 7(fvec4)
39(@entryPointOutput.Color): 38(ptr) Variable Output
22: TypeInt 32 0
23: TypePointer Function 22(int)
25: TypeImage 22(int) Buffer nonsampled format:R32ui
26: TypePointer UniformConstant 25
27(g_tBuf1du1): 26(ptr) Variable UniformConstant
29: TypeVector 22(int) 4
32: TypePointer Function 8(PS_OUTPUT)
34: 6(float) Constant 1065353216
35: 7(fvec4) ConstantComposite 34 34 34 34
36: TypePointer Function 7(fvec4)
41: TypePointer Output 7(fvec4)
42(@entryPointOutput.Color): 41(ptr) Variable Output
4(main): 2 Function None 3
5: Label
40:8(PS_OUTPUT) FunctionCall 10(@main()
41: 7(fvec4) CompositeExtract 40 0
Store 39(@entryPointOutput.Color) 41
43:8(PS_OUTPUT) FunctionCall 10(@main()
44: 7(fvec4) CompositeExtract 43 0
Store 42(@entryPointOutput.Color) 44
Return
FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9
11: Label
13(r00): 12(ptr) Variable Function
23(r01): 22(ptr) Variable Function
30(psout): 29(ptr) Variable Function
24(r01): 23(ptr) Variable Function
33(psout): 32(ptr) Variable Function
17: 14 Load 16(g_tTex1df1)
20: 6(float) ImageRead 17 19
Store 13(r00) 20
27: 24 Load 26(g_tBuf1du1)
28: 21(int) ImageRead 27 19
Store 23(r01) 28
34: 33(ptr) AccessChain 30(psout) 19
Store 34 32
35:8(PS_OUTPUT) Load 30(psout)
ReturnValue 35
20: 7(fvec4) ImageRead 17 19
21: 6(float) CompositeExtract 20 0
Store 13(r00) 21
28: 25 Load 27(g_tBuf1du1)
30: 29(ivec4) ImageRead 28 19
31: 22(int) CompositeExtract 30 0
Store 24(r01) 31
37: 36(ptr) AccessChain 33(psout) 19
Store 37 35
38:8(PS_OUTPUT) Load 33(psout)
ReturnValue 38
FunctionEnd

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,14 @@
spv.rw.autoassign.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 42
// Id's are bound by 45
Capability Shader
Capability Image1D
Capability ImageBuffer
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 39
EntryPoint Fragment 4 "main" 42
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@ -18,15 +17,15 @@ Validation failed
Name 10 "@main("
Name 13 "r00"
Name 16 "g_tTex1df1"
Name 23 "r01"
Name 26 "g_tBuf1du1"
Name 30 "psout"
Name 39 "@entryPointOutput.Color"
Name 24 "r01"
Name 27 "g_tBuf1du1"
Name 33 "psout"
Name 42 "@entryPointOutput.Color"
Decorate 16(g_tTex1df1) DescriptorSet 0
Decorate 16(g_tTex1df1) Binding 20
Decorate 26(g_tBuf1du1) DescriptorSet 0
Decorate 26(g_tBuf1du1) Binding 21
Decorate 39(@entryPointOutput.Color) Location 0
Decorate 27(g_tBuf1du1) DescriptorSet 0
Decorate 27(g_tBuf1du1) Binding 21
Decorate 42(@entryPointOutput.Color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -39,37 +38,40 @@ Validation failed
16(g_tTex1df1): 15(ptr) Variable UniformConstant
18: TypeInt 32 1
19: 18(int) Constant 0
21: TypeInt 32 0
22: TypePointer Function 21(int)
24: TypeImage 21(int) Buffer nonsampled format:R32ui
25: TypePointer UniformConstant 24
26(g_tBuf1du1): 25(ptr) Variable UniformConstant
29: TypePointer Function 8(PS_OUTPUT)
31: 6(float) Constant 0
32: 7(fvec4) ConstantComposite 31 31 31 31
33: TypePointer Function 7(fvec4)
38: TypePointer Output 7(fvec4)
39(@entryPointOutput.Color): 38(ptr) Variable Output
22: TypeInt 32 0
23: TypePointer Function 22(int)
25: TypeImage 22(int) Buffer nonsampled format:R32ui
26: TypePointer UniformConstant 25
27(g_tBuf1du1): 26(ptr) Variable UniformConstant
29: TypeVector 22(int) 4
32: TypePointer Function 8(PS_OUTPUT)
34: 6(float) Constant 0
35: 7(fvec4) ConstantComposite 34 34 34 34
36: TypePointer Function 7(fvec4)
41: TypePointer Output 7(fvec4)
42(@entryPointOutput.Color): 41(ptr) Variable Output
4(main): 2 Function None 3
5: Label
40:8(PS_OUTPUT) FunctionCall 10(@main()
41: 7(fvec4) CompositeExtract 40 0
Store 39(@entryPointOutput.Color) 41
43:8(PS_OUTPUT) FunctionCall 10(@main()
44: 7(fvec4) CompositeExtract 43 0
Store 42(@entryPointOutput.Color) 44
Return
FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9
11: Label
13(r00): 12(ptr) Variable Function
23(r01): 22(ptr) Variable Function
30(psout): 29(ptr) Variable Function
24(r01): 23(ptr) Variable Function
33(psout): 32(ptr) Variable Function
17: 14 Load 16(g_tTex1df1)
20: 6(float) ImageRead 17 19
Store 13(r00) 20
27: 24 Load 26(g_tBuf1du1)
28: 21(int) ImageRead 27 19
Store 23(r01) 28
34: 33(ptr) AccessChain 30(psout) 19
Store 34 32
35:8(PS_OUTPUT) Load 30(psout)
ReturnValue 35
20: 7(fvec4) ImageRead 17 19
21: 6(float) CompositeExtract 20 0
Store 13(r00) 21
28: 25 Load 27(g_tBuf1du1)
30: 29(ivec4) ImageRead 28 19
31: 22(int) CompositeExtract 30 0
Store 24(r01) 31
37: 36(ptr) AccessChain 33(psout) 19
Store 37 35
38:8(PS_OUTPUT) Load 33(psout)
ReturnValue 38
FunctionEnd

View File

@ -1,8 +1,41 @@
Texture3D<int> IN: register(t0);
RWTexture3D<uint> OUT: register(u1);
Texture1D<float> i1D: register(t0);
Texture2D<float> i2D: register(t1);
Texture3D<float> i3D: register(t2);
Texture1DArray<float> i1DArray: register(t3);
Texture2DArray<float> i2DArray: register(t4);
Texture2DMS<float> i2DMS: register(t5);
Texture2DMSArray<float> i2DMSArray: register(t6);
Texture1D<int> ii1D: register(t7);
Texture2D<int> ii2D: register(t8);
Texture3D<int> ii3D: register(t9);
Texture1DArray<int> ii1DArray: register(t10);
Texture2DArray<int> ii2DArray: register(t11);
Texture2DMS<int> ii2DMS: register(t12);
Texture2DMSArray<int> ii2DMSArray: register(t13);
RWTexture3D<float> OUT: register(u0);
[numthreads(8,8,8)]
void main(uint3 tid: SV_DispatchThreadID)
{
OUT[tid] = IN[tid];
float f = 0.0;
f += i1D[tid.x];
f += i2D[tid.xy];
f += i3D[tid];
f += i1DArray[tid.xy];
f += i2DArray[tid];
f += i2DMS.Load(tid.xy, 1);
f += i2DMSArray.Load(tid, 3);
int i = 0.0;
i += ii1D[tid.x];
i += ii2D[tid.xy];
i += ii3D[tid];
i += ii1DArray[tid.xy];
i += ii2DArray[tid];
i += ii2DMS.Load(tid.xy, 1);
i += ii2DMSArray.Load(tid, 3);
OUT[tid] = f + float(i);
}

View File

@ -0,0 +1,33 @@
RWTexture1D<float> i1D: register(u0);
RWTexture2D<float> i2D: register(u1);
RWTexture3D<float> i3D: register(u2);
RWTexture1DArray<float> i1DArray: register(u3);
RWTexture2DArray<float> i2DArray: register(u4);
RWTexture1D<int> ii1D: register(u5);
RWTexture2D<int> ii2D: register(u6);
RWTexture3D<int> ii3D: register(u7);
RWTexture1DArray<int> ii1DArray: register(u8);
RWTexture2DArray<int> ii2DArray: register(u9);
RWTexture3D<float> OUT: register(u10);
[numthreads(8,8,8)]
void main(uint3 tid: SV_DispatchThreadID)
{
float f = 0.0;
f += i1D[tid.x];
f += i2D[tid.xy];
f += i3D[tid];
f += i1DArray[tid.xy];
f += i2DArray[tid];
int i = 0.0;
i += ii1D[tid.x];
i += ii2D[tid.xy];
i += ii3D[tid];
i += ii1DArray[tid.xy];
i += ii2DArray[tid];
OUT[tid] = f + float(i);
}

View File

@ -235,6 +235,7 @@ INSTANTIATE_TEST_SUITE_P(
{"hlsl.groupid.comp", "main"},
{"hlsl.identifier.sample.frag", "main"},
{"hlsl.if.frag", "PixelShaderFunction"},
{"hlsl.imageload-subvec4.comp", "main"},
{"hlsl.imagefetch-subvec4.comp", "main"},
{"hlsl.implicitBool.frag", "main"},
{"hlsl.inf.vert", "main"},