Module: wine
Branch: refs/heads/master
Commit: 806aaa1287e0762ce29f8ef3e9102d182a6fad7d
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=806aaa1287e0762ce29f8ef…
Author: Jason Green <jave27(a)gmail.com>
Date: Fri Jun 9 03:34:44 2006 -0400
wined3d: Added more declarations to GLSL.
- Declare more variable names for GLSL programs.
- Some of these won't need to be declared eventually, but it doesn't hurt to do it for now.
- Correct output name for pixel shaders (gl_FragColor instead of glFragColor).
---
dlls/wined3d/baseshader.c | 23 +++++++++++++++++++----
dlls/wined3d/pixelshader.c | 2 +-
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c
index da81351..8d1f759 100644
--- a/dlls/wined3d/baseshader.c
+++ b/dlls/wined3d/baseshader.c
@@ -575,16 +575,21 @@ void generate_glsl_declarations(
/* Declare the constants (aka uniforms) */
shader_addline(buffer, "uniform vec4 C[%u];\n", This->baseShader.limits.constant_float);
+ /* Declare texture samplers
+ * TODO: Make this work for textures other than 2D */
+ for (i = 0; i < This->baseShader.limits.texture; i++) {
+ shader_addline(buffer, "uniform sampler2D mytex%lu;\n", i);
+ }
+
/* Declare address variables */
for (i = 0; i < This->baseShader.limits.address; i++) {
if (reg_maps->address & (1 << i))
shader_addline(buffer, "ivec4 A%ld;\n", i);
}
- /* Declare all named attributes (TODO: Add this to the reg_maps
- * and only declare those that are needed) */
- for (i = 0; i < This->baseShader.limits.attributes; i++) {
- shader_addline(buffer, "attribute vec4 attrib%i;\n", i);
+ /* Declare texture temporaries */
+ for (i = 0; i < This->baseShader.limits.texture; i++) {
+ shader_addline(buffer, "vec4 T%lu = gl_TexCoord[%lu];\n", i, i);
}
/* Declare temporary variables */
@@ -593,6 +598,16 @@ void generate_glsl_declarations(
shader_addline(buffer, "vec4 R%lu;\n", i);
}
+ /* Declare all named attributes (TODO: Add this to the reg_maps
+ * and only declare those that are needed) */
+ for (i = 0; i < This->baseShader.limits.attributes; i++) {
+ shader_addline(buffer, "attribute vec4 attrib%i;\n", i);
+ }
+
+ /* Temporary variables for matrix operations */
+ shader_addline(buffer, "vec4 tmp0;\n");
+ shader_addline(buffer, "vec4 tmp1;\n");
+
/* Start the main program */
shader_addline(buffer, "void main() {\n");
}
diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c
index 4c52a25..65a81c5 100644
--- a/dlls/wined3d/pixelshader.c
+++ b/dlls/wined3d/pixelshader.c
@@ -1290,7 +1290,7 @@ #endif
/* Pixel shaders < 2.0 place the resulting color in R0 implicitly */
if (This->baseShader.hex_version < D3DPS_VERSION(2,0))
- shader_addline(&buffer, "glFragColor = R0;\n");
+ shader_addline(&buffer, "gl_FragColor = R0;\n");
shader_addline(&buffer, "}\n\0");
TRACE("Compiling shader object %u\n", shader_obj);
Module: wine
Branch: refs/heads/master
Commit: ca70d13af4710c0cb924638c224c0643caeb94e5
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=ca70d13af4710c0cb924638…
Author: Jason Green <jave27(a)gmail.com>
Date: Fri Jun 9 03:33:33 2006 -0400
wined3d: Unified float constant register mapping between ARB pixel and vertex shaders.
- Got rid of the separate constant maps.
- Side effect of this is that the map is a bit larger for pixel shaders than it needs to be
---
dlls/wined3d/baseshader.c | 20 +++++++++++++++++
dlls/wined3d/pixelshader.c | 46 +++++++++++-----------------------------
dlls/wined3d/vertexshader.c | 42 ++++++++++++-------------------------
dlls/wined3d/wined3d_private.h | 21 +++---------------
4 files changed, 50 insertions(+), 79 deletions(-)
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=ca70d13af4710c0cb92…
Module: wine
Branch: refs/heads/master
Commit: 0c59ca6448d680c67b51df96534e91804c6ee4f1
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=0c59ca6448d680c67b51df9…
Author: Jason Green <jave27(a)gmail.com>
Date: Fri Jun 9 03:33:01 2006 -0400
wined3d: Add the bulk of the GLSL string generation functions.
- Add a new file glsl_shader.c which contains almost every GLSL specific function we'll need
- Move print_glsl_info() into glsl_shader.c
- Move the shader_reg_maps struct info into the private header, and make it part of SHADER_OPCODE_ARG.
- Create a new shared ps/vs register map for float constants (future patch will make ARB programs use this, too)
---
dlls/wined3d/Makefile.in | 1
dlls/wined3d/baseshader.c | 30 -
dlls/wined3d/glsl_shader.c | 803 ++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/wined3d_private.h | 24 +
4 files changed, 829 insertions(+), 29 deletions(-)
create mode 100644 dlls/wined3d/glsl_shader.c
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=0c59ca6448d680c67b5…
Module: wine
Branch: refs/heads/master
Commit: 1f1057fc9b073ba50c1f101145d73e172c4c6e09
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=1f1057fc9b073ba50c1f101…
Author: Jason Green <jave27(a)gmail.com>
Date: Thu Jun 8 04:00:23 2006 -0400
wined3d: Move constant loading out of DrawPrimDrawStrided() and enable
loading float constants for GLSL.
- DrawPrim is just too big of a function. This separates the passing
of constants to the shader into new functions.
- Fixes an off-by-one error when loading vertex declaration constants
(should be <, not <=)
- Adds a function for GLSL loading of constants (aka Uniforms)
- Adds a GLSL program variable to the stateblock and sets it to 0 (a
future patch will actually create this program)
---
dlls/wined3d/drawprim.c | 249 +++++++++++++++++++++++++++-------------
dlls/wined3d/stateblock.c | 4 +
dlls/wined3d/wined3d_private.h | 2
3 files changed, 176 insertions(+), 79 deletions(-)
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=1f1057fc9b073ba50c1…