[Mesa-dev] [PATCH] mesa: fix fallback texture for cube map array
Ian Romanick
idr at freedesktop.org
Wed Aug 27 19:28:53 PDT 2014
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
On 08/27/2014 06:00 PM, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> mesa was creating a cube map array texture with just one layer, which is
> not legal. This caused an assertion failure when using that texture later
> in llvmpipe (when enabling cube map arrays) since it verifies the number
> of layers in the view is divisible by 6 (the sampling code might well crash
> randomly otherwise) with piglit glsl-resource-not-bound CubeArray -fbo -auto.
> ---
> src/mesa/main/texobj.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 2a82c2d..feac771 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -772,7 +772,8 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
> {
> if (!ctx->Shared->FallbackTex[tex]) {
> /* create fallback texture now */
> - const GLsizei width = 1, height = 1, depth = 1;
> + const GLsizei width = 1, height = 1;
> + GLsizei depth = 1;
> GLubyte texel[4];
> struct gl_texture_object *texObj;
> struct gl_texture_image *texImage;
> @@ -822,6 +823,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
> case TEXTURE_CUBE_ARRAY_INDEX:
> dims = 3;
> target = GL_TEXTURE_CUBE_MAP_ARRAY;
> + depth = 6;
> break;
> case TEXTURE_EXTERNAL_INDEX:
> dims = 2;
>
More information about the mesa-dev
mailing list