diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_extensions.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_extensions.c | 68 |
1 files changed, 24 insertions, 44 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 49c874710..49709d342 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -387,19 +387,14 @@ void st_init_extensions(struct st_context *st) */ if (screen->is_format_supported(screen, PIPE_FORMAT_S8_UINT_Z24_UNORM, PIPE_TEXTURE_2D, 0, - PIPE_BIND_DEPTH_STENCIL) && - screen->is_format_supported(screen, PIPE_FORMAT_S8_UINT_Z24_UNORM, + PIPE_BIND_DEPTH_STENCIL | + PIPE_BIND_SAMPLER_VIEW) || + screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_UINT, PIPE_TEXTURE_2D, 0, + PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_SAMPLER_VIEW)) { ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; - } - else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_UINT, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_DEPTH_STENCIL) && - screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_UINT, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW)) { - ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; + ctx->Extensions.ARB_framebuffer_object = GL_TRUE; } /* float support - assume nothing exclusively supports 64-bit floats */ @@ -430,7 +425,6 @@ void st_init_extensions(struct st_context *st) PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET)) { ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE; - ctx->Const.sRGBCapable = GL_TRUE; } } @@ -441,7 +435,16 @@ void st_init_extensions(struct st_context *st) } /* s3tc support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, + if (screen->is_format_supported(screen, PIPE_FORMAT_DXT1_RGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW) && + screen->is_format_supported(screen, PIPE_FORMAT_DXT1_RGBA, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW) && + screen->is_format_supported(screen, PIPE_FORMAT_DXT3_RGBA, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW) && + screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW) && (ctx->Mesa_DXTn || st_get_s3tc_override())) { @@ -516,12 +519,6 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.MESA_texture_array = GL_TRUE; } - /* GL_ARB_framebuffer_object */ - if (ctx->Extensions.EXT_packed_depth_stencil) { - /* we support always support GL_EXT_framebuffer_blit */ - ctx->Extensions.ARB_framebuffer_object = GL_TRUE; - } - if (screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER)) { ctx->Extensions.NV_conditional_render = GL_TRUE; } @@ -607,33 +604,16 @@ 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. - * 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->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))) { + if (screen->get_param(screen, PIPE_CAP_VERTEX_COLOR_UNCLAMPED)) { ctx->Extensions.ARB_color_buffer_float = GL_TRUE; + + if (!screen->get_param(screen, PIPE_CAP_VERTEX_COLOR_CLAMPED)) { + st->clamp_vert_color_in_shader = TRUE; + } + + if (!screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMPED)) { + st->clamp_frag_color_in_shader = TRUE; + } } if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { |