diff options
author | Eduardo Lima Mitev <[email protected]> | 2015-11-24 22:32:00 +0100 |
---|---|---|
committer | Eduardo Lima Mitev <[email protected]> | 2016-03-03 15:14:05 +0100 |
commit | 1f0b2ce8ec139cfb54db014949db0345461aff94 (patch) | |
tree | 2f3edfd20f73246c961aa5a86a4d4a6d6441c5ef /src/mesa/main | |
parent | ee31b0b1d0f9394f1a41f71c0bf743a59ba7947d (diff) |
mesa/multisample: Check sample count using the new driver hook
Use QueryInternalFormat instead of QuerySamplesForFormat to obtain the
highest supported sample. QuerySamplesForFormat is to be removed.
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/multisample.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index e7783ea5374..77773a20883 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -174,10 +174,15 @@ _mesa_check_sample_count(struct gl_context *ctx, GLenum target, * for <internalformat> then the error INVALID_OPERATION is generated." */ if (ctx->Extensions.ARB_internalformat_query) { - GLint buffer[16]; - int count = ctx->Driver.QuerySamplesForFormat(ctx, target, - internalFormat, buffer); - int limit = count ? buffer[0] : -1; + GLint buffer[16] = {-1}; + GLint limit; + + ctx->Driver.QueryInternalFormat(ctx, target, internalFormat, + GL_SAMPLES, buffer); + /* since the query returns samples sorted in descending order, + * the first element is the greatest supported sample value. + */ + limit = buffer[0]; return samples > limit ? GL_INVALID_OPERATION : GL_NO_ERROR; } |