st/mesa: fix per-vertex edge flags and GLSL support (v2)
authorMarek Olšák <marek.olsak@amd.com>
Mon, 3 Mar 2014 00:04:22 +0000 (01:04 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 15 Mar 2014 16:47:35 +0000 (17:47 +0100)
This fixes piglit/gl-2.0-edgeflag.

v2: use StrideB to recognize per-vertex edge flags

Cc: mesa-stable@lists.freedesktop.org
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_program.c

index 32ce1eaaa07a81cb6b079e201c2f3999ff20f0d3..378254d486dd161532aba956174ec6f60b14ba27 100644 (file)
@@ -132,15 +132,14 @@ static void check_program_state( struct st_context *st )
 static void check_attrib_edgeflag(struct st_context *st)
 {
    const struct gl_client_array **arrays = st->ctx->Array._DrawArrays;
-   GLboolean vertDataEdgeFlags;
+   GLboolean vertdata_edgeflags;
 
    if (!arrays)
       return;
 
-   vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
-                       arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
-   if (vertDataEdgeFlags != st->vertdata_edgeflags) {
-      st->vertdata_edgeflags = vertDataEdgeFlags;
+   vertdata_edgeflags = arrays[VERT_ATTRIB_EDGEFLAG]->StrideB != 0;
+   if (vertdata_edgeflags != st->vertdata_edgeflags) {
+      st->vertdata_edgeflags = vertdata_edgeflags;
       st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
    }
 }
index e9074ac97e454fde3ffe83a93ad0a7bf6ddb4ee2..692a57008f36b20549c9f85f163817f20c5f5198 100644 (file)
@@ -342,14 +342,14 @@ st_translate_vertex_program(struct st_context *st,
                                    stvp->glsl_to_tgsi,
                                    &stvp->Base.Base,
                                    /* inputs */
-                                   stvp->num_inputs,
+                                   vpv->num_inputs,
                                    stvp->input_to_index,
                                    NULL, /* input semantic name */
                                    NULL, /* input semantic index */
                                    NULL, /* interp mode */
                                    NULL, /* is centroid */
                                    /* outputs */
-                                   stvp->num_outputs,
+                                   num_outputs,
                                    stvp->result_to_output,
                                    stvp->output_semantic_name,
                                    stvp->output_semantic_index,