vkd3d-shader/hlsl: Generate vsir instructions for stream output operations.

This commit is contained in:
Shaun Ren
2025-03-14 18:17:29 -04:00
committed by Henri Verbeet
parent c8c1e270e0
commit 5b06fe83df
Notes: Henri Verbeet 2025-05-05 15:28:21 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1473
6 changed files with 30 additions and 13 deletions

View File

@@ -10831,8 +10831,20 @@ static bool sm4_generate_vsir_instr_resource_store(struct hlsl_ctx *ctx,
if (store->store_type != HLSL_RESOURCE_STORE)
{
hlsl_fixme(ctx, &instr->loc, "Stream output operations.");
return false;
enum vkd3d_shader_opcode opcode = store->store_type == HLSL_RESOURCE_STREAM_APPEND
? VKD3DSIH_EMIT : VKD3DSIH_CUT;
VKD3D_ASSERT(!store->value.node && !store->coords.node);
VKD3D_ASSERT(store->resource.var->regs[HLSL_REGSET_STREAM_OUTPUTS].allocated);
if (store->resource.var->regs[HLSL_REGSET_STREAM_OUTPUTS].index)
{
hlsl_fixme(ctx, &instr->loc, "Stream output operation with a nonzero stream index.");
return false;
}
ins = generate_vsir_add_program_instruction(ctx, program, &store->node.loc, opcode, 0, 0);
return !!ins;
}
if (!store->resource.var->is_uniform)

View File

@@ -4165,6 +4165,7 @@ static void tpf_handle_instruction(struct tpf_compiler *tpf, const struct vkd3d_
case VKD3DSIH_BREAK:
case VKD3DSIH_CASE:
case VKD3DSIH_CONTINUE:
case VKD3DSIH_CUT:
case VKD3DSIH_DEFAULT:
case VKD3DSIH_DISCARD:
case VKD3DSIH_DIV:
@@ -4178,6 +4179,7 @@ static void tpf_handle_instruction(struct tpf_compiler *tpf, const struct vkd3d_
case VKD3DSIH_DSY_COARSE:
case VKD3DSIH_DSY_FINE:
case VKD3DSIH_ELSE:
case VKD3DSIH_EMIT:
case VKD3DSIH_ENDIF:
case VKD3DSIH_ENDLOOP:
case VKD3DSIH_ENDSWITCH: