Commit 7590a94d authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Handle structured thread group shared memory declarations.

parent bd6ae2f4
...@@ -9462,7 +9462,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB ...@@ -9462,7 +9462,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL, /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL, /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL,
/* WINED3DSIH_DCL_TGSM_RAW */ shader_glsl_nop, /* WINED3DSIH_DCL_TGSM_RAW */ shader_glsl_nop,
/* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL, /* WINED3DSIH_DCL_TGSM_STRUCTURED */ shader_glsl_nop,
/* WINED3DSIH_DCL_THREAD_GROUP */ shader_glsl_nop, /* WINED3DSIH_DCL_THREAD_GROUP */ shader_glsl_nop,
/* WINED3DSIH_DCL_UAV_RAW */ shader_glsl_nop, /* WINED3DSIH_DCL_UAV_RAW */ shader_glsl_nop,
/* WINED3DSIH_DCL_UAV_STRUCTURED */ shader_glsl_nop, /* WINED3DSIH_DCL_UAV_STRUCTURED */ shader_glsl_nop,
......
...@@ -1065,6 +1065,33 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st ...@@ -1065,6 +1065,33 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
reg_maps->tgsm_count = reg_idx + 1; reg_maps->tgsm_count = reg_idx + 1;
tgsm = &reg_maps->tgsm[reg_idx]; tgsm = &reg_maps->tgsm[reg_idx];
tgsm->size = ins.declaration.tgsm_raw.byte_count / 4; tgsm->size = ins.declaration.tgsm_raw.byte_count / 4;
tgsm->stride = 0;
}
else
{
FIXME("Invalid instruction %#x for shader type %#x.\n",
ins.handler_idx, shader_version.type);
}
}
else if (ins.handler_idx == WINED3DSIH_DCL_TGSM_STRUCTURED)
{
unsigned int reg_idx = ins.declaration.tgsm_structured.reg.reg.idx[0].offset;
if (reg_idx >= MAX_TGSM_REGISTERS)
{
ERR("Invalid TGSM register index %u.\n", reg_idx);
break;
}
if (shader_version.type == WINED3D_SHADER_TYPE_COMPUTE)
{
struct wined3d_shader_tgsm *tgsm;
if (!wined3d_array_reserve((void **)&reg_maps->tgsm, &reg_maps->tgsm_capacity,
reg_idx + 1, sizeof(*reg_maps->tgsm)))
return E_OUTOFMEMORY;
reg_maps->tgsm_count = reg_idx + 1;
tgsm = &reg_maps->tgsm[reg_idx];
tgsm->stride = ins.declaration.tgsm_structured.byte_stride / 4;
tgsm->size = tgsm->stride * ins.declaration.tgsm_structured.structure_count;
} }
else else
{ {
......
...@@ -774,6 +774,8 @@ static void shader_sm5_read_dcl_tgsm_structured(struct wined3d_shader_instructio ...@@ -774,6 +774,8 @@ static void shader_sm5_read_dcl_tgsm_structured(struct wined3d_shader_instructio
shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.tgsm_structured.reg); shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.tgsm_structured.reg);
ins->declaration.tgsm_structured.byte_stride = *tokens++; ins->declaration.tgsm_structured.byte_stride = *tokens++;
ins->declaration.tgsm_structured.structure_count = *tokens; ins->declaration.tgsm_structured.structure_count = *tokens;
if (ins->declaration.tgsm_structured.byte_stride % 4)
FIXME("Byte stride %u is not multiple of 4.\n", ins->declaration.tgsm_structured.byte_stride);
} }
static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instruction *ins, static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instruction *ins,
......
...@@ -1006,6 +1006,7 @@ struct wined3d_shader_structured_resource ...@@ -1006,6 +1006,7 @@ struct wined3d_shader_structured_resource
struct wined3d_shader_tgsm struct wined3d_shader_tgsm
{ {
unsigned int size; unsigned int size;
unsigned int stride;
}; };
struct wined3d_shader_tgsm_raw struct wined3d_shader_tgsm_raw
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment