=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: GL_NV_vertex_program2_option supports relative offsets > 63.

Alexandre Julliard julliard at winehq.org
Thu Jan 9 12:52:50 CST 2014


Module: wine
Branch: master
Commit: bffd5362138cd4963005d4fe008c321596a24587
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bffd5362138cd4963005d4fe008c321596a24587

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu Jan  9 13:43:22 2014 +0100

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 a1bb3e6..ff4345f 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);




More information about the wine-cvs mailing list