Commit 3ab2482e authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Add support for ld_raw on thread group shared memory.

parent fdca95ef
......@@ -5148,7 +5148,7 @@ static void shader_glsl_ld_buffer(const struct wined3d_shader_instruction *ins)
function = "texelFetch";
resource = "sampler";
}
else
else if (src->reg.type == WINED3DSPR_UAV)
{
if (resource_idx >= ARRAY_SIZE(reg_maps->uav_resource_info))
{
......@@ -5160,6 +5160,18 @@ static void shader_glsl_ld_buffer(const struct wined3d_shader_instruction *ins)
function = "imageLoad";
resource = "image";
}
else
{
if (resource_idx >= reg_maps->tgsm_count)
{
ERR("Invalid TGSM index %u.\n", resource_idx);
return;
}
stride = reg_maps->tgsm[resource_idx].stride;
bind_idx = resource_idx;
function = NULL;
resource = "g";
}
address = string_buffer_get(priv->string_buffers);
if (ins->handler_idx == WINED3DSIH_LD_STRUCTURED)
......@@ -5178,8 +5190,12 @@ static void shader_glsl_ld_buffer(const struct wined3d_shader_instruction *ins)
continue;
swizzle = shader_glsl_swizzle_get_component(src->swizzle, i);
shader_addline(buffer, "%s(%s_%s%u, %s + %u).x);\n",
function, prefix, resource, bind_idx, address->buffer, swizzle);
if (function)
shader_addline(buffer, "%s(%s_%s%u, %s + %u).x);\n",
function, prefix, resource, bind_idx, address->buffer, swizzle);
else
shader_addline(buffer, "%s_%s%u[%s + %u]);\n",
prefix, resource, bind_idx, address->buffer, swizzle);
}
string_buffer_release(priv->string_buffers, address);
......
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