st/mesa: add ST_DEBUG=wf option which enables wireframe rendering
authorMarek Olšák <marek.olsak@amd.com>
Sun, 5 Oct 2014 16:55:47 +0000 (18:55 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 21 Oct 2014 20:01:16 +0000 (22:01 +0200)
Useful for tessellation.

src/mesa/state_tracker/st_atom_rasterizer.c
src/mesa/state_tracker/st_debug.c
src/mesa/state_tracker/st_debug.h

index a2285383e7dec73c0c87010b6575f2dc9a7d7263..dfa728b19ec54548d9ad50d754d7b266253a5a6f 100644 (file)
@@ -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:
        */
index 8c15e18d3975d5819744de549915971e652a36df..de3e3a9cdb293fbae95c56d2f8a38459ed76ffcf 100644 (file)
@@ -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
 };
 
index c1c482524c9afce754134d9385bede78fcfa85b9..49b916fb336ebfee95b5a0bb3bbf8eb033257754 100644 (file)
@@ -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;