Fix the handling of zero-sized output parameters (i.e., those with type
authorIan Romanick <idr@us.ibm.com>
Thu, 17 Mar 2005 01:48:11 +0000 (01:48 +0000)
committerIan Romanick <idr@us.ibm.com>
Thu, 17 Mar 2005 01:48:11 +0000 (01:48 +0000)
'GLvoid *').  This fixes the GLX protocol for glGetProgramStringARB.  This
fixes bugzilla #2747.

Remove the 'ignore="true"' from glVertexAttrib4bvARB.  This fixes bugzilla
#2746.

src/glx/x11/indirect.c
src/glx/x11/indirect.h
src/glx/x11/indirect_init.c
src/mesa/glapi/glX_proto_send.py
src/mesa/glapi/gl_API.xml

index 4d564c12d54d47cbf3d329ba45e6fa693de5bc93..aafc7ab58969968c53697094dd7d2c0e25cdd495 100644 (file)
@@ -6756,6 +6756,19 @@ __indirect_glActiveStencilFaceEXT(GLenum face)
     if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
 }
 
+#define X_GLrop_VertexAttrib4bvARB 4230
+void
+__indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte * v)
+{
+    __GLXcontext * const gc = __glXGetCurrentContext();
+    const GLuint cmdlen = 12;
+    emit_header(gc->pc, X_GLrop_VertexAttrib4bvARB, cmdlen);
+    (void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
+    (void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
+    gc->pc += cmdlen;
+    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
+}
+
 #define X_GLrop_VertexAttrib4ivARB 4231
 void
 __indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v)
@@ -7058,7 +7071,7 @@ __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
         GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringARB, cmdlen);
         (void) memcpy((void *)(pc + 0), (void *)(&target), 4);
         (void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
-        (void) __glXReadReply(dpy, 0, string, GL_TRUE);
+        (void) __glXReadReply(dpy, 1, string, GL_TRUE);
         UnlockDisplay(dpy); SyncHandle();
     }
     return;
index b704ba846cee0d88b07cade4b280231df04b5d7e..b2efad5a2705360007cbe77f465cdff2fcc40155 100644 (file)
@@ -611,6 +611,7 @@ extern HIDDEN void __indirect_glPointParameterivNV(GLenum pname, const GLint * p
 extern HIDDEN void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount);
 extern HIDDEN void __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount);
 extern HIDDEN void __indirect_glActiveStencilFaceEXT(GLenum face);
+extern HIDDEN void __indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte * v);
 extern HIDDEN void __indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v);
 extern HIDDEN void __indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte * v);
 extern HIDDEN void __indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v);
index 70e9dab15f1c4dc1fc2ae6defddad6b6af5a1c0f..64aefcbaf153367c0f5b0738168d447a502f70e0 100644 (file)
@@ -688,6 +688,7 @@ __GLapi * __glXNewIndirectAPI( void )
 
     /* GL_ARB_vertex_program */
 
+    glAPI->VertexAttrib4bvARB = __indirect_glVertexAttrib4bvARB;
     glAPI->VertexAttrib4ivARB = __indirect_glVertexAttrib4ivARB;
     glAPI->VertexAttrib4ubvARB = __indirect_glVertexAttrib4ubvARB;
     glAPI->VertexAttrib4usvARB = __indirect_glVertexAttrib4usvARB;
index a89a5f67eab376fc20570f65d60aa14e2b0f65d1..7c31b873e2e14c4f7f2c29e11c1e99ceff33ca47 100644 (file)
@@ -449,7 +449,11 @@ generic_%u_byte( GLint rop, const void * ptr )
                                        print "        __glXReadPixelReply(dpy, gc, %u, %s, %s, %s, %s, %s, %s, GL_FALSE);" % (dim, w, h, d, f.image.img_format, f.image.img_type, f.image.name)
                        else:
                                if f.output != None:
-                                       output_size = f.output.p_type.size
+                                       if f.output.p_type.size == 0:
+                                               output_size = 1
+                                       else:
+                                               output_size = f.output.p_type.size
+
                                        output_str = f.output.name
                                else:
                                        output_size = 0
index e13815cc10ecd5b3be0421d44600299a2b34ef7f..4d865af3102488660518a9c3437cace86a52665d 100644 (file)
@@ -5664,7 +5664,7 @@ glx:
     <function name="VertexAttrib4bvARB" offset="654">
         <param name="index" type="GLuint"/>
         <param name="v" type="const GLbyte *" count="4"/>
-        <glx rop="4230" ignore="true"/>
+        <glx rop="4230"/>
     </function>
 
     <function name="VertexAttrib4ivARB" offset="655">