diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2012-11-24 21:46:56 +1300 |
---|---|---|
committer | Chris Forbes <chrisf@ijw.co.nz> | 2013-03-02 11:33:27 +1300 |
commit | d04a4dd0039d397c19e28cde878f51cad0877f07 (patch) | |
tree | 763be5fd6be9f4d9e9bcb4c2c388465e6f367ec2 /src/mesa/main/texparam.c | |
parent | 0f83e415e49520021977e76ad3d0b0a9c1f6d8d4 (diff) | |
download | external_mesa3d-d04a4dd0039d397c19e28cde878f51cad0877f07.zip external_mesa3d-d04a4dd0039d397c19e28cde878f51cad0877f07.tar.gz external_mesa3d-d04a4dd0039d397c19e28cde878f51cad0877f07.tar.bz2 |
mesa: add texobj support for ARB_texture_multisample
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.
V4: - Tidy up initial min/mag filter setup. Setup in
_mesa_initialize_texture_object was bogus, but benign since
finish_texture_init() clobbered everything with correct values. For V4,
just do the setup in finish_texture_init().
V5: - Don't break glPopAttrib(GL_TEXTURE_BIT)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
[V2] Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r-- | src/mesa/main/texparam.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index bc66bb3..120845b 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -966,6 +966,9 @@ legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target) * "target may also be TEXTURE_BUFFER, indicating the texture buffer." */ return ctx->API == API_OPENGL_CORE && ctx->Version >= 31; + case GL_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + return ctx->Extensions.ARB_texture_multisample; default: return GL_FALSE; } @@ -1105,6 +1108,19 @@ get_tex_level_parameter_image(struct gl_context *ctx, *params = GL_NONE; break; + /* GL_ARB_texture_multisample */ + case GL_TEXTURE_SAMPLES: + if (!ctx->Extensions.ARB_texture_multisample) + goto invalid_pname; + *params = img->NumSamples; + break; + + case GL_TEXTURE_FIXED_SAMPLE_LOCATIONS: + if (!ctx->Extensions.ARB_texture_multisample) + goto invalid_pname; + *params = img->FixedSampleLocations; + break; + default: goto invalid_pname; } |