Chris Forbes <chr...@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 <chr...@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!
pgpvo8fXoNvBO.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev