diff options
author | Marek Olšák <[email protected]> | 2014-10-05 18:55:47 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-10-21 22:01:16 +0200 |
commit | e8764a46731aaa20d6c7bc98d227e1a94fafbf5b (patch) | |
tree | 1fbac9fac49149395992f0127d09e5bee232e9bb /src | |
parent | 5f5b83cbba95a7bb8955b09e24df1e9487c10734 (diff) |
st/mesa: add ST_DEBUG=wf option which enables wireframe rendering
Useful for tessellation.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 11 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_debug.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_debug.h | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index a2285383e7d..dfa728b19ec 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -33,6 +33,7 @@ #include "main/macros.h" #include "st_context.h" #include "st_atom.h" +#include "st_debug.h" #include "st_program.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" @@ -119,8 +120,14 @@ static void update_raster_state( struct st_context *st ) /* _NEW_POLYGON */ { - raster->fill_front = translate_fill( ctx->Polygon.FrontMode ); - raster->fill_back = translate_fill( ctx->Polygon.BackMode ); + if (ST_DEBUG & DEBUG_WIREFRAME) { + raster->fill_front = PIPE_POLYGON_MODE_LINE; + raster->fill_back = PIPE_POLYGON_MODE_LINE; + } + else { + raster->fill_front = translate_fill( ctx->Polygon.FrontMode ); + raster->fill_back = translate_fill( ctx->Polygon.BackMode ); + } /* Simplify when culling is active: */ diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index 8c15e18d397..de3e3a9cdb2 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -55,6 +55,7 @@ static const struct debug_named_value st_debug_flags[] = { { "query", DEBUG_QUERY, NULL }, { "draw", DEBUG_DRAW, NULL }, { "buffer", DEBUG_BUFFER, NULL }, + { "wf", DEBUG_WIREFRAME, NULL }, DEBUG_NAMED_VALUE_END }; diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h index c1c482524c9..49b916fb336 100644 --- a/src/mesa/state_tracker/st_debug.h +++ b/src/mesa/state_tracker/st_debug.h @@ -46,6 +46,7 @@ st_print_current(void); #define DEBUG_SCREEN 0x80 #define DEBUG_DRAW 0x100 #define DEBUG_BUFFER 0x200 +#define DEBUG_WIREFRAME 0x400 #ifdef DEBUG extern int ST_DEBUG; |