diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index a655179dd..56ec9790c 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -929,6 +929,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d switch (ins->opcode) { case VKD3DSIH_ADD: + case VKD3DSIH_IADD: msl_binop(gen, ins, "+"); break; case VKD3DSIH_AND: diff --git a/tests/hlsl/arithmetic-float-uniform.shader_test b/tests/hlsl/arithmetic-float-uniform.shader_test index aa10cb4cc..fc3e5bcf3 100644 --- a/tests/hlsl/arithmetic-float-uniform.shader_test +++ b/tests/hlsl/arithmetic-float-uniform.shader_test @@ -300,13 +300,13 @@ if(sm>=6) uniform 4 uint 0x4200 % i is allocated differently between SM4-5 and SM6 uniform 5 uint 2 uniform 8 uint 2 -todo(msl | sm>=6) draw quad +todo(sm>=6) draw quad probe (0, 0) rgba(10.25, 3.5, 0.0, 0.0) uniform 0 uint 0 uniform 4 uint 0 uniform 5 uint 0 uniform 8 uint 0 -todo(msl | sm>=6) draw quad +todo(sm>=6) draw quad probe (0, 0) rgba(1.0, 2.0, 0, 0) [pixel shader] diff --git a/tests/hlsl/arithmetic-int-uniform.shader_test b/tests/hlsl/arithmetic-int-uniform.shader_test index 1699c501f..f295becb7 100644 --- a/tests/hlsl/arithmetic-int-uniform.shader_test +++ b/tests/hlsl/arithmetic-int-uniform.shader_test @@ -271,7 +271,7 @@ uniform 0 uint 0 uniform 4 uint 0 uniform 8 uint 0xffd uniform 12 uint 1 -todo(msl) draw quad +draw quad probe (0, 0) rgbai(1, -0xfff, 0xffe, -0xffe) [pixel shader] @@ -290,14 +290,14 @@ uniform 4 uint 0xffe % i is allocated differently between SM4-5 and SM6 uniform 5 uint 2 uniform 8 uint 2 -todo(msl) draw quad +draw quad % In D3D12 with SM5 all reads to the array return 0 if(sm>=6 | !d3d12) probe (0, 0) rgbaui(0xfffff803, 0x1ffd, 0, 0) uniform 0 uint 0 uniform 4 uint 0 uniform 5 uint 0 uniform 8 uint 0 -todo(msl) draw quad +draw quad if(sm>=6 | !d3d12) probe (0, 0) rgbaui(1, 2, 0, 0) [pixel shader] diff --git a/tests/hlsl/arithmetic-uint.shader_test b/tests/hlsl/arithmetic-uint.shader_test index 3a3a60eaa..079351068 100644 --- a/tests/hlsl/arithmetic-uint.shader_test +++ b/tests/hlsl/arithmetic-uint.shader_test @@ -124,11 +124,11 @@ uint4 main() : sv_target [test] uniform 0 uint 0 uniform 4 uint 0 -todo(msl) draw quad +draw quad probe (0, 0) rgbaui(0xfff, 0x7ff, 0, 0) uniform 0 uint 1 uniform 4 uint 0xfff -todo(msl) draw quad +draw quad probe (0, 0) rgbaui(0x1000, 0x17fe, 0, 0) [pixel shader] @@ -147,14 +147,14 @@ uniform 4 uint 0xffe % i is allocated differently between SM4-5 and SM6 uniform 5 uint 2 uniform 8 uint 2 -todo(msl) draw quad +draw quad % In D3D12 with SM5 all reads to the array return 0 if(sm>=6 | !d3d12) probe (0, 0) rgbaui(0x801, 0x1ffd, 0, 0) uniform 0 uint 0 uniform 4 uint 0 uniform 5 uint 0 uniform 8 uint 0 -todo(msl) draw quad +draw quad if(sm>=6 | !d3d12) probe (0, 0) rgbaui(1, 2, 0, 0) [pixel shader] diff --git a/tests/hlsl/bool-semantics.shader_test b/tests/hlsl/bool-semantics.shader_test index 28100406a..b04ee1a1f 100644 --- a/tests/hlsl/bool-semantics.shader_test +++ b/tests/hlsl/bool-semantics.shader_test @@ -49,5 +49,5 @@ float4 main(struct input i) : sv_target } [test] -todo(msl) draw triangle strip 4 +draw triangle strip 4 probe (0, 0, 640, 480) rgba (0.0, 2.0, 2.0, 2.0) diff --git a/tests/hlsl/eval-attrib.shader_test b/tests/hlsl/eval-attrib.shader_test index b33abb38e..d78d83bb1 100644 --- a/tests/hlsl/eval-attrib.shader_test +++ b/tests/hlsl/eval-attrib.shader_test @@ -40,11 +40,11 @@ float4 main(float4 pos : SV_Position, uint sample_idx : SV_SampleIndex) : SV_Tar [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo(msl) draw triangle list 3 -todo probe ( 0, 0) rgba(0.25, 0.25, 0.25, 0.25) -todo probe (639, 0) rgba(0.0, 0.0, 0.0, 0.0) -todo probe ( 0, 479) rgba(0.25, 0.25, 0.25, 0.25) -todo probe (639, 479) rgba(0.0, 0.0, 0.0, 0.0) +draw triangle list 3 +todo(vulkan | opengl | d3d12) probe ( 0, 0) rgba(0.25, 0.25, 0.25, 0.25) +todo(vulkan | opengl | d3d12) probe (639, 0) rgba(0.0, 0.0, 0.0, 0.0) +todo(vulkan | opengl | d3d12) probe ( 0, 479) rgba(0.25, 0.25, 0.25, 0.25) +todo(vulkan | opengl | d3d12) probe (639, 479) rgba(0.0, 0.0, 0.0, 0.0) % Centroid interpolation, which means the pixel center if all samples are % covered and the first covered sample if a least a sample is not covered (in @@ -72,11 +72,11 @@ float4 main(centroid float4 pos : SV_Position, uint sample_idx : SV_SampleIndex) [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo(glsl | msl) draw triangle list 3 +todo(glsl) draw triangle list 3 todo probe ( 0, 0) rgba(0.25, 0.25, 0.25, 0.25) -todo probe (638, 0) rgba(0.0, 0.0, 0.0, 0.0) +todo(vulkan | opengl | d3d12) probe (638, 0) rgba(0.0, 0.0, 0.0, 0.0) todo probe ( 0, 478) rgba(0.25, 0.25, 0.25, 0.25) -todo probe (639, 479) rgba(0.0, 0.0, 0.0, 0.0) +todo(vulkan | opengl | d3d12) probe (639, 479) rgba(0.0, 0.0, 0.0, 0.0) % Sample interpolation. @@ -117,7 +117,7 @@ float4 main(float4 pos : SV_Position, float2 attr : ATTR, uint sample_idx : SV_S [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo(msl) draw triangle list 3 +draw triangle list 3 probe ( 0, 0) rgba(0.25, 0.25, 0.25, 0.25) probe (639, 0) rgba(0.0, 0.0, 0.0, 0.0) probe ( 0, 479) rgba(0.25, 0.25, 0.25, 0.25) diff --git a/tests/hlsl/hard-copy-prop.shader_test b/tests/hlsl/hard-copy-prop.shader_test index f61613995..40a2666de 100644 --- a/tests/hlsl/hard-copy-prop.shader_test +++ b/tests/hlsl/hard-copy-prop.shader_test @@ -151,11 +151,11 @@ uniform 8 float 3.0 uniform 12 float 4.0 if(sm<4) uniform 16 float4 0 1 0 0 if(sm>=4) uniform 16 uint4 0 1 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(3.0, 3.0, 3.0, 3.0) if(sm<4) uniform 16 float4 1 1 0 0 if(sm>=4) uniform 16 uint4 1 1 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(4.0, 4.0, 4.0, 4.0) % Copy-prop is currently unable to propagate the following, diff --git a/tests/hlsl/non-const-indexing.shader_test b/tests/hlsl/non-const-indexing.shader_test index e3468df05..fcf3c14a4 100644 --- a/tests/hlsl/non-const-indexing.shader_test +++ b/tests/hlsl/non-const-indexing.shader_test @@ -383,31 +383,31 @@ uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 if(sm<4) uniform 12 float4 0 0 0 0 if(sm>=4) uniform 12 int4 0 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(1.0, 2.0, 3.0, 4.0) if(sm<4) uniform 12 float4 1 0 0 0 if(sm>=4) uniform 12 int4 1 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(5.0, 6.0, 7.0, 8.0) if(sm<4) uniform 12 float4 0 1 0 0 if(sm>=4) uniform 12 int4 0 1 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(5.0, 6.0, 7.0, 8.0) if(sm<4) uniform 12 float4 1 1 0 0 if(sm>=4) uniform 12 int4 1 1 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(9.0, 10.0, 11.0, 12.0) if(sm<4) uniform 12 float4 0.5 0 0 0 if(sm>=4) uniform 12 int4 0 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(1.0, 2.0, 3.0, 4.0) if(sm<4) uniform 12 float4 0 1.4 0 0 if(sm>=4) uniform 12 int4 0 1 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(5.0, 6.0, 7.0, 8.0) if(sm<4) uniform 12 float4 1.5 0 0 0 if(sm>=4) uniform 12 int4 2 0 0 0 -todo(msl) draw quad +draw quad probe (0, 0) rgba(9.0, 10.0, 11.0, 12.0) [require] diff --git a/tests/hlsl/shader-interstage-interface.shader_test b/tests/hlsl/shader-interstage-interface.shader_test index 3be64d24e..44480947b 100644 --- a/tests/hlsl/shader-interstage-interface.shader_test +++ b/tests/hlsl/shader-interstage-interface.shader_test @@ -52,7 +52,7 @@ void main(float4 position : SV_Position, float2 t0 : TEXCOORD0, } [test] -todo(msl) draw triangle strip 4 +draw triangle strip 4 probe (0, 0) rgba (10.0, 8.0, 7.0, 3.0) [input layout] diff --git a/tests/shader_runner_metal.m b/tests/shader_runner_metal.m index 256099cac..dbcd3541d 100644 --- a/tests/shader_runner_metal.m +++ b/tests/shader_runner_metal.m @@ -92,10 +92,16 @@ static MTLVertexFormat get_metal_attribute_format(DXGI_FORMAT format) { case DXGI_FORMAT_R32G32B32A32_FLOAT: return MTLVertexFormatFloat4; + case DXGI_FORMAT_R32G32B32A32_UINT: + return MTLVertexFormatUInt4; case DXGI_FORMAT_R32G32_FLOAT: return MTLVertexFormatFloat2; case DXGI_FORMAT_R32G32_SINT: return MTLVertexFormatInt2; + case DXGI_FORMAT_R32_FLOAT: + return MTLVertexFormatFloat; + case DXGI_FORMAT_R32_UINT: + return MTLVertexFormatUInt; default: return MTLVertexFormatInvalid; }