vkd3d-shader/hlsl: Emit dcl_tgsm_raw instructions for raw groupshared variables.

This commit is contained in:
Shaun Ren
2025-06-27 11:11:01 -04:00
committed by Henri Verbeet
parent 3802344e97
commit fa560b589e
Notes: Henri Verbeet 2025-08-05 16:40:26 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1605
2 changed files with 50 additions and 1 deletions

View File

@@ -3910,6 +3910,23 @@ static void tpf_dcl_texture(const struct tpf_compiler *tpf, const struct vkd3d_s
write_sm4_instruction(tpf, &instr);
}
static void tpf_dcl_tgsm_raw(const struct tpf_compiler *tpf, const struct vkd3d_shader_instruction *ins)
{
const struct vkd3d_shader_tgsm_raw *tgsm = &ins->declaration.tgsm_raw;
struct sm4_instruction instr =
{
.opcode = VKD3D_SM5_OP_DCL_TGSM_RAW,
.dsts[0] = tgsm->reg,
.dst_count = 1,
.idx[0] = tgsm->byte_count,
.idx_count = 1,
};
write_sm4_instruction(tpf, &instr);
}
static void write_sm4_dcl_global_flags(const struct tpf_compiler *tpf, uint32_t flags)
{
struct sm4_instruction instr =
@@ -4199,6 +4216,10 @@ static void tpf_handle_instruction(struct tpf_compiler *tpf, const struct vkd3d_
tpf_dcl_sampler(tpf, ins);
break;
case VSIR_OP_DCL_TGSM_RAW:
tpf_dcl_tgsm_raw(tpf, ins);
break;
case VSIR_OP_DCL:
case VSIR_OP_DCL_RESOURCE_RAW:
case VSIR_OP_DCL_UAV_RAW: