[Mesa-dev] [PATCH 2/7] i965: Turn the INTEL_FORCE_GS env var into a driconf option.
Kenneth Graunke
kenneth at whitecape.org
Wed Mar 7 14:23:46 PST 2012
On 03/06/2012 02:57 PM, Eric Anholt wrote:
> ---
> src/mesa/drivers/dri/i965/brw_context.c | 1 +
> src/mesa/drivers/dri/i965/brw_context.h | 3 +++
> src/mesa/drivers/dri/i965/brw_gs.c | 3 +--
> src/mesa/drivers/dri/intel/intel_screen.c | 6 +++++-
> 4 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index 65de260..30db5b4 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -313,6 +313,7 @@ brwCreateContext(int api,
> brw_draw_init( brw );
>
> brw->precompile = driQueryOptionb(&intel->optionCache, "shader_precompile");
> + brw->gs.force_enable = driQueryOptionb(&intel->optionCache, "force_gs");
>
> ctx->Const.NativeIntegers = true;
> ctx->Const.UniformBooleanTrue = 1;
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index a16145b..507720d 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -865,6 +865,9 @@ struct brw_context
> struct brw_gs_prog_data *prog_data;
>
> bool prog_active;
> + /** Debug option to always enable a passthrough GS program */
> + bool force_enable;
> +
> /** Offset in the program cache to the CLIP program pre-gen6 */
> uint32_t prog_offset;
> uint32_t state_offset;
> diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
> index bfca169..cbcd31f 100644
> --- a/src/mesa/drivers/dri/i965/brw_gs.c
> +++ b/src/mesa/drivers/dri/i965/brw_gs.c
> @@ -234,8 +234,7 @@ static void populate_key( struct brw_context *brw,
> /* For testing, the environment variable INTEL_FORCE_GS can be used to
> * force a GS program to be used, even if it's not necessary.
> */
> - if (getenv("INTEL_FORCE_GS"))
> - key->need_gs_prog = true;
> + key->need_gs_prog = brw->gs.force_enable;
> }
>
> /* Calculate interpolants for triangle and line rasterization.
> diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
> index 48762d0..39c9fb4 100644
> --- a/src/mesa/drivers/dri/intel/intel_screen.c
> +++ b/src/mesa/drivers/dri/intel/intel_screen.c
> @@ -83,10 +83,14 @@ PUBLIC const char __driConfigOptions[] =
> 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_OPT_BEGIN(force_gs, bool, false)
> + DRI_CONF_DESC(en, "Always use a passthrough GS program on gen4/5.")
> + DRI_CONF_OPT_END
IMHO this patch is not useful. Paul actually added this to force the HW
to always use a passthrough GS program on Gen *6* during his transform
feedback work.
I have no idea if forcing the GS to be enabled -ever- worked on gen4/5.
It also doesn't appear to be used on Gen6.
So, I'd just delete the env. var and not bother making it a driconf option.
> DRI_CONF_SECTION_END
> DRI_CONF_END;
>
> -const GLuint __driNConfigOptions = 13;
> +const GLuint __driNConfigOptions = 14;
>
> #include "intel_batchbuffer.h"
> #include "intel_buffers.h"
More information about the mesa-dev
mailing list