diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index eefc248797a..28a3b3b55f7 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -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, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 37c43526f7b..14cb243536f 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -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) diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 877b27d7c33..26aacc7c2d6 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -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,