vkd3d-shader/msl: Implement VSIR_OP_CONTINUE.

This commit is contained in:
Henri Verbeet
2025-05-28 10:14:33 +02:00
parent d219cccc99
commit cdfaeb209a
Notes: Henri Verbeet 2025-06-25 17:09:09 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1600
3 changed files with 12 additions and 3 deletions

View File

@@ -836,6 +836,12 @@ static void msl_break(struct msl_generator *gen)
vkd3d_string_buffer_printf(gen->buffer, "break;\n"); vkd3d_string_buffer_printf(gen->buffer, "break;\n");
} }
static void msl_continue(struct msl_generator *gen)
{
msl_print_indent(gen->buffer, gen->indent);
vkd3d_string_buffer_printf(gen->buffer, "continue;\n");
}
static void msl_switch(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins) static void msl_switch(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
{ {
struct msl_src src; struct msl_src src;
@@ -1286,6 +1292,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VSIR_OP_CASE: case VSIR_OP_CASE:
msl_case(gen, ins); msl_case(gen, ins);
break; break;
case VSIR_OP_CONTINUE:
msl_continue(gen);
break;
case VSIR_OP_DCL_INDEXABLE_TEMP: case VSIR_OP_DCL_INDEXABLE_TEMP:
msl_dcl_indexable_temp(gen, ins); msl_dcl_indexable_temp(gen, ins);
break; break;

View File

@@ -54,7 +54,7 @@ float4 main(float tex : texcoord) : sv_target
[test] [test]
uniform 0 uint4 10 0 0 0 uniform 0 uint4 10 0 0 0
todo(msl) draw quad draw quad
probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0) probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0)
probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0) probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0)
probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0) probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0)

View File

@@ -574,11 +574,11 @@ float4 main() : sv_target
[test] [test]
if(sm<4) uniform 0 float4 1 0 3 1 if(sm<4) uniform 0 float4 1 0 3 1
if(sm>=4) uniform 0 uint4 1 0 3 1 if(sm>=4) uniform 0 uint4 1 0 3 1
todo(msl) draw quad draw quad
probe (0, 0) rgba (10.0, 11.0, 12.0, 13.0) probe (0, 0) rgba (10.0, 11.0, 12.0, 13.0)
if(sm<4) uniform 0 float4 0 0 3 1 if(sm<4) uniform 0 float4 0 0 3 1
if(sm>=4) uniform 0 uint4 0 0 3 1 if(sm>=4) uniform 0 uint4 0 0 3 1
todo(msl) draw quad draw quad
probe (0, 0) rgba (7.0, 8.0, 9.0, 10.0) probe (0, 0) rgba (7.0, 8.0, 9.0, 10.0)
% return from a switch nested in a loop % return from a switch nested in a loop