From: Rob Clark Date: Sun, 8 Mar 2015 17:38:51 +0000 (-0400) Subject: freedreno: replace glsl130 debug flag with glsl120 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd17db6fe51da8878472582329553cbae663f1db;p=mesa.git freedreno: replace glsl130 debug flag with glsl120 Now that relative-dst works, we should never fall back to the old compiler. (Which is almost true, other than a couple edge case sched fails in piglit). So replace glsl130 flag to force GLSL 130 and integers on a3xx/a4xx with a glsl120 flag to force GLSL 120 and !integers. If this commit breaks any game/app/etc use FD_MESA_DEBUG=glsl120 as a workaround and please let me know. Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 3e9a3f3b2f9..31f596c260f 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -70,7 +70,7 @@ static const struct debug_named_value debug_options[] = { {"noopt", FD_DBG_NOOPT , "Disable optimization passes in compiler"}, {"optmsgs", FD_DBG_OPTMSGS,"Enable optimizater debug messages"}, {"optdump", FD_DBG_OPTDUMP,"Dump shader DAG to .dot files"}, - {"glsl130", FD_DBG_GLSL130,"Temporary flag to enable GLSL 130 on a3xx+"}, + {"glsl120", FD_DBG_GLSL120,"Temporary flag to force GLSL 120 (rather than 130) on a3xx+"}, {"nocp", FD_DBG_NOCP, "Disable copy-propagation"}, DEBUG_NAMED_VALUE_END }; @@ -79,7 +79,7 @@ DEBUG_GET_ONCE_FLAGS_OPTION(fd_mesa_debug, "FD_MESA_DEBUG", debug_options, 0) int fd_mesa_debug = 0; bool fd_binning_enabled = true; -static bool glsl130 = false; +static bool glsl120 = false; static const char * fd_screen_get_name(struct pipe_screen *pscreen) @@ -177,7 +177,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) return 256; case PIPE_CAP_GLSL_FEATURE_LEVEL: - return ((is_a3xx(screen) || is_a4xx(screen)) && glsl130) ? 130 : 120; + if (glsl120) + return 120; + return (is_a3xx(screen) || is_a4xx(screen)) ? 130 : 120; /* Unsupported features. */ case PIPE_CAP_INDEP_BLEND_ENABLE: @@ -366,13 +368,9 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED: return 1; case PIPE_SHADER_CAP_INTEGERS: - /* we should be able to support this on a3xx, but not - * implemented yet: - * - * TODO looks like a4xx will require some additional - * work for integer varying fetch.. - */ - return ((is_a3xx(screen) || is_a4xx(screen)) && glsl130) ? 1 : 0; + if (glsl120) + return 0; + return (is_a3xx(screen) || is_a4xx(screen)) ? 1 : 0; case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS: return 16; @@ -445,7 +443,7 @@ fd_screen_create(struct fd_device *dev) if (fd_mesa_debug & FD_DBG_NOBIN) fd_binning_enabled = false; - glsl130 = !!(fd_mesa_debug & FD_DBG_GLSL130); + glsl120 = !!(fd_mesa_debug & FD_DBG_GLSL120); if (!screen) return NULL; diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index 929715c2911..f9c959e0822 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -65,7 +65,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op); #define FD_DBG_NOOPT 0x0200 #define FD_DBG_OPTMSGS 0x0400 #define FD_DBG_OPTDUMP 0x0800 -#define FD_DBG_GLSL130 0x1000 +#define FD_DBG_GLSL120 0x1000 #define FD_DBG_NOCP 0x2000 extern int fd_mesa_debug;