summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-11-23 10:01:39 -0800
committerEric Anholt <eric@anholt.net>2011-11-30 11:22:53 -0800
commitc6abde211fa875f90e59e3709720cfe394669069 (patch)
treee8f1178e86fb9524d544d3f79ede33c2713adaf8
parent0a22fb6a5d519ca26d423fa4a9404697dca56cbf (diff)
i965: Don't perform the precompile on fragment shaders by default.
It is useful to have this option for shader-db, and it was also good at the time where we were rejecting shaders due to various internal limits we hadn't supported yet. However, at this point the precompile step takes extra time (since not all NOS is known at link time) and spews misleading debug in the common case of debugging a real app. This is left in place for VS, where we still have a couple of codegen failure paths that result in link failure through precompile. Those need to be fixed. shader-db can still get at the debug info it wants using "shader_precompile=true" driconf option. Long term, we can probably build a good-enough app for shader-db to trigger real codegen.
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c1
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp4
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c6
4 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 5dcf8dd443..1163007551 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -327,6 +327,7 @@ brwCreateContext(int api,
brw_draw_init( brw );
brw->new_vs_backend = (getenv("INTEL_OLD_VS") == NULL);
+ brw->precompile = driQueryOptionb(&intel->optionCache, "shader_precompile");
/* If we're using the new shader backend, we require integer uniforms
* stored as actual integers.
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 87675e9837..171f3eff8a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -604,6 +604,7 @@ struct brw_context
bool has_aa_line_parameters;
bool has_pln;
bool new_vs_backend;
+ bool precompile;
struct {
struct brw_state_flags dirty;
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index f25fab30a0..33c9ae57ac 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -65,7 +65,9 @@ brw_new_shader_program(struct gl_context *ctx, GLuint name)
bool
brw_shader_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
{
- if (!brw_fs_precompile(ctx, prog))
+ struct brw_context *brw = brw_context(ctx);
+
+ if (brw->precompile && !brw_fs_precompile(ctx, prog))
return false;
if (!brw_vs_precompile(ctx, prog))
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 46b822cb31..f67bef9556 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -76,10 +76,14 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(shader_precompile, bool, false)
+ DRI_CONF_DESC(en, "Perform code generation at shader link time.")
+ DRI_CONF_OPT_END
DRI_CONF_SECTION_END
DRI_CONF_END;
-const GLuint __driNConfigOptions = 11;
+const GLuint __driNConfigOptions = 12;
#include "intel_batchbuffer.h"
#include "intel_buffers.h"