diff options
author | Chris Forbes <[email protected]> | 2014-02-22 18:09:31 +1300 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-03-03 09:36:41 +0200 |
commit | 4c0702b05ca002e42dbf05c6c4451113df0c3799 (patch) | |
tree | b110d043934e2e8d2cd404d9381b8037a2575bcf | |
parent | 5fbd6494517be0bc2f2ead4d6966776fcb0d426d (diff) |
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 <[email protected]>
Cc: "9.2 10.0 10.1" <[email protected]>
Cc: Kenneth Graunke <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
(cherry picked from commit befbda56a246f77797bdf13fc005353441db2879)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tex.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 39da953e99f..1e018bb0d76 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -326,7 +326,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); diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 9234e3ae161..b1f4de07149 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -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) { |