mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/msl: Implement VKD3DSIH_LD2DMS.
This commit is contained in:
Notes:
Henri Verbeet
2025-06-11 20:37:50 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1560
@@ -861,10 +861,11 @@ static void msl_ld(struct msl_generator *gen, const struct vkd3d_shader_instruct
|
||||
data_type = VKD3D_DATA_FLOAT;
|
||||
}
|
||||
|
||||
if (resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMS
|
||||
|| resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_CUBE
|
||||
|| resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY
|
||||
|| resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY)
|
||||
if (resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_CUBE
|
||||
|| resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY
|
||||
|| (ins->opcode != VKD3DSIH_LD2DMS
|
||||
&& (resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMS
|
||||
|| resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY)))
|
||||
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_UNSUPPORTED,
|
||||
"Texel fetches from resource type %#x are not supported.", resource_type);
|
||||
|
||||
@@ -903,7 +904,10 @@ static void msl_ld(struct msl_generator *gen, const struct vkd3d_shader_instruct
|
||||
if (resource_type != VKD3D_SHADER_RESOURCE_BUFFER)
|
||||
{
|
||||
vkd3d_string_buffer_printf(read, ", ");
|
||||
if (ins->opcode != VKD3DSIH_LD2DMS)
|
||||
msl_print_src_with_type(read, gen, &ins->src[0], VKD3DSP_WRITEMASK_3, VKD3D_DATA_UINT);
|
||||
else
|
||||
msl_print_src_with_type(read, gen, &ins->src[2], VKD3DSP_WRITEMASK_0, VKD3D_DATA_UINT);
|
||||
}
|
||||
vkd3d_string_buffer_printf(read, "))");
|
||||
msl_print_swizzle(read, ins->src[1].swizzle, ins->dst[0].write_mask);
|
||||
@@ -1123,6 +1127,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
|
||||
msl_cast(gen, ins, "float");
|
||||
break;
|
||||
case VKD3DSIH_LD:
|
||||
case VKD3DSIH_LD2DMS:
|
||||
msl_ld(gen, ins);
|
||||
break;
|
||||
case VKD3DSIH_LOG:
|
||||
|
@@ -47,7 +47,7 @@ float4 main(float4 pos : sv_position) : sv_target
|
||||
}
|
||||
|
||||
[test]
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
||||
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
||||
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
||||
@@ -71,7 +71,7 @@ float4 main(float4 pos : sv_position) : sv_target
|
||||
}
|
||||
|
||||
[test]
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
||||
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
||||
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
||||
@@ -88,7 +88,7 @@ float4 main(float4 pos : sv_position) : sv_target
|
||||
}
|
||||
|
||||
[test]
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
||||
probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1)
|
||||
probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8)
|
||||
@@ -140,7 +140,7 @@ float4 main(float4 pos : sv_position) : sv_target
|
||||
}
|
||||
|
||||
[test]
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4)
|
||||
probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8)
|
||||
probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1)
|
||||
@@ -187,14 +187,14 @@ float4 main(float4 position : sv_position) : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 uint 0
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (32, 32) rgba(1.0, 0.25, 0.5, 1.0)
|
||||
uniform 0 uint 1
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (32, 32) rgba(2.0, 0.25, 0.5, 1.0)
|
||||
uniform 0 uint 2
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (32, 32) rgba(4.0, 0.25, 0.5, 1.0)
|
||||
uniform 0 uint 3
|
||||
todo(msl) draw quad
|
||||
draw quad
|
||||
probe (32, 32) rgba(8.0, 0.25, 0.5, 1.0)
|
||||
|
Reference in New Issue
Block a user