[Mesa-dev] [PATCH V3 02/19] mesa: add texobj support for ARB_texture_multisample
Eric Anholt
eric at anholt.net
Mon Feb 11 10:40:12 PST 2013
Chris Forbes <chrisf at ijw.co.nz> writes:
> Adds the new texture targets, and per-image state for GL_TEXTURE_SAMPLES
> and GL_TEXTURE_FIXED_SAMPLE_LOCATIONS.
>
> V2: - Allow multisample texture targets in glInvalidateTexSubImage too.
> This was already partly there, but I missed it the first time around
> since the interaction is defined in a newer extension. Fixed weird
> indentation.
> - Allow multisample array textures in glFramebufferTextureLayer.
> This was overlooked as the tests originally only used 2d
> multisample textures.
>
> V3: - Set min/mag filters sensibly for multisample textures. This
> can't actually be changed by the user, so it's more sensible to
> initialize it correctly than to hack around it being bogus later.
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index e99b0dc..4cce4a8 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -126,19 +128,30 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
>
> /* sampler state */
> if (target == GL_TEXTURE_RECTANGLE_NV ||
> - target == GL_TEXTURE_EXTERNAL_OES) {
> + target == GL_TEXTURE_EXTERNAL_OES ||
> + target == GL_TEXTURE_2D_MULTISAMPLE ||
> + target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
I don't think this addition of 2D_MULTISAMPLE here was intentional --
you want the else if case below, right?
(It looks like this all gets smashed by finish_texture_init(), which
makes me wonder why it exists in two places)
Other than that,
Reviewed-by: Eric Anholt <eric at anholt.net>
> obj->Sampler.WrapS = GL_CLAMP_TO_EDGE;
> obj->Sampler.WrapT = GL_CLAMP_TO_EDGE;
> obj->Sampler.WrapR = GL_CLAMP_TO_EDGE;
> obj->Sampler.MinFilter = GL_LINEAR;
> + obj->Sampler.MagFilter = GL_LINEAR;
> + }
> + else if (target == GL_TEXTURE_2D_MULTISAMPLE ||
> + target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
> + obj->Sampler.WrapS = GL_CLAMP_TO_EDGE;
> + obj->Sampler.WrapT = GL_CLAMP_TO_EDGE;
> + obj->Sampler.WrapR = GL_CLAMP_TO_EDGE;
> + obj->Sampler.MinFilter = GL_NEAREST;
> + obj->Sampler.MagFilter = GL_NEAREST;
> }
> else {
> obj->Sampler.WrapS = GL_REPEAT;
> obj->Sampler.WrapT = GL_REPEAT;
> obj->Sampler.WrapR = GL_REPEAT;
> obj->Sampler.MinFilter = GL_NEAREST_MIPMAP_LINEAR;
> + obj->Sampler.MagFilter = GL_LINEAR;
> }
> - obj->Sampler.MagFilter = GL_LINEAR;
-------------- 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/20130211/b2cef453/attachment.pgp>
More information about the mesa-dev
mailing list