[1/2] wined3d: Use texture2D to sample in pshader_glsl_texdp3tex()

H. Verbeet hverbeet at gmail.com
Wed Jun 20 17:00:59 CDT 2007


Direct3D (pre d3d10 anyway) doesn't have real 1D textures. When MSDN
talks about doing a "1D texture lookup" it's really talking about
sampling from a texture with 1 as height, or at least one that doesn't
change in the y direction. What it comes down to is that we sample
from a 2D texture, but hardcode the y coordinate.

Changelog:
  - Use texture2D to sample in pshader_glsl_texdp3tex()
-------------- next part --------------
---

 dlls/wined3d/glsl_shader.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index afffa23..244316a 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1625,7 +1625,7 @@ void pshader_glsl_texdp3tex(SHADER_OPCODE_ARG* arg) {
 
     shader_glsl_append_dst(arg->buffer, arg);
     shader_glsl_get_write_mask(arg->dst, dst_mask);
-    shader_addline(arg->buffer, "texture1D(Psampler%u, dot(gl_TexCoord[%u].xyz, %s))%s);\n",
+    shader_addline(arg->buffer, "texture2D(Psampler%u, vec2(dot(gl_TexCoord[%u].xyz, %s), 0.5))%s);\n",
             sampler_idx, sampler_idx, src0_param.param_str, dst_mask);
 }
 


More information about the wine-patches mailing list