mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Write SM4 dcl_thread_group instructions.
This commit is contained in:
committed by
Alexandre Julliard
parent
718c79b823
commit
3857ca06fa
Notes:
Alexandre Julliard
2022-11-08 23:05:16 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/43
@@ -833,7 +833,7 @@ struct sm4_instruction
|
||||
} srcs[4];
|
||||
unsigned int src_count;
|
||||
|
||||
uint32_t idx[2];
|
||||
uint32_t idx[3];
|
||||
unsigned int idx_count;
|
||||
};
|
||||
|
||||
@@ -1278,6 +1278,19 @@ static void write_sm4_dcl_temps(struct vkd3d_bytecode_buffer *buffer, uint32_t t
|
||||
write_sm4_instruction(buffer, &instr);
|
||||
}
|
||||
|
||||
static void write_sm4_dcl_thread_group(struct vkd3d_bytecode_buffer *buffer, const uint32_t thread_count[3])
|
||||
{
|
||||
struct sm4_instruction instr =
|
||||
{
|
||||
.opcode = VKD3D_SM5_OP_DCL_THREAD_GROUP,
|
||||
|
||||
.idx = {thread_count[0], thread_count[1], thread_count[2]},
|
||||
.idx_count = 3,
|
||||
};
|
||||
|
||||
write_sm4_instruction(buffer, &instr);
|
||||
}
|
||||
|
||||
static void write_sm4_ret(struct vkd3d_bytecode_buffer *buffer)
|
||||
{
|
||||
struct sm4_instruction instr =
|
||||
@@ -2370,6 +2383,9 @@ static void write_sm4_shdr(struct hlsl_ctx *ctx,
|
||||
write_sm4_dcl_semantic(ctx, &buffer, var);
|
||||
}
|
||||
|
||||
if (profile->type == VKD3D_SHADER_TYPE_COMPUTE)
|
||||
write_sm4_dcl_thread_group(&buffer, ctx->thread_count);
|
||||
|
||||
if (ctx->temp_count)
|
||||
write_sm4_dcl_temps(&buffer, ctx->temp_count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user