wined3d: Handle structured thread group shared memory declarations.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Józef Kucia 2017-02-28 14:42:38 +01:00 committed by Alexandre Julliard
parent bd6ae2f459
commit 7590a94dab
4 changed files with 31 additions and 1 deletions

View File

@ -9462,7 +9462,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL,
/* 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_UAV_RAW */ shader_glsl_nop,
/* WINED3DSIH_DCL_UAV_STRUCTURED */ shader_glsl_nop,

View File

@ -1065,6 +1065,33 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
reg_maps->tgsm_count = reg_idx + 1;
tgsm = &reg_maps->tgsm[reg_idx];
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
{

View File

@ -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);
ins->declaration.tgsm_structured.byte_stride = *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,

View File

@ -1006,6 +1006,7 @@ struct wined3d_shader_structured_resource
struct wined3d_shader_tgsm
{
unsigned int size;
unsigned int stride;
};
struct wined3d_shader_tgsm_raw