summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-08-03 13:58:20 +0200
committerMarek Olšák <[email protected]>2014-08-11 21:53:57 +0200
commitfceadfe7ef01637daf17624e2d7f961d85625845 (patch)
tree79020ee4e125f18dfb5aff863dc7648cf95e94eb /src/gallium/state_trackers/dri
parentf1f53666290fb1718fff439145f6e337c9efbb90 (diff)
gallium: pass st_config_options to query_versions
So move it from dri_context to dri_screen. This will be needed for version computations. Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/dri_context.c22
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c26
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.h2
3 files changed, 27 insertions, 23 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 827f847ea07..fe3240ae1fa 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -39,26 +39,6 @@
#include "pipe/p_context.h"
#include "state_tracker/st_context.h"
-static void
-dri_fill_st_options(struct st_config_options *options,
- const struct driOptionCache * optionCache)
-{
- options->disable_blend_func_extended =
- driQueryOptionb(optionCache, "disable_blend_func_extended");
- options->disable_glsl_line_continuations =
- driQueryOptionb(optionCache, "disable_glsl_line_continuations");
- options->disable_shader_bit_encoding =
- driQueryOptionb(optionCache, "disable_shader_bit_encoding");
- options->force_glsl_extensions_warn =
- driQueryOptionb(optionCache, "force_glsl_extensions_warn");
- options->force_glsl_version =
- driQueryOptioni(optionCache, "force_glsl_version");
- options->force_s3tc_enable =
- driQueryOptionb(optionCache, "force_s3tc_enable");
- options->allow_glsl_extension_directive_midshader =
- driQueryOptionb(optionCache, "allow_glsl_extension_directive_midshader");
-}
-
GLboolean
dri_create_context(gl_api api, const struct gl_config * visual,
__DRIcontext * cPriv,
@@ -127,7 +107,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
ctx->cPriv = cPriv;
ctx->sPriv = sPriv;
- dri_fill_st_options(&attribs.options, &screen->optionCache);
+ attribs.options = screen->options;
dri_fill_st_visual(&attribs.visual, screen, visual);
ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
st_share);
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 697ebee0fb1..fdcedcba555 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -80,6 +80,26 @@ const __DRIconfigOptionsExtension gallium_config_options = {
#define false 0
+static void
+dri_fill_st_options(struct st_config_options *options,
+ const struct driOptionCache * optionCache)
+{
+ options->disable_blend_func_extended =
+ driQueryOptionb(optionCache, "disable_blend_func_extended");
+ options->disable_glsl_line_continuations =
+ driQueryOptionb(optionCache, "disable_glsl_line_continuations");
+ options->disable_shader_bit_encoding =
+ driQueryOptionb(optionCache, "disable_shader_bit_encoding");
+ options->force_glsl_extensions_warn =
+ driQueryOptionb(optionCache, "force_glsl_extensions_warn");
+ options->force_glsl_version =
+ driQueryOptioni(optionCache, "force_glsl_version");
+ options->force_s3tc_enable =
+ driQueryOptionb(optionCache, "force_s3tc_enable");
+ options->allow_glsl_extension_directive_midshader =
+ driQueryOptionb(optionCache, "allow_glsl_extension_directive_midshader");
+}
+
static const __DRIconfig **
dri_fill_in_modes(struct dri_screen *screen)
{
@@ -439,9 +459,10 @@ dri_init_screen_helper(struct dri_screen *screen,
screen->sPriv->myNum,
driver_name);
+ dri_fill_st_options(&screen->options, &screen->optionCache);
+
/* Handle force_s3tc_enable. */
- if (!util_format_s3tc_enabled &&
- driQueryOptionb(&screen->optionCache, "force_s3tc_enable")) {
+ if (!util_format_s3tc_enabled && screen->options.force_s3tc_enable) {
/* Ensure libtxc_dxtn has been loaded if available.
* Forcing S3TC on before calling this would prevent loading
* the library.
@@ -456,6 +477,7 @@ dri_init_screen_helper(struct dri_screen *screen,
dri_postprocessing_init(screen);
screen->st_api->query_versions(screen->st_api, &screen->base,
+ &screen->options,
&screen->sPriv->max_gl_core_version,
&screen->sPriv->max_gl_compat_version,
&screen->sPriv->max_gl_es1_version,
diff --git a/src/gallium/state_trackers/dri/dri_screen.h b/src/gallium/state_trackers/dri/dri_screen.h
index 07c989807f3..e4a1a39aa21 100644
--- a/src/gallium/state_trackers/dri/dri_screen.h
+++ b/src/gallium/state_trackers/dri/dri_screen.h
@@ -65,6 +65,8 @@ struct dri_screen
/** The screen's effective configuration options */
driOptionCache optionCache;
+ struct st_config_options options;
+
/* Which postprocessing filters are enabled. */
unsigned pp_enabled[PP_FILTERS];