mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
i915: Enable point sprite coordinate generation
Support still isn't completely correct, but it's better. piglit point-sprite now passes. However, glean's pointSprite test fails. In that test the texture on the sprite is somehow inverted as though GL_POINT_SPRITE_COORD_ORIGIN were set to GL_LOWER_LEFT. i915 hardware shouldn't be able to do that! I believe there are also problems when not all texture units have GL_COORD_REPLACE set. The hardware enable seems to be all or nothing. Fixes bug #25313.
This commit is contained in:
parent
0528f40e3b
commit
d8d49716cf
1 changed files with 29 additions and 0 deletions
|
|
@ -599,6 +599,24 @@ i915PointSize(GLcontext * ctx, GLfloat size)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
i915PointParameterfv(GLcontext * ctx, GLenum pname, const GLfloat *params)
|
||||
{
|
||||
struct i915_context *i915 = I915_CONTEXT(ctx);
|
||||
|
||||
switch (pname) {
|
||||
case GL_POINT_SPRITE_COORD_ORIGIN:
|
||||
/* This could be supported, but it would require modifying the fragment
|
||||
* program to invert the y component of the texture coordinate by
|
||||
* inserting a 'SUB tc.y, {1.0}.xxxx, tc' instruction.
|
||||
*/
|
||||
FALLBACK(&i915->intel, I915_FALLBACK_POINT_SPRITE_COORD_ORIGIN,
|
||||
(params[0] != GL_UPPER_LEFT));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* =============================================================
|
||||
* Color masks
|
||||
*/
|
||||
|
|
@ -939,6 +957,17 @@ i915Enable(GLcontext * ctx, GLenum cap, GLboolean state)
|
|||
case GL_POLYGON_SMOOTH:
|
||||
break;
|
||||
|
||||
case GL_POINT_SPRITE:
|
||||
/* This state change is handled in i915_reduced_primitive_state because
|
||||
* the hardware bit should only be set when rendering points.
|
||||
*/
|
||||
I915_STATECHANGE(i915, I915_UPLOAD_CTX);
|
||||
if (state)
|
||||
i915->state.Ctx[I915_CTXREG_LIS4] |= S4_SPRITE_POINT_ENABLE;
|
||||
else
|
||||
i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_SPRITE_POINT_ENABLE;
|
||||
break;
|
||||
|
||||
case GL_POINT_SMOOTH:
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue