Chris Forbes <[email protected]> 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 <[email protected]>
> 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;
pgpVTm1r2HTKv.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
