This is a slighly updated version of the patch. The code is the same but I 
changed the comment a little as suggested by Henri as the part about SM3 was 
wrong.

Roderick

> Hi,
> 
> This is a second draw buffers / gl_FragColor patch and it depends on the
> other patch which was sent earlier today. The previous patch added draw
> buffers support and fixed a gl_FragData bug. This patch fixes another case
> where we incorrectly use gl_FragData.
> 
> Regards,
> Roderick Colenbrander


-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
--- dlls/wined3d/glsl_shader.c	2006-08-09 20:56:43.000000000 +0200
+++ dlls/wined3d/glsl_shader.c	2006-08-09 22:49:46.000000000 +0200
@@ -562,6 +562,7 @@
     /* oPos, oFog and oPts in D3D */
     const char* hwrastout_reg_names[] = { "gl_Position", "gl_FogFragCoord", "gl_PointSize" };
 
+    WineD3D_GL_Info *gl_info = &((IWineD3DImpl*)((IWineD3DPixelShaderImpl*)arg->shader)->wineD3DDevice->wineD3D)->gl_info;
     DWORD reg = param & D3DSP_REGNUM_MASK;
     DWORD regtype = shader_get_regtype(param);
     IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) arg->shader;
@@ -641,10 +642,17 @@
             sprintf(tmpStr, "Vsampler%lu", reg);
     break;
     case D3DSPR_COLOROUT:
-        sprintf(tmpStr, "gl_FragData[%lu]", reg);
-        if (reg > 0) {
-            /* TODO: See GL_ARB_draw_buffers */
-            FIXME("Unsupported write to render target %lu\n", reg);
+        if (GL_SUPPORT(ARB_DRAW_BUFFERS)) {
+            sprintf(tmpStr, "gl_FragData[%lu]", reg);
+            if (reg > 0) {
+                /* TODO: See GL_ARB_draw_buffers */
+                FIXME("Unsupported write to render target %lu\n", reg);
+            }
+        } else { /* On older cards with GLSL support like the GeforceFX there's only one buffer. */
+            if (reg > 0)
+                WARN("This OpenGL implementation doesn't support writing to multiple render targets!\n");
+            else
+                sprintf(tmpStr, "gl_FragColor");
         }
     break;
     case D3DSPR_RASTOUT:


Reply via email to