diff options
author | Chris Forbes <[email protected]> | 2013-02-16 20:47:11 +1300 |
---|---|---|
committer | Chris Forbes <[email protected]> | 2013-03-24 16:38:18 +1300 |
commit | 86b83806007c65baea916a2ccf71ecbcc256ebba (patch) | |
tree | 6aef592f3e0fdef87756c9fe0b02e2a6dcc0790e /src/mesa/main/formatquery.c | |
parent | 3cc2629b3b4bfc3b5c21a5932a3a2e590e60f98a (diff) |
mesa: allow internalformat_query with multisample texture targets
Now that we support ARB_texture_multisample, there are multiple targets
accepted for this query, and they may have target-dependent limits, so
pass the target to the driverfunc.
For example, the sampling hardware may not be able to do general
texelFetch() for some format/sample count combination, but the driver
may still be able to implement a reasonable resolve operation, so it can
be supported for renderbuffers.
V2: - Don't break Gallium compile.
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r-- | src/mesa/main/formatquery.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index bd895e87481..78c5fbe5e2b 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -59,9 +59,10 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, case GL_TEXTURE_2D_MULTISAMPLE: case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: - /* Mesa does not currently support GL_ARB_texture_multisample, so these - * enums are not valid on this implementation either. - */ + /* These enums are only valid if ARB_texture_multisample is supported */ + if (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample) + break; + default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetInternalformativ(target=%s)", @@ -96,7 +97,8 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, switch (pname) { case GL_SAMPLES: - count = ctx->Driver.QuerySamplesForFormat(ctx, internalformat, buffer); + count = ctx->Driver.QuerySamplesForFormat(ctx, target, + internalformat, buffer); break; case GL_NUM_SAMPLE_COUNTS: { /* The driver can return 0, and we should pass that along to the @@ -115,7 +117,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, * returned." */ const size_t num_samples = - ctx->Driver.QuerySamplesForFormat(ctx, internalformat, buffer); + ctx->Driver.QuerySamplesForFormat(ctx, target, internalformat, buffer); /* QuerySamplesForFormat writes some stuff to buffer, so we have to * separately over-write it with the requested value. |