diff options
author | Christoph Bumiller <[email protected]> | 2011-07-28 15:26:01 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-08-04 15:38:49 +0200 |
commit | 57590e173b6f421b1015190aa3c0011ea55f31d8 (patch) | |
tree | 8519b10ee3c948098020a3270f6f567bcbe32027 /src/mesa | |
parent | 32f4cf38085e4056b8e4a9fc78fea28897a1d05f (diff) |
st/mesa: determine Const.MaxSamples in init_extensions
v2: Check for non-pow2 sample counts as well.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index b5f6d356eb0..8e900934054 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -228,6 +228,7 @@ void st_init_extensions(struct st_context *st) { struct pipe_screen *screen = st->pipe->screen; struct gl_context *ctx = st->ctx; + int i; /* * Extensions that are supported by all Gallium drivers: @@ -605,6 +606,16 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.EXT_packed_float = GL_TRUE; } + /* Maximum sample count. */ + for (i = 16; i > 0; --i) { + if (screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_UNORM, + PIPE_TEXTURE_2D, i, + PIPE_BIND_RENDER_TARGET)) { + ctx->Const.MaxSamples = i; + break; + } + } + if (screen->get_param(screen, PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE)) { ctx->Extensions.ARB_seamless_cube_map = GL_TRUE; ctx->Extensions.AMD_seamless_cubemap_per_texture = GL_TRUE; |