Softpipe driver environment variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-``SOFTPIPE_DUMP_FS``
- if set, the softpipe driver will print fragment shaders to stderr
-``SOFTPIPE_DUMP_GS``
- if set, the softpipe driver will print geometry shaders to stderr
-``SOFTPIPE_NO_RAST``
- if set, rasterization is no-op'd. For profiling purposes.
-``SOFTPIPE_USE_LLVM``
- if set, the softpipe driver will try to use LLVM JIT for vertex
- shading processing.
+``SOFTPIPE_DEBUG``
+ a comma-separated list of named flags, which do various things:
+
+ ``vs``
+ Dump vertex shader assembly to stderr
+ ``fs``
+ Dump fragment shader assembly to stderr
+ ``gs``
+ Dump geometry shader assembly to stderr
+ ``cs``
+ Dump compute shader assembly to stderr
+ ``no_rast``
+ rasterization is no-op'd. For profiling purposes.
+ ``use_llvm``
+ the softpipe driver will try to use LLVM JIT for vertex
+ shading processing.
LLVMpipe driver environment variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "util/u_surface.h"
#include "sp_clear.h"
#include "sp_context.h"
+#include "sp_screen.h"
#include "sp_query.h"
#include "sp_tile_cache.h"
uint64_t cv;
uint i;
- if (softpipe->no_rast)
+ if (unlikely(sp_debug & SP_DBG_NO_RAST))
return;
if (!softpipe_check_render_cond(softpipe))
softpipe->tgsi.buffer[i] = sp_create_tgsi_buffer();
}
- softpipe->dump_fs = debug_get_bool_option( "SOFTPIPE_DUMP_FS", false );
- softpipe->dump_gs = debug_get_bool_option( "SOFTPIPE_DUMP_GS", false );
- softpipe->dump_cs = debug_get_bool_option( "SOFTPIPE_DUMP_CS", false );
-
softpipe->pipe.screen = screen;
softpipe->pipe.destroy = softpipe_destroy;
softpipe->pipe.priv = priv;
(struct tgsi_buffer *)
softpipe->tgsi.buffer[PIPE_SHADER_GEOMETRY]);
- if (debug_get_bool_option( "SOFTPIPE_NO_RAST", false ))
- softpipe->no_rast = TRUE;
-
softpipe->vbuf_backend = sp_create_vbuf_backend(softpipe);
if (!softpipe->vbuf_backend)
goto fail;
* of sp_sampler_view?
*/
struct softpipe_tex_tile_cache *tex_cache[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
-
- unsigned dump_fs : 1;
- unsigned dump_gs : 1;
- unsigned dump_cs : 1;
- unsigned no_rast : 1;
};
#include "sp_fence.h"
#include "sp_public.h"
-DEBUG_GET_ONCE_BOOL_OPTION(use_llvm, "SOFTPIPE_USE_LLVM", FALSE)
+static const struct debug_named_value sp_debug_options[] = {
+ {"vs", SP_DBG_VS, "dump vertex shader assembly to stderr"},
+ {"gs", SP_DBG_GS, "dump geometry shader assembly to stderr"},
+ {"fs", SP_DBG_FS, "dump fragment shader assembly to stderr"},
+ {"cs", SP_DBG_CS, "dump compute shader assembly to stderr"},
+ {"no_rast", SP_DBG_NO_RAST, "no-ops rasterization, for profiling purposes"},
+ {"use_llvm", SP_DBG_USE_LLVM, "Use LLVM if available for shaders"},
+};
+
+int sp_debug;
+DEBUG_GET_ONCE_FLAGS_OPTION(sp_debug, "SOFTPIPE_DEBUG", sp_debug_options, 0)
static const char *
softpipe_get_vendor(struct pipe_screen *screen)
if (!screen)
return NULL;
+ sp_debug = debug_get_option_sp_debug();
+
screen->winsys = winsys;
screen->base.destroy = softpipe_destroy_screen;
screen->base.context_create = softpipe_create_context;
screen->base.flush_frontbuffer = softpipe_flush_frontbuffer;
screen->base.get_compute_param = softpipe_get_compute_param;
- screen->use_llvm = debug_get_option_use_llvm();
+ screen->use_llvm = sp_debug & SP_DBG_USE_LLVM;
softpipe_init_screen_texture_funcs(&screen->base);
softpipe_init_screen_fence_funcs(&screen->base);
return (struct softpipe_screen *)pipe;
}
+enum sp_debug_flag {
+ SP_DBG_VS = BITFIELD_BIT(0),
+ /* SP_DBG_TCS = BITFIELD_BIT(1), */
+ /* SP_DBG_TES = BITFIELD_BIT(2), */
+ SP_DBG_GS = BITFIELD_BIT(3),
+ SP_DBG_FS = BITFIELD_BIT(4),
+ SP_DBG_CS = BITFIELD_BIT(5),
+ SP_DBG_USE_LLVM = BITFIELD_BIT(6),
+ SP_DBG_NO_RAST = BITFIELD_BIT(7),
+};
+extern int sp_debug;
#endif /* SP_SCREEN_H */
*/
#include "sp_context.h"
+#include "sp_screen.h"
#include "sp_quad.h"
#include "sp_quad_pipe.h"
#include "sp_setup.h"
print_vertex(setup, v2);
#endif
- if (setup->softpipe->no_rast || setup->softpipe->rasterizer->rasterizer_discard)
+ if (unlikely(sp_debug & SP_DBG_NO_RAST) ||
+ setup->softpipe->rasterizer->rasterizer_discard)
return;
det = calc_det(v0, v1, v2);
print_vertex(setup, v1);
#endif
- if (setup->softpipe->no_rast || setup->softpipe->rasterizer->rasterizer_discard)
+ if (unlikely(sp_debug & SP_DBG_NO_RAST) ||
+ setup->softpipe->rasterizer->rasterizer_discard)
return;
if (dx == 0 && dy == 0)
assert(sinfo->valid);
- if (setup->softpipe->no_rast || setup->softpipe->rasterizer->rasterizer_discard)
+ if (unlikely(sp_debug & SP_DBG_NO_RAST) ||
+ setup->softpipe->rasterizer->rasterizer_discard)
return;
assert(setup->softpipe->reduced_prim == PIPE_PRIM_POINTS);
**************************************************************************/
#include "sp_context.h"
+#include "sp_screen.h"
#include "sp_state.h"
#include "sp_fs.h"
#include "sp_texture.h"
struct softpipe_context *softpipe = softpipe_context(pipe);
struct sp_fragment_shader *state = CALLOC_STRUCT(sp_fragment_shader);
- softpipe_create_shader_state(&state->shader, templ, softpipe->dump_fs);
+ softpipe_create_shader_state(&state->shader, templ, sp_debug & SP_DBG_FS);
/* draw's fs state */
state->draw_shader = draw_create_fragment_shader(softpipe->draw,
if (!state)
goto fail;
- softpipe_create_shader_state(&state->shader, templ, false);
+ softpipe_create_shader_state(&state->shader, templ, sp_debug & SP_DBG_VS);
if (!state->shader.tokens)
goto fail;
if (!state)
goto fail;
- softpipe_create_shader_state(&state->shader, templ, softpipe->dump_gs);
+ softpipe_create_shader_state(&state->shader, templ, sp_debug & SP_DBG_GS);
if (templ->tokens) {
state->draw_data = draw_create_geometry_shader(softpipe->draw, templ);
softpipe_create_compute_state(struct pipe_context *pipe,
const struct pipe_compute_state *templ)
{
- struct softpipe_context *softpipe = softpipe_context(pipe);
const struct tgsi_token *tokens;
struct sp_compute_shader *state;
if (templ->ir_type != PIPE_SHADER_IR_TGSI)
tokens = templ->prog;
/* debug */
- if (softpipe->dump_cs)
+ if (sp_debug & SP_DBG_CS)
tgsi_dump(tokens, 0);
state = CALLOC_STRUCT(sp_compute_shader);