mesa: Copy linked program data for GS.
authorPaul Berry <stereotype441@gmail.com>
Sat, 23 Mar 2013 17:51:53 +0000 (10:51 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 2 Aug 2013 03:22:07 +0000 (20:22 -0700)
The documentation for gl_shader_program.Geom and gl_geometry_program
says that the former is copied to the latter at link time, but this
wasn't happening.  This patch causes _mesa_ir_link_shader() to perform
the copy, and updates comment accordingly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/mtypes.h
src/mesa/main/shaderapi.c

index c166645aa0fc5ddcf98dd9a93048fe7dbd2d3f19..83de3dda893333c9b9d6a4005b819658325d116b 100644 (file)
@@ -2320,7 +2320,10 @@ struct gl_shader_program
    /** Post-link gl_FragDepth layout for ARB_conservative_depth. */
    enum gl_frag_depth_layout FragDepthLayout;
 
-   /** Geometry shader state - copied into gl_geometry_program at link time */
+   /**
+    * Geometry shader state - copied into gl_geometry_program by
+    * _mesa_copy_linked_program_data().
+    */
    struct {
       GLint VerticesIn;
       GLint VerticesOut;
index 8a0909be13f51fe1211bead26052f6e07f699492..858cec57f7c67188badc4d8a80b6d6f2dcd961f4 100644 (file)
@@ -1859,6 +1859,14 @@ _mesa_copy_linked_program_data(gl_shader_type type,
       dst_vp->UsesClipDistance = src->Vert.UsesClipDistance;
    }
       break;
+   case MESA_SHADER_GEOMETRY: {
+      struct gl_geometry_program *dst_gp = (struct gl_geometry_program *) dst;
+      dst_gp->VerticesIn = src->Geom.VerticesIn;
+      dst_gp->VerticesOut = src->Geom.VerticesOut;
+      dst_gp->InputType = src->Geom.InputType;
+      dst_gp->OutputType = src->Geom.OutputType;
+   }
+      break;
    default:
       break;
    }