svga: change svga hud defines to enums
authorCharmaine Lee <charmainel@vmware.com>
Tue, 30 Aug 2016 23:40:12 +0000 (16:40 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 17 Sep 2016 16:09:00 +0000 (10:09 -0600)
This will make it easier to add new hud types.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_context.h

index db80061f4251a8294318efb6a2616b2a6f937177..7873e6380b1b867d0edf067303f9efe658a3e2a8 100644 (file)
 
 
 /** Non-GPU queries for gallium HUD */
+enum svga_hud {
 /* per-frame counters */
-#define SVGA_QUERY_NUM_DRAW_CALLS          (PIPE_QUERY_DRIVER_SPECIFIC + 0)
-#define SVGA_QUERY_NUM_FALLBACKS           (PIPE_QUERY_DRIVER_SPECIFIC + 1)
-#define SVGA_QUERY_NUM_FLUSHES             (PIPE_QUERY_DRIVER_SPECIFIC + 2)
-#define SVGA_QUERY_NUM_VALIDATIONS         (PIPE_QUERY_DRIVER_SPECIFIC + 3)
-#define SVGA_QUERY_MAP_BUFFER_TIME         (PIPE_QUERY_DRIVER_SPECIFIC + 4)
-#define SVGA_QUERY_NUM_RESOURCES_MAPPED    (PIPE_QUERY_DRIVER_SPECIFIC + 5)
-#define SVGA_QUERY_NUM_BYTES_UPLOADED      (PIPE_QUERY_DRIVER_SPECIFIC + 6)
-#define SVGA_QUERY_COMMAND_BUFFER_SIZE     (PIPE_QUERY_DRIVER_SPECIFIC + 7)
-#define SVGA_QUERY_FLUSH_TIME              (PIPE_QUERY_DRIVER_SPECIFIC + 8)
-#define SVGA_QUERY_SURFACE_WRITE_FLUSHES   (PIPE_QUERY_DRIVER_SPECIFIC + 9)
-#define SVGA_QUERY_NUM_READBACKS           (PIPE_QUERY_DRIVER_SPECIFIC + 10)
-#define SVGA_QUERY_NUM_RESOURCE_UPDATES    (PIPE_QUERY_DRIVER_SPECIFIC + 11)
-#define SVGA_QUERY_NUM_BUFFER_UPLOADS      (PIPE_QUERY_DRIVER_SPECIFIC + 12)
-#define SVGA_QUERY_NUM_CONST_BUF_UPDATES   (PIPE_QUERY_DRIVER_SPECIFIC + 13)
-#define SVGA_QUERY_NUM_CONST_UPDATES       (PIPE_QUERY_DRIVER_SPECIFIC + 14)
+   SVGA_QUERY_NUM_DRAW_CALLS = PIPE_QUERY_DRIVER_SPECIFIC,
+   SVGA_QUERY_NUM_FALLBACKS,
+   SVGA_QUERY_NUM_FLUSHES,
+   SVGA_QUERY_NUM_VALIDATIONS,
+   SVGA_QUERY_MAP_BUFFER_TIME,
+   SVGA_QUERY_NUM_RESOURCES_MAPPED,
+   SVGA_QUERY_NUM_BYTES_UPLOADED,
+   SVGA_QUERY_COMMAND_BUFFER_SIZE,
+   SVGA_QUERY_FLUSH_TIME,
+   SVGA_QUERY_SURFACE_WRITE_FLUSHES,
+   SVGA_QUERY_NUM_READBACKS,
+   SVGA_QUERY_NUM_RESOURCE_UPDATES,
+   SVGA_QUERY_NUM_BUFFER_UPLOADS,
+   SVGA_QUERY_NUM_CONST_BUF_UPDATES,
+   SVGA_QUERY_NUM_CONST_UPDATES,
 
 /* running total counters */
-#define SVGA_QUERY_MEMORY_USED             (PIPE_QUERY_DRIVER_SPECIFIC + 15)
-#define SVGA_QUERY_NUM_SHADERS             (PIPE_QUERY_DRIVER_SPECIFIC + 16)
-#define SVGA_QUERY_NUM_RESOURCES           (PIPE_QUERY_DRIVER_SPECIFIC + 17)
-#define SVGA_QUERY_NUM_STATE_OBJECTS       (PIPE_QUERY_DRIVER_SPECIFIC + 18)
-#define SVGA_QUERY_NUM_SURFACE_VIEWS       (PIPE_QUERY_DRIVER_SPECIFIC + 19)
-#define SVGA_QUERY_NUM_GENERATE_MIPMAP     (PIPE_QUERY_DRIVER_SPECIFIC + 20)
+   SVGA_QUERY_MEMORY_USED,
+   SVGA_QUERY_NUM_SHADERS,
+   SVGA_QUERY_NUM_RESOURCES,
+   SVGA_QUERY_NUM_STATE_OBJECTS,
+   SVGA_QUERY_NUM_SURFACE_VIEWS,
+   SVGA_QUERY_NUM_GENERATE_MIPMAP,
+
 /*SVGA_QUERY_MAX has to be last because it is size of an array*/
-#define SVGA_QUERY_MAX                     (PIPE_QUERY_DRIVER_SPECIFIC + 21)
+   SVGA_QUERY_MAX
+};
 
 /**
  * Maximum supported number of constant buffers per shader