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

wined3d: Do not limit temporary register count to 32 in SM4+.

parent 57732599
......@@ -2168,9 +2168,18 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
shader_addline(buffer, "vec4 %s_out[%u];\n", prefix, shader->limits->packed_output);
/* Declare temporary variables */
for (i = 0, map = reg_maps->temporary; map; map >>= 1, ++i)
if (reg_maps->temporary_count)
{
if (map & 1) shader_addline(buffer, "vec4 R%u;\n", i);
for (i = 0; i < reg_maps->temporary_count; ++i)
shader_addline(buffer, "vec4 R%u;\n", i);
}
else
{
for (i = 0, map = reg_maps->temporary; map; map >>= 1, ++i)
{
if (map & 1)
shader_addline(buffer, "vec4 R%u;\n", i);
}
}
/* Declare indexable temporary variables */
......
......@@ -982,6 +982,10 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
if (ins.flags & WINED3DSI_SAMPLER_COMPARISON_MODE)
reg_maps->sampler_comparison_mode |= (1u << ins.declaration.dst.reg.idx[0].offset);
}
else if (ins.handler_idx == WINED3DSIH_DCL_TEMPS)
{
reg_maps->temporary_count = ins.declaration.count;
}
else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
{
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
......
......@@ -530,7 +530,6 @@ enum wined3d_shader_conditional_op
/* TODO: Make this dynamic, based on shader limits ? */
#define MAX_ATTRIBS 16
#define MAX_REG_ADDR 1
#define MAX_REG_TEMP 32
#define MAX_REG_TEXCRD 8
#define MAX_REG_INPUT 32
#define MAX_REG_OUTPUT 32
......@@ -810,7 +809,8 @@ struct wined3d_shader_reg_maps
BYTE texcoord; /* MAX_REG_TEXCRD, 8 */
BYTE address; /* MAX_REG_ADDR, 1 */
WORD labels; /* MAX_LABELS, 16 */
DWORD temporary; /* MAX_REG_TEMP, 32 */
DWORD temporary; /* 32 */
unsigned int temporary_count;
DWORD *constf; /* pixel, vertex */
struct list indexable_temps;
const struct wined3d_shader_immediate_constant_buffer *icb;
......
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