i965: Validate (and resolve) all the bound textures.

BRW_MAX_TEX_UNIT is the static limit on the number of textures we
support per-stage, not in total.

Core's `Unit` array is sized by MAX_COMBINED_TEXTURE_IMAGE_UNITS, which
is significantly larger, and across the various shader stages, up to
ctx->Const.MaxCombinedTextureImageUnits elements of it may be actually
used.

Fixes invisible bad behavior in piglit's max-samplers test (although
this escalated to an assertion failure on HSW with texture_view, since
non-immutable textures only have _Format set by validation.)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Chris Forbes 2014-02-22 18:09:31 +13:00
parent 590920f93e
commit befbda56a2
2 changed files with 2 additions and 2 deletions

View File

@ -317,7 +317,7 @@ brw_predraw_resolve_buffers(struct brw_context *brw)
/* Resolve depth buffer of each enabled depth texture, and color buffer of
* each fast-clear-enabled color texture.
*/
for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) {
for (int i = 0; i < ctx->Const.MaxCombinedTextureImageUnits; i++) {
if (!ctx->Texture.Unit[i]._ReallyEnabled)
continue;
tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);

View File

@ -47,7 +47,7 @@ void brw_validate_textures( struct brw_context *brw )
struct gl_context *ctx = &brw->ctx;
int i;
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
for (i = 0; i < ctx->Const.MaxCombinedTextureImageUnits; i++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
if (texUnit->_ReallyEnabled) {