summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-03-23 14:47:25 +0200
committerIan Romanick <ian.d.romanick@intel.com>2015-10-06 11:16:19 -0700
commit303895655c6ed837e3d867a450f4322404e86a88 (patch)
treed3aa19283962d5a252d9e1a2f59955e3b6ee6dfd /src/mesa/drivers/dri/i915
parent08864265039437260beffcdc3471e5788d142e86 (diff)
downloadexternal_mesa3d-303895655c6ed837e3d867a450f4322404e86a88.zip
external_mesa3d-303895655c6ed837e3d867a450f4322404e86a88.tar.gz
external_mesa3d-303895655c6ed837e3d867a450f4322404e86a88.tar.bz2
i915: Handle provoking vertex in intelFastRenderClippedPoly()
intelFastRenderClippedPoly() renders the polygon using triangles. For polygons the provoking vertex is always the first one, and currently this function assumes that the provoking vertex for triangles is the last one. In case the user changed the provoking vertex convention, the hardware may be configured to treat the first vertex of triangles as the provoking vertex. So check the convention and emit the triangles in the appropriate order to avoid having to change the hardware provoking vertex convention for rendering polygons. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index 1554613..6133c23 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -928,10 +928,18 @@ intelFastRenderClippedPoly(struct gl_context * ctx, const GLuint * elts, GLuint
const GLuint *start = (const GLuint *) V(elts[0]);
int i, j;
- for (i = 2; i < n; i++) {
- COPY_DWORDS(j, vb, vertsize, V(elts[i - 1]));
- COPY_DWORDS(j, vb, vertsize, V(elts[i]));
- COPY_DWORDS(j, vb, vertsize, start);
+ if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION) {
+ for (i = 2; i < n; i++) {
+ COPY_DWORDS(j, vb, vertsize, V(elts[i - 1]));
+ COPY_DWORDS(j, vb, vertsize, V(elts[i]));
+ COPY_DWORDS(j, vb, vertsize, start);
+ }
+ } else {
+ for (i = 2; i < n; i++) {
+ COPY_DWORDS(j, vb, vertsize, start);
+ COPY_DWORDS(j, vb, vertsize, V(elts[i - 1]));
+ COPY_DWORDS(j, vb, vertsize, V(elts[i]));
+ }
}
}