freedreno/a3xx: add debug flag to expose glsl130

We are starting to add integer support to the compiler, which does not
get exercised with glsl feature level 120 and without advertising
integer support.  But doing so breaks too many things right now.  So
for now use a debug flag to conditionally expose the functionality
while it is in development.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
Rob Clark 2014-05-14 11:06:21 -04:00
parent ac2a8e3c9d
commit e1896948da
2 changed files with 8 additions and 3 deletions

View File

@ -69,6 +69,7 @@ static const struct debug_named_value debug_options[] = {
{"noopt", FD_DBG_NOOPT , "Disable optimization passes in compiler"}, {"noopt", FD_DBG_NOOPT , "Disable optimization passes in compiler"},
{"optmsgs", FD_DBG_OPTMSGS,"Enable optimizater debug messages"}, {"optmsgs", FD_DBG_OPTMSGS,"Enable optimizater debug messages"},
{"optdump", FD_DBG_OPTDUMP,"Dump shader DAG to .dot files"}, {"optdump", FD_DBG_OPTDUMP,"Dump shader DAG to .dot files"},
{"glsl130", FD_DBG_GLSL130,"Temporary flag to enable GLSL 130 on a3xx+"},
DEBUG_NAMED_VALUE_END DEBUG_NAMED_VALUE_END
}; };
@ -76,6 +77,7 @@ DEBUG_GET_ONCE_FLAGS_OPTION(fd_mesa_debug, "FD_MESA_DEBUG", debug_options, 0)
int fd_mesa_debug = 0; int fd_mesa_debug = 0;
bool fd_binning_enabled = true; bool fd_binning_enabled = true;
static bool glsl130 = false;
static const char * static const char *
fd_screen_get_name(struct pipe_screen *pscreen) fd_screen_get_name(struct pipe_screen *pscreen)
@ -188,7 +190,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 256; return 256;
case PIPE_CAP_GLSL_FEATURE_LEVEL: case PIPE_CAP_GLSL_FEATURE_LEVEL:
return 120; return ((screen->gpu_id >= 300) && glsl130) ? 130 : 120;
/* Unsupported features. */ /* Unsupported features. */
case PIPE_CAP_INDEP_BLEND_ENABLE: case PIPE_CAP_INDEP_BLEND_ENABLE:
@ -243,7 +245,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_QUERY_TIMESTAMP: case PIPE_CAP_QUERY_TIMESTAMP:
return 0; return 0;
case PIPE_CAP_OCCLUSION_QUERY: case PIPE_CAP_OCCLUSION_QUERY:
return (screen->gpu_id >= 300) ? 1: 0; return (screen->gpu_id >= 300) ? 1 : 0;
case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET: case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
case PIPE_CAP_MIN_TEXEL_OFFSET: case PIPE_CAP_MIN_TEXEL_OFFSET:
@ -345,7 +347,7 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
/* we should be able to support this on a3xx, but not /* we should be able to support this on a3xx, but not
* implemented yet: * implemented yet:
*/ */
return 0; return ((screen->gpu_id >= 300) && glsl130) ? 1 : 0;
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS: case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
return 16; return 16;
@ -412,6 +414,8 @@ fd_screen_create(struct fd_device *dev)
if (fd_mesa_debug & FD_DBG_NOBIN) if (fd_mesa_debug & FD_DBG_NOBIN)
fd_binning_enabled = false; fd_binning_enabled = false;
glsl130 = !!(fd_mesa_debug & FD_DBG_GLSL130);
if (!screen) if (!screen)
return NULL; return NULL;

View File

@ -65,6 +65,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
#define FD_DBG_NOOPT 0x0200 #define FD_DBG_NOOPT 0x0200
#define FD_DBG_OPTMSGS 0x0400 #define FD_DBG_OPTMSGS 0x0400
#define FD_DBG_OPTDUMP 0x0800 #define FD_DBG_OPTDUMP 0x0800
#define FD_DBG_GLSL130 0x1000
extern int fd_mesa_debug; extern int fd_mesa_debug;
extern bool fd_binning_enabled; extern bool fd_binning_enabled;