diff --git a/Makefile.am b/Makefile.am index 8364aaa3..2821ddc6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -98,6 +98,7 @@ vkd3d_shader_tests = \ tests/hlsl/gather-offset.shader_test \ tests/hlsl/gather.shader_test \ tests/hlsl/getdimensions.shader_test \ + tests/hlsl/half.shader_test \ tests/hlsl/initializer-flatten.shader_test \ tests/hlsl/initializer-implicit-array.shader_test \ tests/hlsl/initializer-invalid-arg-count.shader_test \ diff --git a/tests/hlsl/asfloat.shader_test b/tests/hlsl/asfloat.shader_test index 00238164..d2c0f9aa 100644 --- a/tests/hlsl/asfloat.shader_test +++ b/tests/hlsl/asfloat.shader_test @@ -5,7 +5,7 @@ shader model >= 4.0 uniform float f; uniform int i; uniform uint u; -uniform half h; +uniform float h; float4 main() : sv_target { @@ -14,7 +14,7 @@ float4 main() : sv_target ret.x = asfloat(f); ret.y = asfloat(i); ret.z = asfloat(u); - ret.w = asfloat(h); + ret.w = asfloat((half)h); return ret; } diff --git a/tests/hlsl/asuint.shader_test b/tests/hlsl/asuint.shader_test index 494229e7..0a2e39e5 100644 --- a/tests/hlsl/asuint.shader_test +++ b/tests/hlsl/asuint.shader_test @@ -5,7 +5,7 @@ shader model >= 4.0 uniform float f; uniform int i; uniform uint u; -uniform half h; +uniform float h; float4 main() : sv_target { @@ -14,7 +14,7 @@ float4 main() : sv_target ret.x = asuint(f); ret.y = asuint(i); ret.z = asuint(u); - ret.w = asuint(h); + ret.w = asuint((half)h); return ret; } diff --git a/tests/hlsl/cast-to-float.shader_test b/tests/hlsl/cast-to-float.shader_test index 69786ecc..7c32acfa 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -5,11 +5,11 @@ shader model >= 4.0 uniform int i; uniform uint u; uniform bool b; -uniform half h; +uniform float h; float4 main() : sv_target { - return float4(((float)i) + 1.5, ((float)u) - 2.5, ((float)b) / 2, h); + return float4(((float)i) + 1.5, ((float)u) - 2.5, ((float)b) / 2, (half)h); } [test] diff --git a/tests/hlsl/cast-to-int.shader_test b/tests/hlsl/cast-to-int.shader_test index efa60eed..ae566a03 100644 --- a/tests/hlsl/cast-to-int.shader_test +++ b/tests/hlsl/cast-to-int.shader_test @@ -5,7 +5,7 @@ shader model >= 4.0 uniform float f; uniform uint u; uniform bool b; -uniform half h; +uniform float h; float4 main() : sv_target { @@ -14,7 +14,7 @@ float4 main() : sv_target ret.x = ((float)(int)f) - 1.5; ret.y = ((float)(int)u) + 2.5; ret.z = ((float)(int)b) / 2; - ret.w = ((float)(int)h) + 3.5; + ret.w = ((float)(int)(half)h) + 3.5; return ret; } diff --git a/tests/hlsl/cast-to-uint.shader_test b/tests/hlsl/cast-to-uint.shader_test index 66853855..dece99b7 100644 --- a/tests/hlsl/cast-to-uint.shader_test +++ b/tests/hlsl/cast-to-uint.shader_test @@ -5,7 +5,7 @@ shader model >= 4.0 uniform float f; uniform int i; uniform bool b; -uniform half h; +uniform float h; float4 main() : sv_target { @@ -14,7 +14,7 @@ float4 main() : sv_target ret.x = ((float)(uint)f) - 1.5; ret.y = ((float)(uint)i) - 1.5; ret.z = ((float)(uint)b) / 2; - ret.w = ((float)(uint)h) + 0.5; + ret.w = ((float)(uint)(half)h) + 0.5; return ret; } diff --git a/tests/hlsl/half.shader_test b/tests/hlsl/half.shader_test new file mode 100644 index 00000000..95610235 --- /dev/null +++ b/tests/hlsl/half.shader_test @@ -0,0 +1,23 @@ +[pixel shader fail(sm<6) todo] +uniform half h; + +float4 main() : sv_target +{ + return 0; +} + +[require] +options: backcompat + +[pixel shader] +uniform half h; + +float4 main() : sv_target +{ + return h; +} + +[test] +uniform 0 float 10.0 +todo(sm>=6) draw quad +probe all rgba (10.0, 10.0, 10.0, 10.0)