diff options
author | Ian Romanick <[email protected]> | 2012-12-01 11:05:00 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-15 21:34:45 -0800 |
commit | f5e7f12e4a1d2ee98ced36c232842d60181fc01e (patch) | |
tree | 90eeea0255dfd8eca7baf91251ed71b75d7b7fed /src/mesa/main/dd.h | |
parent | bda540d2357f69a63dcf16550e178f803682d6ce (diff) |
mesa: Add driver method to determine the possible sample counts
Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and
GL_NUM_SAMPLE_COUNTS.
v2: internalFormat may not be color renderable by the driver, so zero
can be returned as a sample count. Require that drivers supporting the
extension provide a QuerySamplesForFormat function. The later was
suggested by Eric Anholt.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r-- | src/mesa/main/dd.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 70c53240e73..07787d41dd9 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -201,6 +201,22 @@ struct dd_function_table { GLenum srcFormat, GLenum srcType ); /** + * Determine sample counts support for a particular format + * + * \param ctx GL context + * \param internalFormat GL format enum + * \param samples Buffer to hold the returned sample counts. + * Drivers \b must \b not return more than 16 counts. + * + * \returns + * The number of sample counts actually written to \c samples. If + * \c internaFormat is not renderable, zero is returned. + */ + size_t (*QuerySamplesForFormat)(struct gl_context *ctx, + GLenum internalFormat, + int samples[16]); + + /** * Called by glTexImage[123]D() and glCopyTexImage[12]D() * Allocate texture memory and copy the user's image to the buffer. * The gl_texture_image fields, etc. will be fully initialized. |