From 727aacca189c07e9d5ff0793cb1dec70ede5a45b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 28 May 2024 14:43:36 +0200 Subject: [PATCH] tests: Add a few tests for the NULL value. Signed-off-by: Nikolay Sivov --- Makefile.am | 1 + tests/hlsl/null.shader_test | 81 +++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 tests/hlsl/null.shader_test diff --git a/Makefile.am b/Makefile.am index 619bcdf4..46772fd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -162,6 +162,7 @@ vkd3d_shader_tests = \ tests/hlsl/nointerpolation.shader_test \ tests/hlsl/non-const-indexing.shader_test \ tests/hlsl/normalize.shader_test \ + tests/hlsl/null.shader_test \ tests/hlsl/numeric-constructor-truncation.shader_test \ tests/hlsl/numeric-types.shader_test \ tests/hlsl/numthreads.shader_test \ diff --git a/tests/hlsl/null.shader_test b/tests/hlsl/null.shader_test new file mode 100644 index 00000000..bf0a0ce5 --- /dev/null +++ b/tests/hlsl/null.shader_test @@ -0,0 +1,81 @@ +[pixel shader fail] +float4 var = NULL; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail] +float4x4 var = NULL; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail] +struct s +{ + float4 f; +}; + +float4 main() : sv_target +{ + s var = (s)NULL; + return s.f; +} + +[pixel shader fail(sm<6)] +Texture var = null; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader todo] +SamplerState s +{ + UnknownField = NULL; +}; + +Texture t = NULL; +PixelShader ps = NULL; +VertexShader vs = NULL; + +float4 main() : sv_target +{ + return 0; +} + +[require] +shader model >= 4.0 + +[pixel shader fail(sm>=6) todo] +Texture2DMS t = NULL; + +RWTexture1D u1 = NULL; +RWTexture2D u2 = NULL; +RWTexture3D u3 = NULL; + +RWTexture1DArray ua1 = NULL; +RWTexture2DArray ua2 = NULL; + +RWBuffer b1 = NULL; + +float4 main() : sv_target +{ + return 0; +} + +[require] +shader model >= 5.0 + +[pixel shader fail(sm>=6) todo] +RasterizerOrderedTexture2D t1 = NULL; + +float4 main() : sv_target +{ + return 0; +}