Skip to content

Commit

Permalink
Add nontemporal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HildarTheDorf committed Feb 1, 2025
1 parent 858ed10 commit 5ae5c50
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Test/baseResults/spv.1.6.nontemporalimage.frag.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
spv.1.6.nontemporalimage.frag
// Module Version 10600
// Generated by (magic number): 8000b
// Id's are bound by 24

Capability Shader
Capability VulkanMemoryModelKHR
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical VulkanKHR
EntryPoint Fragment 4 "main" 9 12 18
ExecutionMode 4 OriginUpperLeft
Source GLSL 460
SourceExtension "GL_EXT_nontemporal_keyword"
Name 4 "main"
Name 9 "out_color"
Name 12 "u_image"
Name 16 "UNIFORMS"
MemberName 16(UNIFORMS) 0 "u_uv"
Name 18 ""
Decorate 9(out_color) Location 0
Decorate 12(u_image) NonWritable
Decorate 12(u_image) Binding 1
Decorate 12(u_image) DescriptorSet 0
Decorate 16(UNIFORMS) Block
MemberDecorate 16(UNIFORMS) 0 Offset 0
Decorate 18 Binding 0
Decorate 18 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(out_color): 8(ptr) Variable Output
10: TypeImage 6(float) 2D nonsampled format:Rgba8
11: TypePointer UniformConstant 10
12(u_image): 11(ptr) Variable UniformConstant
14: TypeInt 32 1
15: TypeVector 14(int) 2
16(UNIFORMS): TypeStruct 15(ivec2)
17: TypePointer Uniform 16(UNIFORMS)
18: 17(ptr) Variable Uniform
19: 14(int) Constant 0
20: TypePointer Uniform 15(ivec2)
4(main): 2 Function None 3
5: Label
13: 10 Load 12(u_image)
21: 20(ptr) AccessChain 18 19
22: 15(ivec2) Load 21
23: 7(fvec4) ImageRead 13 22
Store 9(out_color) 23
Return
FunctionEnd
53 changes: 53 additions & 0 deletions Test/baseResults/spv.nontemporalbuffer.frag.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
spv.nontemporalbuffer.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 24

Capability Shader
Capability VulkanMemoryModelKHR
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical VulkanKHR
EntryPoint Fragment 4 "main" 9
ExecutionMode 4 OriginUpperLeft
Source GLSL 460
SourceExtension "GL_EXT_nontemporal_keyword"
Name 4 "main"
Name 9 "out_color"
Name 12 "u_image"
Name 16 "UNIFORMS"
MemberName 16(UNIFORMS) 0 "u_uv"
Name 18 ""
Decorate 9(out_color) Location 0
Decorate 12(u_image) NonWritable
Decorate 12(u_image) Binding 1
Decorate 12(u_image) DescriptorSet 0
Decorate 16(UNIFORMS) Block
MemberDecorate 16(UNIFORMS) 0 Offset 0
Decorate 18 Binding 0
Decorate 18 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(out_color): 8(ptr) Variable Output
10: TypeImage 6(float) 2D nonsampled format:Rgba8
11: TypePointer UniformConstant 10
12(u_image): 11(ptr) Variable UniformConstant
14: TypeInt 32 1
15: TypeVector 14(int) 2
16(UNIFORMS): TypeStruct 15(ivec2)
17: TypePointer Uniform 16(UNIFORMS)
18: 17(ptr) Variable Uniform
19: 14(int) Constant 0
20: TypePointer Uniform 15(ivec2)
4(main): 2 Function None 3
5: Label
13: 10 Load 12(u_image)
21: 20(ptr) AccessChain 18 19
22: 15(ivec2) Load 21 Nontemporal
23: 7(fvec4) ImageRead 13 22
Store 9(out_color) 23
Return
FunctionEnd
16 changes: 16 additions & 0 deletions Test/spv.1.6.nontemporalimage.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#version 460

#pragma use_vulkan_memory_model

#extension GL_EXT_nontemporal_keyword: require

layout(binding=0) uniform UNIFORMS {
ivec2 u_uv;
};
layout(binding=1, rgba8) uniform readonly nontemporal image2D u_image;

layout(location=0) out vec4 out_color;

void main() {
out_color = imageLoad(u_image, u_uv);
}
16 changes: 16 additions & 0 deletions Test/spv.nontemporalbuffer.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#version 460

#pragma use_vulkan_memory_model

#extension GL_EXT_nontemporal_keyword: require

layout(binding=0) uniform nontemporal UNIFORMS {
ivec2 u_uv;
};
layout(binding=1, rgba8) uniform readonly image2D u_image;

layout(location=0) out vec4 out_color;

void main() {
out_color = imageLoad(u_image, u_uv);
}
2 changes: 2 additions & 0 deletions gtests/Spv.FromFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ INSTANTIATE_TEST_SUITE_P(
"spv.textureoffset_non_const.vert",
"spv.sparsetextureoffset_non_const.vert",
"spv.sparsetextureoffset_non_const_fail.vert",
"spv.nontemporalbuffer.frag"
})),
FileNameAsCustomTestSuffix
);
Expand Down Expand Up @@ -753,6 +754,7 @@ INSTANTIATE_TEST_SUITE_P(
"spv.coopmat2_constructor.comp",
"spv.coopmat2_error.comp",
"spv.coopmat2_tensor.comp",
"spv.1.6.nontemporalimage.frag"
})),
FileNameAsCustomTestSuffix
);
Expand Down

0 comments on commit 5ae5c50

Please sign in to comment.