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

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:
Józef Kucia 2016-07-05 11:46:54 +02:00 committed by Alexandre Julliard
parent 57732599e5
commit eb5c8d71fb
3 changed files with 17 additions and 4 deletions

View File

@ -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 */

View File

@ -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)

View File

@ -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;