ctx->Const.UniformBooleanTrue = 1;
ctx->Const.UniformBufferOffsetAlignment = 16;
- ctx->Const.ForceGLSLExtensionsWarn =
- driQueryOptionb(&brw->optionCache, "force_glsl_extensions_warn");
-
- ctx->Const.DisableGLSLLineContinuations =
- driQueryOptionb(&brw->optionCache, "disable_glsl_line_continuations");
-
if (brw->gen >= 6) {
ctx->Const.MaxVarying = 32;
ctx->Const.VertexProgram.MaxOutputComponents = 128;
ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4 = true;
}
+/**
+ * Process driconf (drirc) options, setting appropriate context flags.
+ *
+ * intelInitExtensions still pokes at optionCache directly, in order to
+ * avoid advertising various extensions. No flags are set, so it makes
+ * sense to continue doing that there.
+ */
+static void
+brw_process_driconf_options(struct brw_context *brw)
+{
+ struct gl_context *ctx = &brw->ctx;
+
+ driOptionCache *options = &brw->optionCache;
+ driParseConfigFiles(options, &brw->intelScreen->optionCache,
+ brw->driContext->driScreenPriv->myNum, "i965");
+
+ int bo_reuse_mode = driQueryOptioni(options, "bo_reuse");
+ switch (bo_reuse_mode) {
+ case DRI_CONF_BO_REUSE_DISABLED:
+ break;
+ case DRI_CONF_BO_REUSE_ALL:
+ intel_bufmgr_gem_enable_reuse(brw->bufmgr);
+ break;
+ }
+
+ if (!driQueryOptionb(options, "hiz")) {
+ brw->has_hiz = false;
+ /* On gen6, you can only do separate stencil with HIZ. */
+ if (brw->gen == 6)
+ brw->has_separate_stencil = false;
+ }
+
+ if (driQueryOptionb(options, "always_flush_batch")) {
+ fprintf(stderr, "flushing batchbuffer before/after each draw call\n");
+ brw->always_flush_batch = true;
+ }
+
+ if (driQueryOptionb(options, "always_flush_cache")) {
+ fprintf(stderr, "flushing GPU caches before/after each draw call\n");
+ brw->always_flush_cache = true;
+ }
+
+ if (driQueryOptionb(options, "disable_throttling")) {
+ fprintf(stderr, "disabling flush throttling\n");
+ brw->disable_throttling = true;
+ }
+
+ brw->disable_derivative_optimization =
+ driQueryOptionb(&brw->optionCache, "disable_derivative_optimization");
+
+ brw->precompile = driQueryOptionb(&brw->optionCache, "shader_precompile");
+
+ ctx->Const.ForceGLSLExtensionsWarn =
+ driQueryOptionb(options, "force_glsl_extensions_warn");
+
+ ctx->Const.DisableGLSLLineContinuations =
+ driQueryOptionb(options, "disable_glsl_line_continuations");
+}
+
bool
brwCreateContext(gl_api api,
const struct gl_config *mesaVis,
return false;
}
+ brw_process_driconf_options(brw);
+
if (!intelInitContext( brw, api, major_version, minor_version,
mesaVis, driContextPriv,
sharedContextPrivate, &functions,
brw_draw_init( brw );
- brw->precompile = driQueryOptionb(&brw->optionCache, "shader_precompile");
- brw->disable_derivative_optimization =
- driQueryOptionb(&brw->optionCache, "disable_derivative_optimization");
-
if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) {
/* Turn on some extra GL_ARB_debug_output generation. */
brw->perf_debug = true;
unsigned *dri_ctx_error)
{
struct gl_context *ctx = &brw->ctx;
- __DRIscreen *sPriv = driContextPriv->driScreenPriv;
- struct intel_screen *intelScreen = sPriv->driverPrivate;
- int bo_reuse_mode;
/* GLX uses DRI2 invalidate events to handle window resizing.
* Unfortunately, EGL does not - libEGL is written in XCB (not Xlib),
memset(&ctx->TextureFormatSupported,
0, sizeof(ctx->TextureFormatSupported));
- driParseConfigFiles(&brw->optionCache, &intelScreen->optionCache,
- sPriv->myNum, "i965");
-
/* Estimate the size of the mappable aperture into the GTT. There's an
* ioctl to get the whole GTT size, but not one to get the mappable subset.
* It turns out it's basically always 256MB, though some ancient hardware
*/
brw->max_gtt_map_object_size = gtt_size / 4;
- bo_reuse_mode = driQueryOptioni(&brw->optionCache, "bo_reuse");
- switch (bo_reuse_mode) {
- case DRI_CONF_BO_REUSE_DISABLED:
- break;
- case DRI_CONF_BO_REUSE_ALL:
- intel_bufmgr_gem_enable_reuse(brw->bufmgr);
- break;
- }
-
/* Initialize the software rasterizer and helper modules.
*
* As of GL 3.1 core, the gen4+ driver doesn't need the swrast context for
intel_fbo_init(brw);
- if (!driQueryOptionb(&brw->optionCache, "hiz")) {
- brw->has_hiz = false;
- /* On gen6, you can only do separate stencil with HIZ. */
- if (brw->gen == 6)
- brw->has_separate_stencil = false;
- }
-
- if (driQueryOptionb(&brw->optionCache, "always_flush_batch")) {
- fprintf(stderr, "flushing batchbuffer before/after each draw call\n");
- brw->always_flush_batch = 1;
- }
-
- if (driQueryOptionb(&brw->optionCache, "always_flush_cache")) {
- fprintf(stderr, "flushing GPU caches before/after each draw call\n");
- brw->always_flush_cache = 1;
- }
-
- if (driQueryOptionb(&brw->optionCache, "disable_throttling")) {
- fprintf(stderr, "disabling flush throttling\n");
- brw->disable_throttling = 1;
- }
-
return true;
}