[Mesa-dev] [PATCH] mesa: fix fallback texture for cube map array

Marek Olšák maraeo at gmail.com
Mon Sep 1 03:36:59 PDT 2014


On Thu, Aug 28, 2014 at 3:36 PM, Roland Scheidegger <sroland at vmware.com> wrote:
> Oops there's a bug in there, I'll send out a new version (we only pass a
> one pixel sized array).
> FWIW the msaa case also has its issues (generates a warning in
> store_texsubimage, I guess that's pretty harmless though at the very
> least the default value is going not to be what it should but who cares
> about that anyway). Don't know though how that could be fixed.

Because of fallbacks, most drivers which support MSAA also implement
mapping MSAA textures as single-sample. All we need to do is to upload
texels like for a single-sample texture.

Marek

>
> Roland
>
> Am 28.08.2014 04:28, schrieb Ian Romanick:
>> 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;
>>>
>>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list