<div dir="ltr">Correct and I check_multisample_target checks for that.<div>And we never get to this code if using a PROXY target.</div><div>Or did I miss something?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Nov 6, 2013 at 1:14 PM, Chris Forbes <span dir="ltr"><<a href="mailto:chrisf@ijw.co.nz" target="_blank">chrisf@ijw.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The only interesting targets in teximagemultisample are<br>
GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY.<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Nov 7, 2013 at 8:55 AM, Courtney Goeltzenleuchter<br>
<<a href="mailto:courtney@lunarg.com">courtney@lunarg.com</a>> wrote:<br>
> TexStorage and TexStorageMultisample updates texture object<br>
> state needed by ARB_texture_view extension.<br>
><br>
> Set appropriate TextureView state in texture object.<br>
><br>
> mesa: Add ARB_texture_view<br>
><br>
> Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com><br>
> ---<br>
>  src/mesa/main/teximage.c   | 38 ++++++++++++++++++++++++++++++++++++++<br>
>  src/mesa/main/texstorage.c | 33 +++++++++++++++++++++++++++++++++<br>
>  2 files changed, 71 insertions(+)<br>
><br>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
> index 793c5d3..c01f72e 100644<br>
> --- a/src/mesa/main/teximage.c<br>
> +++ b/src/mesa/main/teximage.c<br>
> @@ -4348,6 +4348,44 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,<br>
>        }<br>
><br>
>        texObj->Immutable = immutable;<br>
> +<br>
> +      if (immutable) {<br>
> +         /* If the command is successful,<br>
> +          * TEXTURE_IMMUTABLE_FORMAT becomes TRUE.<br>
> +          * TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS become levels.<br>
> +          * If the texture target is TEXTURE_1D_ARRAY then<br>
> +          * TEXTURE_VIEW_NUM_LAYERS becomes height.<br>
> +          * If the texture target is TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY,<br>
> +          * or TEXTURE_2D_MULTISAMPLE_ARRAY then TEXTURE_VIEW_NUM_LAYERS becomes depth.<br>
> +          * If the texture target is TEXTURE_CUBE_MAP, then<br>
> +          * TEXTURE_VIEW_NUM_LAYERS becomes 6.<br>
> +          * For any other texture target, TEXTURE_VIEW_NUM_LAYERS becomes 1.<br>
> +          * ARB_texture_multisample: Multisample textures do<br>
> +          * not have multiple image levels.<br>
> +          */<br>
> +         texObj->Immutable = GL_TRUE;<br>
> +         texObj->ImmutableLevels = 1;<br>
> +         texObj->MinLevel = 0;<br>
> +         texObj->NumLevels = 1;<br>
> +         texObj->MinLayer = 0;<br>
> +         texObj->NumLayers = 1;<br>
> +         switch (target) {<br>
> +         case GL_TEXTURE_1D_ARRAY:<br>
> +            texObj->NumLayers = height;<br>
> +            break;<br>
> +<br>
> +         case GL_TEXTURE_2D_ARRAY:<br>
> +         case GL_TEXTURE_CUBE_MAP_ARRAY:<br>
> +         case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:<br>
> +            texObj->NumLayers = depth;<br>
> +            break;<br>
> +<br>
> +         case GL_TEXTURE_CUBE_MAP:<br>
> +            texObj->NumLayers = 6;<br>
> +            break;<br>
> +         }<br>
> +      }<br>
> +<br>
>        _mesa_update_fbo_texture(ctx, texObj, 0, 0);<br>
>     }<br>
>  }<br>
> diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c<br>
> index 84b8f82..4da3c91 100644<br>
> --- a/src/mesa/main/texstorage.c<br>
> +++ b/src/mesa/main/texstorage.c<br>
> @@ -436,8 +436,41 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,<br>
>           return;<br>
>        }<br>
><br>
> +      /* If the command is successful,<br>
> +       * TEXTURE_IMMUTABLE_FORMAT becomes TRUE.<br>
> +       * TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS become levels.<br>
> +       * If the texture target is TEXTURE_1D_ARRAY then<br>
> +       * TEXTURE_VIEW_NUM_LAYERS becomes height.<br>
> +       * If the texture target is TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY,<br>
> +       * or TEXTURE_2D_MULTISAMPLE_ARRAY then TEXTURE_VIEW_NUM_LAYERS becomes depth.<br>
> +       * If the texture target is TEXTURE_CUBE_MAP, then<br>
> +       * TEXTURE_VIEW_NUM_LAYERS becomes 6.<br>
> +       * For any other texture target, TEXTURE_VIEW_NUM_LAYERS becomes 1.<br>
> +       */<br>
> +<br>
>        texObj->Immutable = GL_TRUE;<br>
>        texObj->ImmutableLevels = levels;<br>
> +      texObj->MinLevel = 0;<br>
> +      texObj->NumLevels = levels;<br>
> +      texObj->MinLayer = 0;<br>
> +      texObj->NumLayers = 1;<br>
> +      switch (target)<br>
> +      {<br>
> +      case GL_TEXTURE_1D_ARRAY:<br>
> +         texObj->NumLayers = height;<br>
> +         break;<br>
> +<br>
> +      case GL_TEXTURE_2D_ARRAY:<br>
> +      case GL_TEXTURE_CUBE_MAP_ARRAY:<br>
> +      case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:<br>
> +         texObj->NumLayers = depth;<br>
> +         break;<br>
> +<br>
> +      case GL_TEXTURE_CUBE_MAP:<br>
> +         texObj->NumLayers = 6;<br>
> +         break;<br>
> +      }<br>
> +<br>
>     }<br>
>  }<br>
><br>
> --<br>
> 1.8.1.2<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Courtney Goeltzenleuchter<br><div>LunarG</div><div><img src="http://media.lunarg.com/wp-content/themes/LunarG/images/logo.png" width="96" height="65"><br>
</div></div>
</div>