gallium: don't use edgeflags if the app didn't supply them
This commit is contained in:
@@ -112,9 +112,11 @@ find_translated_vp(struct st_context *st,
|
|||||||
* edgeflag semantics, and extend the vertex shader to pass through
|
* edgeflag semantics, and extend the vertex shader to pass through
|
||||||
* the input to the output. We'll need to use similar logic to set
|
* the input to the output. We'll need to use similar logic to set
|
||||||
* up the extra vertex_element input for edgeflags.
|
* up the extra vertex_element input for edgeflags.
|
||||||
|
* _NEW_POLYGON, ST_NEW_EDGEFLAGS_DATA
|
||||||
*/
|
*/
|
||||||
key.passthrough_edgeflags = (st->ctx->Polygon.FrontMode != GL_FILL ||
|
key.passthrough_edgeflags = (st->vertdata_edgeflags && (
|
||||||
st->ctx->Polygon.BackMode != GL_FILL);
|
st->ctx->Polygon.FrontMode != GL_FILL ||
|
||||||
|
st->ctx->Polygon.BackMode != GL_FILL));
|
||||||
|
|
||||||
|
|
||||||
/* Do we need to throw away old translations after a change in the
|
/* Do we need to throw away old translations after a change in the
|
||||||
@@ -228,7 +230,7 @@ const struct st_tracked_state st_update_vp = {
|
|||||||
"st_update_vp", /* name */
|
"st_update_vp", /* name */
|
||||||
{ /* dirty */
|
{ /* dirty */
|
||||||
_NEW_POLYGON, /* mesa */
|
_NEW_POLYGON, /* mesa */
|
||||||
ST_NEW_VERTEX_PROGRAM /* st */
|
ST_NEW_VERTEX_PROGRAM | ST_NEW_EDGEFLAGS_DATA /* st */
|
||||||
},
|
},
|
||||||
update_vp /* update */
|
update_vp /* update */
|
||||||
};
|
};
|
||||||
|
@@ -55,6 +55,7 @@ struct bitmap_cache;
|
|||||||
#define ST_NEW_FRAGMENT_PROGRAM 0x2
|
#define ST_NEW_FRAGMENT_PROGRAM 0x2
|
||||||
#define ST_NEW_VERTEX_PROGRAM 0x4
|
#define ST_NEW_VERTEX_PROGRAM 0x4
|
||||||
#define ST_NEW_FRAMEBUFFER 0x8
|
#define ST_NEW_FRAMEBUFFER 0x8
|
||||||
|
#define ST_NEW_EDGEFLAGS_DATA 0x10
|
||||||
|
|
||||||
|
|
||||||
struct st_state_flags {
|
struct st_state_flags {
|
||||||
@@ -120,6 +121,7 @@ struct st_context
|
|||||||
struct st_state_flags dirty;
|
struct st_state_flags dirty;
|
||||||
|
|
||||||
GLboolean missing_textures;
|
GLboolean missing_textures;
|
||||||
|
GLboolean vertdata_edgeflags;
|
||||||
|
|
||||||
/** Mapping from VERT_RESULT_x to post-transformed vertex slot */
|
/** Mapping from VERT_RESULT_x to post-transformed vertex slot */
|
||||||
const GLuint *vertex_result_to_slot;
|
const GLuint *vertex_result_to_slot;
|
||||||
|
@@ -514,6 +514,7 @@ st_draw_vbo(GLcontext *ctx,
|
|||||||
struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
|
struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
|
||||||
unsigned num_vbuffers, num_velements;
|
unsigned num_vbuffers, num_velements;
|
||||||
GLboolean userSpace;
|
GLboolean userSpace;
|
||||||
|
GLboolean vertDataEdgeFlags;
|
||||||
|
|
||||||
/* Gallium probably doesn't want this in some cases. */
|
/* Gallium probably doesn't want this in some cases. */
|
||||||
if (!index_bounds_valid)
|
if (!index_bounds_valid)
|
||||||
@@ -522,6 +523,13 @@ st_draw_vbo(GLcontext *ctx,
|
|||||||
/* sanity check for pointer arithmetic below */
|
/* sanity check for pointer arithmetic below */
|
||||||
assert(sizeof(arrays[0]->Ptr[0]) == 1);
|
assert(sizeof(arrays[0]->Ptr[0]) == 1);
|
||||||
|
|
||||||
|
vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
|
||||||
|
arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
|
||||||
|
if (vertDataEdgeFlags != ctx->st->vertdata_edgeflags) {
|
||||||
|
ctx->st->vertdata_edgeflags = vertDataEdgeFlags;
|
||||||
|
ctx->st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
|
||||||
|
}
|
||||||
|
|
||||||
st_validate_state(ctx->st);
|
st_validate_state(ctx->st);
|
||||||
|
|
||||||
/* must get these after state validation! */
|
/* must get these after state validation! */
|
||||||
|
Reference in New Issue
Block a user