wined3d: Handle structured UAV 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>
This commit is contained in:
parent
b1b880fc75
commit
a78afa1c71
@ -9352,7 +9352,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
|
|||||||
/* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL,
|
/* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL,
|
||||||
/* 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 */ NULL,
|
/* WINED3DSIH_DCL_UAV_STRUCTURED */ shader_glsl_nop,
|
||||||
/* WINED3DSIH_DCL_UAV_TYPED */ shader_glsl_nop,
|
/* WINED3DSIH_DCL_UAV_TYPED */ shader_glsl_nop,
|
||||||
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
|
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
|
||||||
/* WINED3DSIH_DEF */ shader_glsl_nop,
|
/* WINED3DSIH_DEF */ shader_glsl_nop,
|
||||||
|
@ -1058,6 +1058,21 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
|
|||||||
reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_DATA_UINT;
|
reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_DATA_UINT;
|
||||||
reg_maps->uav_resource_info[reg_idx].flags = WINED3D_VIEW_BUFFER_RAW;
|
reg_maps->uav_resource_info[reg_idx].flags = WINED3D_VIEW_BUFFER_RAW;
|
||||||
}
|
}
|
||||||
|
else if (ins.handler_idx == WINED3DSIH_DCL_UAV_STRUCTURED)
|
||||||
|
{
|
||||||
|
unsigned int reg_idx = ins.declaration.structured_resource.reg.reg.idx[0].offset;
|
||||||
|
if (reg_idx >= ARRAY_SIZE(reg_maps->uav_resource_info))
|
||||||
|
{
|
||||||
|
ERR("Invalid UAV resource index %u.\n", reg_idx);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (ins.flags)
|
||||||
|
FIXME("Ignoring structured UAV flags %#x.\n", ins.flags);
|
||||||
|
reg_maps->uav_resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_BUFFER;
|
||||||
|
reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_DATA_UINT;
|
||||||
|
reg_maps->uav_resource_info[reg_idx].flags = 0;
|
||||||
|
reg_maps->uav_resource_info[reg_idx].stride = ins.declaration.structured_resource.byte_stride / 4;
|
||||||
|
}
|
||||||
else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
|
else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
|
||||||
{
|
{
|
||||||
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
|
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
|
||||||
|
@ -753,6 +753,8 @@ static void shader_sm5_read_dcl_uav_structured(struct wined3d_shader_instruction
|
|||||||
shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_UAV, &ins->declaration.structured_resource.reg);
|
shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_UAV, &ins->declaration.structured_resource.reg);
|
||||||
ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT;
|
ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT;
|
||||||
ins->declaration.structured_resource.byte_stride = *tokens;
|
ins->declaration.structured_resource.byte_stride = *tokens;
|
||||||
|
if (ins->declaration.structured_resource.byte_stride % 4)
|
||||||
|
FIXME("Byte stride %u is not multiple of 4.\n", ins->declaration.structured_resource.byte_stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins,
|
static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins,
|
||||||
|
@ -827,6 +827,7 @@ struct wined3d_shader_resource_info
|
|||||||
enum wined3d_shader_resource_type type;
|
enum wined3d_shader_resource_type type;
|
||||||
enum wined3d_data_type data_type;
|
enum wined3d_data_type data_type;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
unsigned int stride;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define WINED3D_SAMPLER_DEFAULT ~0x0u
|
#define WINED3D_SAMPLER_DEFAULT ~0x0u
|
||||||
|
Loading…
x
Reference in New Issue
Block a user