Mesa (arb_geometry_shader4): gs: handle gl_VerticesIn and gl_PrimitiveIDIn specially

Zack Rusin zack at kemper.freedesktop.org
Wed May 20 01:59:27 UTC 2009


Module: Mesa
Branch: arb_geometry_shader4
Commit: f9328aaf5abd1b8d4458426cd02d252a6d36fcbc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9328aaf5abd1b8d4458426cd02d252a6d36fcbc

Author: Zack Rusin <zackr at vmware.com>
Date:   Tue May 19 21:59:13 2009 -0400

gs: handle gl_VerticesIn and gl_PrimitiveIDIn specially

---

 src/mesa/shader/slang/slang_codegen.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b03d5dc..7c02dfc 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -359,7 +359,6 @@ _slang_input_index(const char *name, GLenum target, GLuint *swizzleOut)
       { NULL, 0, SWIZZLE_NOOP }
    };
    static const struct input_info geoInputs[] = {
-      { "gl_VerticesIn", GEOM_ATTRIB_VERTICES, SWIZZLE_NOOP },
       { "gl_FrontColorIn", GEOM_ATTRIB_COLOR0, SWIZZLE_NOOP },
       { "gl_BackColorIn", GEOM_ATTRIB_COLOR1, SWIZZLE_NOOP },
       { "gl_FrontSecondaryColorIn", GEOM_ATTRIB_SECONDARY_COLOR0, SWIZZLE_NOOP },
@@ -369,7 +368,6 @@ _slang_input_index(const char *name, GLenum target, GLuint *swizzleOut)
       { "gl_PositionIn", GEOM_ATTRIB_POSITION, SWIZZLE_NOOP },
       { "gl_ClipVertexIn", GEOM_ATTRIB_CLIP_VERTEX, SWIZZLE_NOOP },
       { "gl_PointSizeIn", GEOM_ATTRIB_POINT_SIZE, SWIZZLE_NOOP },
-      { "gl_PrimitiveIDIn", GEOM_ATTRIB_PRIMITIVE_ID, SWIZZLE_NOOP },
       { NULL, 0, SWIZZLE_NOOP }
    };
    static const struct input_info fragInputs[] = {
@@ -4570,9 +4568,12 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
                                           &swizzle);
          store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle);
       } else if (type == SLANG_UNIT_GEOMETRY_BUILTIN) {
-         GLint index = _slang_input_index(varName, MESA_GEOMETRY_PROGRAM,
-                                          &swizzle);
-         store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle);
+         const GLfloat value = 0;
+         GLint index;
+
+         index = _mesa_add_named_constant(prog->Parameters, varName,
+                                          &value, size);
+         store = _slang_new_ir_storage_swz(PROGRAM_CONSTANT, index, size, swizzle);
       }
       if (dbg) printf("INPUT ");
    }




More information about the mesa-commit mailing list