mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-10 20:10:31 +01:00
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 <airlied@redhat.com>
This commit is contained in:
parent
ee31b0b1d0
commit
1f0b2ce8ec
1 changed files with 9 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue