diff options
author | Marek Olšák <[email protected]> | 2011-03-26 13:19:23 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-03-29 12:50:27 +0200 |
commit | 8d4ec87d7f987b3852dafa6802815bb9a3ec7ad4 (patch) | |
tree | bcf0406b689bf8d7b38eb669da023bfe68b65c23 /src/mesa/state_tracker/st_extensions.c | |
parent | e28fe8fe5d05c87a065f8e72adef8b5077da2c73 (diff) |
gallium: remove PIPE_CAP_VERTEX_COLOR_CLAMP_CONTROL
The vertex color clamp control is a property of an API,
a lot like gl_rasterization_rules.
The state should be set according to the API being implemented, for example:
OpenGL Compatibility: enabled by default
OpenGL Core: disabled by default
D3D11: always disabled
This patch also changes the way ARB_color_buffer_float is advertised.
If no SNORM or FLOAT render target is supported, fragment color clamping
is not required.
Diffstat (limited to 'src/mesa/state_tracker/st_extensions.c')
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index ba1a0af0628..e3277904417 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -514,12 +514,34 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.ARB_depth_clamp = GL_TRUE; } - /* this extension does not actually require support of floating point - * render targets, just clamping controls + /* This extension does not actually require support of floating point + * render targets, just clamping controls. + * Advertise this extension if either fragment color clamping is supported + * or no render targets having color values outside of the range [0, 1] + * are supported, in which case the fragment color clamping has no effect + * on rendering. */ - if(screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL) && - screen->get_param(screen, PIPE_CAP_VERTEX_COLOR_CLAMP_CONTROL)) + if (screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL) || + (!screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SNORM, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET) && + !screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_SNORM, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET) && + !screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET) && + !screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FLOAT, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET) && + !screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET) && + !screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET))) { ctx->Extensions.ARB_color_buffer_float = GL_TRUE; + } if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { ctx->Extensions.ARB_shader_stencil_export = GL_TRUE; |