[WINED3D 2/3] Resend: Add function to print the infolog of a GLSL shader on errors.

Jason Green jave27 at gmail.com
Tue May 23 17:22:13 CDT 2006


- With assistance from H. Verbeet (stringfellow)

---

 dlls/wined3d/baseshader.c      |   22 ++++++++++++++++++++++
 dlls/wined3d/wined3d_private.h |    4 ++++
 2 files changed, 26 insertions(+), 0 deletions(-)
-------------- next part --------------
>From nobody Mon Sep 17 00:00:00 2001
From: Jason Green <jave27 at gmail.com>
Date: Tue, 23 May 2006 18:15:44 -0400
To: wine-patches <wine-patches at winehq.org>
Subject: [PATCH 2/3] Add function to print the infolog of a GLSL shader on errors.

- With assistance from H. Verbeet (stringfellow)

---

 dlls/wined3d/baseshader.c      |   22 ++++++++++++++++++++++
 dlls/wined3d/wined3d_private.h |    4 ++++
 2 files changed, 26 insertions(+), 0 deletions(-)

fbcb80d02cf1c0e58c5df9aa7bf9af7a3e1a946d
diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c
index 4cc89ea..392cc7a 100644
--- a/dlls/wined3d/baseshader.c
+++ b/dlls/wined3d/baseshader.c
@@ -29,6 +29,8 @@ #include "wined3d_private.h"
 WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
 
 #define GLNAME_REQUIRE_GLSL  ((const char *)1)
+#undef GL_EXTCALL
+#define GL_EXTCALL(FuncName) (gl_info->FuncName)
 
 typedef struct shader_reg_maps {
     DWORD texcoord;
@@ -675,6 +677,26 @@ void generate_base_shader(
     }
 }
 
+/** Prints the GLSL info log which will contain error messages if they exist */
+void print_glsl_info_log(
+    WineD3D_GL_Info *gl_info,
+    GLhandleARB obj)
+{
+    int infologLength = 0;
+    char *infoLog;
+
+    GL_EXTCALL(glGetObjectParameterivARB(obj,
+               GL_OBJECT_INFO_LOG_LENGTH_ARB,
+               &infologLength));
+
+    if (infologLength > 0)
+    {
+        infoLog = (char *)HeapAlloc(GetProcessHeap(), 0, infologLength);
+        GL_EXTCALL(glGetInfoLogARB(obj, infologLength, NULL, infoLog));
+        FIXME("Error received from GLSL shader #%i: %s", obj, debugstr_a(infoLog));
+        HeapFree(GetProcessHeap(), 0, infoLog);
+    }
+}
 
 void shader_dump_ins_modifiers(const DWORD output) {
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d73fb4f..61892b2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1388,6 +1388,10 @@ extern int shader_skip_unrecognized(
     IWineD3DBaseShader* iface,
     const DWORD* pToken);
 
+extern void print_glsl_info_log(
+    WineD3D_GL_Info *gl_info,
+    GLhandleARB obj);
+
 inline static int shader_get_regtype(const DWORD param) {
     return (((param & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT) |
             ((param & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2));
-- 
1.3.3



More information about the wine-patches mailing list