mesa: add new internal state var for window size

Actually, window width - 1, height - 1
This commit is contained in:
Brian Paul 2009-03-20 20:15:58 -06:00
parent 12256fc2b2
commit 1f45ae0813
2 changed files with 14 additions and 0 deletions

View File

@ -506,6 +506,13 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
}
}
return;
case STATE_FB_SIZE:
value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
value[2] = 0.0F;
value[3] = 0.0F;
return;
case STATE_ROT_MATRIX_0:
{
const int unit = (int) state[2];
@ -628,6 +635,9 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
case STATE_PCM_BIAS:
return _NEW_PIXEL;
case STATE_FB_SIZE:
return _NEW_BUFFERS;
default:
/* unknown state indexes are silently ignored and
* no flag set, since it is handled by the driver.
@ -828,6 +838,9 @@ append_token(char *dst, gl_state_index k)
case STATE_SHADOW_AMBIENT:
append(dst, "CompareFailValue");
break;
case STATE_FB_SIZE:
append(dst, "FbSize");
break;
case STATE_ROT_MATRIX_0:
append(dst, "rotMatrixRow0");
break;

View File

@ -117,6 +117,7 @@ typedef enum gl_state_index_ {
STATE_PCM_SCALE, /**< Post color matrix RGBA scale */
STATE_PCM_BIAS, /**< Post color matrix RGBA bias */
STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */
STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */
STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */
STATE_ROT_MATRIX_1, /**< ATI_envmap_bumpmap, rot matrix row 1 */
STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */