i915: Fall back on NPOT textured metaops on 830-class.
(cherry picked from commit 8ec6e03679)
This commit is contained in:
@@ -559,4 +559,10 @@ intel_context(GLcontext * ctx)
|
||||
return (struct intel_context *) ctx;
|
||||
}
|
||||
|
||||
static INLINE GLboolean
|
||||
is_power_of_two(uint32_t value)
|
||||
{
|
||||
return (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -401,6 +401,14 @@ intel_texture_bitmap(GLcontext * ctx,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
(!is_power_of_two(width) || !is_power_of_two(height))) {
|
||||
if (INTEL_DEBUG & DEBUG_FALLBACKS)
|
||||
fprintf(stderr,
|
||||
"glBitmap() fallback: NPOT texture\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* Check that we can load in a texture this big. */
|
||||
if (width > (1 << (ctx->Const.MaxTextureLevels - 1)) ||
|
||||
height > (1 << (ctx->Const.MaxTextureLevels - 1))) {
|
||||
|
||||
@@ -120,6 +120,14 @@ intel_texture_drawpixels(GLcontext * ctx,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
(!is_power_of_two(width) || !is_power_of_two(height))) {
|
||||
if (INTEL_DEBUG & DEBUG_FALLBACKS)
|
||||
fprintf(stderr,
|
||||
"glDrawPixels() fallback: NPOT texture\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
_mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT |
|
||||
GL_CURRENT_BIT);
|
||||
_mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
@@ -273,6 +281,14 @@ intel_stencil_drawpixels(GLcontext * ctx,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (!ctx->Extensions.ARB_texture_non_power_of_two &&
|
||||
(!is_power_of_two(width) || !is_power_of_two(height))) {
|
||||
if (INTEL_DEBUG & DEBUG_FALLBACKS)
|
||||
fprintf(stderr,
|
||||
"glDrawPixels(GL_STENCIL_INDEX) fallback: NPOT texture\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
_mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT |
|
||||
GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
_mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
|
||||
Reference in New Issue
Block a user