[Mesa-dev] [PATCH 5/7] mesa: Update TexStorage to support ARB_texture_view
Courtney Goeltzenleuchter
courtney at lunarg.com
Wed Nov 6 13:04:05 PST 2013
Ah, I get it, the switch statement after. Yeah, that could make sense as a
helper wouldn't it. I'll look at that.
On Wed, Nov 6, 2013 at 1:42 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> Your change to teximagemultisample just has a bunch of spurious stuff for
> other targets. not harmful -- it will never get reached -- but spurious.
>
> It might be worth pulling both blocks out into a shared helper.
>
>
>
>
> On Thu, Nov 7, 2013 at 9:32 AM, Courtney Goeltzenleuchter <
> courtney at lunarg.com> wrote:
>
>> Correct and I check_multisample_target checks for that.
>> And we never get to this code if using a PROXY target.
>> Or did I miss something?
>>
>>
>> On Wed, Nov 6, 2013 at 1:14 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
>>
>>> The only interesting targets in teximagemultisample are
>>> GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY.
>>>
>>> On Thu, Nov 7, 2013 at 8:55 AM, Courtney Goeltzenleuchter
>>> <courtney at lunarg.com> wrote:
>>> > TexStorage and TexStorageMultisample updates texture object
>>> > state needed by ARB_texture_view extension.
>>> >
>>> > Set appropriate TextureView state in texture object.
>>> >
>>> > mesa: Add ARB_texture_view
>>> >
>>> > Signed-off-by: Courtney Goeltzenleuchter <courtney at LunarG.com>
>>> > ---
>>> > src/mesa/main/teximage.c | 38 ++++++++++++++++++++++++++++++++++++++
>>> > src/mesa/main/texstorage.c | 33 +++++++++++++++++++++++++++++++++
>>> > 2 files changed, 71 insertions(+)
>>> >
>>> > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>>> > index 793c5d3..c01f72e 100644
>>> > --- a/src/mesa/main/teximage.c
>>> > +++ b/src/mesa/main/teximage.c
>>> > @@ -4348,6 +4348,44 @@ teximagemultisample(GLuint dims, GLenum target,
>>> GLsizei samples,
>>> > }
>>> >
>>> > texObj->Immutable = immutable;
>>> > +
>>> > + if (immutable) {
>>> > + /* If the command is successful,
>>> > + * TEXTURE_IMMUTABLE_FORMAT becomes TRUE.
>>> > + * TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS
>>> become levels.
>>> > + * If the texture target is TEXTURE_1D_ARRAY then
>>> > + * TEXTURE_VIEW_NUM_LAYERS becomes height.
>>> > + * If the texture target is TEXTURE_2D_ARRAY,
>>> TEXTURE_CUBE_MAP_ARRAY,
>>> > + * or TEXTURE_2D_MULTISAMPLE_ARRAY then
>>> TEXTURE_VIEW_NUM_LAYERS becomes depth.
>>> > + * If the texture target is TEXTURE_CUBE_MAP, then
>>> > + * TEXTURE_VIEW_NUM_LAYERS becomes 6.
>>> > + * For any other texture target, TEXTURE_VIEW_NUM_LAYERS
>>> becomes 1.
>>> > + * ARB_texture_multisample: Multisample textures do
>>> > + * not have multiple image levels.
>>> > + */
>>> > + texObj->Immutable = GL_TRUE;
>>> > + texObj->ImmutableLevels = 1;
>>> > + texObj->MinLevel = 0;
>>> > + texObj->NumLevels = 1;
>>> > + texObj->MinLayer = 0;
>>> > + texObj->NumLayers = 1;
>>> > + switch (target) {
>>> > + case GL_TEXTURE_1D_ARRAY:
>>> > + texObj->NumLayers = height;
>>> > + break;
>>> > +
>>> > + case GL_TEXTURE_2D_ARRAY:
>>> > + case GL_TEXTURE_CUBE_MAP_ARRAY:
>>> > + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
>>> > + texObj->NumLayers = depth;
>>> > + break;
>>> > +
>>> > + case GL_TEXTURE_CUBE_MAP:
>>> > + texObj->NumLayers = 6;
>>> > + break;
>>> > + }
>>> > + }
>>> > +
>>> > _mesa_update_fbo_texture(ctx, texObj, 0, 0);
>>> > }
>>> > }
>>> > diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
>>> > index 84b8f82..4da3c91 100644
>>> > --- a/src/mesa/main/texstorage.c
>>> > +++ b/src/mesa/main/texstorage.c
>>> > @@ -436,8 +436,41 @@ texstorage(GLuint dims, GLenum target, GLsizei
>>> levels, GLenum internalformat,
>>> > return;
>>> > }
>>> >
>>> > + /* If the command is successful,
>>> > + * TEXTURE_IMMUTABLE_FORMAT becomes TRUE.
>>> > + * TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS become
>>> levels.
>>> > + * If the texture target is TEXTURE_1D_ARRAY then
>>> > + * TEXTURE_VIEW_NUM_LAYERS becomes height.
>>> > + * If the texture target is TEXTURE_2D_ARRAY,
>>> TEXTURE_CUBE_MAP_ARRAY,
>>> > + * or TEXTURE_2D_MULTISAMPLE_ARRAY then TEXTURE_VIEW_NUM_LAYERS
>>> becomes depth.
>>> > + * If the texture target is TEXTURE_CUBE_MAP, then
>>> > + * TEXTURE_VIEW_NUM_LAYERS becomes 6.
>>> > + * For any other texture target, TEXTURE_VIEW_NUM_LAYERS
>>> becomes 1.
>>> > + */
>>> > +
>>> > texObj->Immutable = GL_TRUE;
>>> > texObj->ImmutableLevels = levels;
>>> > + texObj->MinLevel = 0;
>>> > + texObj->NumLevels = levels;
>>> > + texObj->MinLayer = 0;
>>> > + texObj->NumLayers = 1;
>>> > + switch (target)
>>> > + {
>>> > + case GL_TEXTURE_1D_ARRAY:
>>> > + texObj->NumLayers = height;
>>> > + break;
>>> > +
>>> > + case GL_TEXTURE_2D_ARRAY:
>>> > + case GL_TEXTURE_CUBE_MAP_ARRAY:
>>> > + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
>>> > + texObj->NumLayers = depth;
>>> > + break;
>>> > +
>>> > + case GL_TEXTURE_CUBE_MAP:
>>> > + texObj->NumLayers = 6;
>>> > + break;
>>> > + }
>>> > +
>>> > }
>>> > }
>>> >
>>> > --
>>> > 1.8.1.2
>>> >
>>> > _______________________________________________
>>> > mesa-dev mailing list
>>> > mesa-dev at lists.freedesktop.org
>>> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>>
>>
>>
>>
>> --
>> Courtney Goeltzenleuchter
>> LunarG
>>
>>
>
--
Courtney Goeltzenleuchter
LunarG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131106/ff111a2b/attachment-0001.html>
More information about the mesa-dev
mailing list