if (texUnit->Enabled == newenabled)
return GL_FALSE;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->Enabled = newenabled;
return GL_TRUE;
}
newenabled |= coordBit;
if (texUnit->TexGenEnabled == newenabled)
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->TexGenEnabled = newenabled;
}
}
newenabled |= STR_BITS;
if (texUnit->TexGenEnabled == newenabled)
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->TexGenEnabled = newenabled;
}
}
goto invalid_enum_error;
CHECK_EXTENSION(ARB_seamless_cube_map, cap);
if (ctx->Texture.CubeMapSeamless != state) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
ctx->Texture.CubeMapSeamless = state;
}
break;
fp_inputs |= VARYING_BIT_COL1;
}
- /* _NEW_TEXTURE */
+ /* _NEW_TEXTURE_STATE */
fp_inputs |= (ctx->Texture._TexGenEnabled |
ctx->Texture._TexMatEnabled) << VARYING_SLOT_TEX0;
memset(key, 0, sizeof(*key));
- /* _NEW_TEXTURE */
+ /* _NEW_TEXTURE_OBJECT */
mask = ctx->Texture._EnabledCoordUnits;
while (mask) {
const int i = u_bit_scan(&mask);
/* in case the mipmap level is part of an FBO: */
_mesa_update_fbo_texture(ctx, texObj, face, level);
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
}
}
#define _NEW_POLYGONSTIPPLE (1u << 13) /**< gl_context::PolygonStipple */
#define _NEW_SCISSOR (1u << 14) /**< gl_context::Scissor */
#define _NEW_STENCIL (1u << 15) /**< gl_context::Stencil */
-#define _NEW_TEXTURE (1u << 16) /**< gl_context::Texture */
+#define _NEW_TEXTURE_OBJECT (1u << 16) /**< gl_context::Texture (bindings only) */
#define _NEW_TRANSFORM (1u << 17) /**< gl_context::Transform */
#define _NEW_VIEWPORT (1u << 18) /**< gl_context::Viewport */
-/* gap, re-use for core Mesa state only; use ctx->DriverFlags otherwise */
+#define _NEW_TEXTURE_STATE (1u << 19) /**< gl_context::Texture (states only) */
#define _NEW_ARRAY (1u << 20) /**< gl_context::Array */
#define _NEW_RENDERMODE (1u << 21) /**< gl_context::RenderMode, etc */
#define _NEW_BUFFERS (1u << 22) /**< gl_context::Visual, DrawBuffer, */
* Composite state flags
*/
/*@{*/
+#define _NEW_TEXTURE (_NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE)
+
#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
- _NEW_TEXTURE | \
+ _NEW_TEXTURE_STATE | \
_NEW_POINT | \
_NEW_PROGRAM | \
_NEW_MODELVIEW)
/* If the sampler is currently bound, unbind it. */
for (j = 0; j < ctx->Const.MaxCombinedTextureImageUnits; j++) {
if (ctx->Texture.Unit[j].Sampler == sampObj) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
_mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[j].Sampler, NULL);
}
}
struct gl_sampler_object *sampObj)
{
if (ctx->Texture.Unit[unit].Sampler != sampObj) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
}
_mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler,
_mesa_reference_sampler_object(ctx,
&ctx->Texture.Unit[unit].Sampler,
sampObj);
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
}
}
_mesa_reference_sampler_object(ctx,
&ctx->Texture.Unit[unit].Sampler,
NULL);
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
}
}
}
static inline void
flush(struct gl_context *ctx)
{
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
}
void
* should return zero and stores should have no effect.
*
* The result depends on context state other than the passed image unit, part
- * of the _NEW_TEXTURE set.
+ * of the _NEW_TEXTURE_OBJECT set.
*/
GLboolean
_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u);
}
if (legal) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->EnvMode = mode;
}
else {
{
if (TEST_EQ_4V(color, texUnit->EnvColorUnclamped))
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
COPY_4FV(texUnit->EnvColorUnclamped, color);
texUnit->EnvColor[0] = CLAMP(color[0], 0.0F, 1.0F);
texUnit->EnvColor[1] = CLAMP(color[1], 0.0F, 1.0F);
case GL_COMBINE_RGB:
if (texUnit->Combine.ModeRGB == mode)
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->Combine.ModeRGB = mode;
break;
case GL_COMBINE_ALPHA:
if (texUnit->Combine.ModeA == mode)
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->Combine.ModeA = mode;
break;
default:
return;
}
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
if (alpha)
texUnit->Combine.SourceA[term] = param;
return;
}
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
if (alpha)
texUnit->Combine.OperandA[term] = param;
case GL_RGB_SCALE:
if (texUnit->Combine.ScaleShiftRGB == shift)
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->Combine.ScaleShiftRGB = shift;
break;
case GL_ALPHA_SCALE:
if (texUnit->Combine.ScaleShiftA == shift)
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->Combine.ScaleShiftA = shift;
break;
default:
if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
if (texUnit->LodBias == param[0])
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texUnit->LodBias = param[0];
}
else {
return;
}
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
texgen->Mode = mode;
texgen->_ModeBit = bit;
}
}
if (TEST_EQ_4V(texgen->ObjectPlane, params))
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
COPY_4FV(texgen->ObjectPlane, params);
}
break;
ctx->ModelviewMatrixStack.Top->inv);
if (TEST_EQ_4V(texgen->EyePlane, tmp))
return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
COPY_4FV(texgen->EyePlane, tmp);
}
break;
check_gen_mipmap(ctx, target, texObj, level);
- /* NOTE: Don't signal _NEW_TEXTURE since we've only changed
+ /* NOTE: Don't signal _NEW_TEXTURE_OBJECT since we've only changed
* the texel data, not the texture format, size, etc.
*/
}
check_gen_mipmap(ctx, target, texObj, level);
- /* NOTE: Don't signal _NEW_TEXTURE since we've only changed
+ /* NOTE: Don't signal _NEW_TEXTURE_OBJECT since we've only changed
* the texel data, not the texture format, size, etc.
*/
}
check_gen_mipmap(ctx, target, texObj, level);
- /* NOTE: Don't signal _NEW_TEXTURE since we've only changed
+ /* NOTE: Don't signal _NEW_TEXTURE_OBJECT since we've only changed
* the texel data, not the texture format, size, etc.
*/
}
{
texObj->_BaseComplete = GL_FALSE;
texObj->_MipmapComplete = GL_FALSE;
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
}
ctx->Driver.BindTexture(ctx, unit, 0, texObj);
texUnit->_BoundTextures &= ~(1 << index);
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
}
}
_mesa_unlock_texture(ctx, delObj);
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
/* The texture _name_ is now free for re-use.
* Remove it from the hash table now.
}
_mesa_unlock_texture(ctx, texObj);
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
/* Unreference the texobj. If refcount hits zero, the texture
* will be deleted.
}
/* flush before changing binding */
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
/* If the refcount on the previously bound texture is decremented to
* zero, it'll be deleted here.
}
}
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
}
mtx_lock(&ctx->Shared->TexMutex);
if (ctx->Shared->TextureStateStamp != ctx->TextureStateTimestamp) {
- ctx->NewState |= _NEW_TEXTURE;
+ ctx->NewState |= _NEW_TEXTURE_OBJECT;
ctx->TextureStateTimestamp = ctx->Shared->TextureStateStamp;
}
}
static inline void
flush(struct gl_context *ctx)
{
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
}
/**
* This is called just prior to changing any texture object state which
* could affect texture completeness (texture base level, max level).
- * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE
+ * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE_OBJECT
* state flag and then mark the texture object as 'incomplete' so that any
* per-texture derived state gets recomputed.
*/
static inline void
incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
{
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
_mesa_dirty_texobj(ctx, texObj);
}
_mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameterIiv(texture)");
return;
}
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
/* set the integer-valued border color */
COPY_4V(texObj->Sampler.BorderColor.i, params);
break;
_mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameterIuiv(texture)");
return;
}
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT);
/* set the unsigned integer-valued border color */
COPY_4V(texObj->Sampler.BorderColor.ui, params);
break;
return;
}
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
ctx->Texture.CurrentUnit = texUnit;
if (ctx->Transform.MatrixMode == GL_TEXTURE) {
if (changed) {
if (!flushed) {
- FLUSH_VERTICES(ctx, _NEW_TEXTURE | _NEW_PROGRAM);
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT | _NEW_PROGRAM);
flushed = true;
}
return _NEW_LIGHT;
case STATE_TEXGEN:
- return _NEW_TEXTURE;
+ return _NEW_TEXTURE_STATE;
case STATE_TEXENV_COLOR:
- return _NEW_TEXTURE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
+ return _NEW_TEXTURE_STATE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
case STATE_FOG_COLOR:
return _NEW_FOG | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
st->active_states = st_get_active_states(ctx);
}
- if (new_state & _NEW_TEXTURE) {
+ if (new_state & _NEW_TEXTURE_OBJECT) {
st->dirty |= st->active_states &
(ST_NEW_SAMPLER_VIEWS |
ST_NEW_SAMPLERS |