Commit 7cdd18f3 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Handle structured resource declarations.

parent 5392835f
......@@ -9364,7 +9364,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_OUTPUT_SIV */ shader_glsl_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop,
/* WINED3DSIH_DCL_RESOURCE_RAW */ shader_glsl_nop,
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ shader_glsl_nop,
/* WINED3DSIH_DCL_SAMPLER */ shader_glsl_nop,
/* WINED3DSIH_DCL_STREAM */ NULL,
/* WINED3DSIH_DCL_TEMPS */ shader_glsl_nop,
......
......@@ -1025,6 +1025,19 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
reg_maps->resource_info[reg_idx].data_type = WINED3D_DATA_UINT;
reg_maps->resource_info[reg_idx].flags = WINED3D_VIEW_BUFFER_RAW;
}
else if (ins.handler_idx == WINED3DSIH_DCL_RESOURCE_STRUCTURED)
{
unsigned int reg_idx = ins.declaration.structured_resource.reg.reg.idx[0].offset;
if (reg_idx >= ARRAY_SIZE(reg_maps->resource_info))
{
ERR("Invalid resource index %u.\n", reg_idx);
break;
}
reg_maps->resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_BUFFER;
reg_maps->resource_info[reg_idx].data_type = WINED3D_DATA_UINT;
reg_maps->resource_info[reg_idx].flags = 0;
reg_maps->resource_info[reg_idx].stride = ins.declaration.structured_resource.byte_stride / 4;
}
else if (ins.handler_idx == WINED3DSIH_DCL_SAMPLER)
{
if (ins.flags & WINED3DSI_SAMPLER_COMPARISON_MODE)
......
......@@ -780,6 +780,8 @@ static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instru
{
shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_RESOURCE, &ins->declaration.structured_resource.reg);
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_resource_raw(struct wined3d_shader_instruction *ins,
......
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