Commit 03d7f527 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move min_rel_offset / max_rel_offset to the shader_reg_maps structure.

parent a4477fea
......@@ -399,17 +399,8 @@ static void shader_record_register_usage(IWineD3DBaseShaderImpl *shader, struct
case WINED3DSPR_CONST:
if (reg->rel_addr)
{
if (shader_type != WINED3D_SHADER_TYPE_PIXEL)
{
if (reg->idx < ((IWineD3DVertexShaderImpl *)shader)->min_rel_offset)
{
((IWineD3DVertexShaderImpl *)shader)->min_rel_offset = reg->idx;
}
if (reg->idx > ((IWineD3DVertexShaderImpl *)shader)->max_rel_offset)
{
((IWineD3DVertexShaderImpl *)shader)->max_rel_offset = reg->idx;
}
}
if (reg->idx < reg_maps->min_rel_offset) reg_maps->min_rel_offset = reg->idx;
if (reg->idx > reg_maps->max_rel_offset) reg_maps->max_rel_offset = reg->idx;
reg_maps->usesrelconstF = TRUE;
}
else
......@@ -1904,21 +1895,21 @@ HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *
if (device->vs_selected_mode == SHADER_ARB
&& (gl_info->quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT)
&& shader->min_rel_offset <= shader->max_rel_offset)
&& reg_maps->min_rel_offset <= reg_maps->max_rel_offset)
{
if (shader->max_rel_offset - shader->min_rel_offset > 127)
if (reg_maps->max_rel_offset - reg_maps->min_rel_offset > 127)
{
FIXME("The difference between the minimum and maximum relative offset is > 127.\n");
FIXME("Which this OpenGL implementation does not support. Try using GLSL.\n");
FIXME("Min: %d, Max: %d.\n", shader->min_rel_offset, shader->max_rel_offset);
FIXME("Min: %u, Max: %u.\n", reg_maps->min_rel_offset, reg_maps->max_rel_offset);
}
else if (shader->max_rel_offset - shader->min_rel_offset > 63)
else if (reg_maps->max_rel_offset - reg_maps->min_rel_offset > 63)
{
shader->rel_offset = shader->min_rel_offset + 63;
shader->rel_offset = reg_maps->min_rel_offset + 63;
}
else if (shader->max_rel_offset > 63)
else if (reg_maps->max_rel_offset > 63)
{
shader->rel_offset = shader->min_rel_offset;
shader->rel_offset = reg_maps->min_rel_offset;
}
else
{
......
......@@ -568,7 +568,7 @@ typedef struct shader_reg_maps
/* Whether or not loops are used in this shader, and nesting depth */
unsigned loop_depth;
unsigned highest_render_target;
UINT min_rel_offset, max_rel_offset;
} shader_reg_maps;
/* Keeps track of details for TEX_M#x# instructions which need to maintain
......@@ -2868,8 +2868,6 @@ typedef struct IWineD3DVertexShaderImpl {
/* Vertex shader attributes. */
struct wined3d_shader_attribute attributes[MAX_ATTRIBS];
UINT min_rel_offset, max_rel_offset;
UINT rel_offset;
} IWineD3DVertexShaderImpl;
......
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