From bffd5362138cd4963005d4fe008c321596a24587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 9 Jan 2014 13:43:22 +0100 Subject: [PATCH] wined3d: GL_NV_vertex_program2_option supports relative offsets > 63. The ARR codepath used if ctx->target_version >= NV2 does not account for the correction offset, but the indirect addressing reads do, which ultimately results in incorrect offsets. Since the limitation goes away as soon as we enable GL_NV_vertex_program_2_option ignoring the offset is the best thing to do. I don't set shader_data->rel_offset to zero in the pre-compilation analysis because enablding NV_vertex_program2 is in theory a decision that is taken later during code generation. --- dlls/wined3d/arb_program_shader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index a1bb3e61c66..ff4345f9ba1 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1119,7 +1119,7 @@ static void shader_arb_get_register_name(const struct wined3d_shader_instruction if (!pshader && reg->idx[0].rel_addr) { const struct arb_vshader_private *shader_data = shader->backend_data; - UINT rel_offset = shader_data->rel_offset; + UINT rel_offset = ctx->target_version == ARB ? shader_data->rel_offset : 0; BOOL aL = FALSE; char rel_reg[50]; if (reg_maps->shader_version.major < 2) @@ -1849,7 +1849,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins) const struct arb_vshader_private *shader_data = shader->backend_data; src0_param[0] = '\0'; - if (shader_data->rel_offset) + if (shader_data->rel_offset && ctx->target_version == ARB) { const char *offset = arb_get_helper_value(WINED3D_SHADER_TYPE_VERTEX, ARB_VS_REL_OFFSET); shader_arb_get_src_param(ins, &ins->src[0], 0, src0_param);