[Mesa-dev] [PATCH V3 12/19] mesa: implement TexImage*Multisample

Eric Anholt eric at anholt.net
Tue Feb 12 10:41:34 PST 2013


Chris Forbes <chrisf at ijw.co.nz> writes:

> V2: - fix formatting issues
>     - generate GL_OUT_OF_MEMORY if teximage cannot be allocated
>     - fix for state moving from texobj to image
>
> V3: - remove ridiculous stencil hack
>     - alter format check to not allow a base format of STENCIL_INDEX
>     - allow width/height/depth to be zero, to deallocate the texture
>     - dont forget to call _mesa_update_fbo_texture
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/main/teximage.c | 151 +++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 147 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 2dd150d..72d106e 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -4161,15 +4161,158 @@ _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer,
>     texbufferrange(ctx, target, internalFormat, bufObj, offset, size);
>  }
>  
> +static GLboolean
> +is_renderable_texture_format(struct gl_context *ctx, GLenum internalformat)
> +{
> +   /* Everything that is allowed for renderbuffers,
> +    * except for a base format of GL_STENCIL_INDEX.
> +    */
> +   GLenum baseFormat = _mesa_base_fbo_format(ctx, internalformat);
> +   return baseFormat != 0 && baseFormat != GL_STENCIL_INDEX;
> +}
>  
>  /** GL_ARB_texture_multisample */
> +static void
> +teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
> +      GLint internalformat, GLsizei width, GLsizei height, GLsizei depth,
> +      GLboolean fixedsamplelocations)

weird indentation -- the continuing lines generally line up like:

teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
                    GLint internalformat, GLsizei width, GLsizei height, GLsizei depth,
                    GLboolean fixedsamplelocations)

> +{
> +   struct gl_texture_object *texObj;
> +   struct gl_texture_image *texImage;
> +   GLboolean sizeOK, dimensionsOK;
> +   gl_format texFormat;
> +
> +   GET_CURRENT_CONTEXT(ctx);
> +
> +   if (!(ctx->Extensions.ARB_texture_multisample
> +      && _mesa_is_desktop_gl(ctx))) {

same lining-up thing all over the place:

   if (!(ctx->Extensions.ARB_texture_multisample
       && _mesa_is_desktop_gl(ctx))) {

> +   /* TODO: should ask the driver for the exact limit for this internalformat
> +    * once IDR's internalformat_query bits land
> +    */

Oops, TODO left over.  idr should review whatever gets written here.

If the indentation style noted here is fixed in patches 13-16, then they
will automatically get my Reviewed-by.  At this point I think I'm done
reviewing this series.  Awesome work!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130212/f981b9c3/attachment.pgp>


More information about the mesa-dev mailing list