summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorCharmaine Lee <charmainel@vmware.com>2015-12-21 11:07:08 -0800
committerBrian Paul <brianp@vmware.com>2016-01-14 10:39:53 -0700
commit78e628ae43015a2a8b6a1d7339eb7eb63ab56848 (patch)
treeb43fa1ccf3f4ef3eb0114e597b99f3ac4a2e2614 /src/gallium/drivers/svga
parent3038e8984df2be35a7164043ec6d385e32e26238 (diff)
downloadexternal_mesa3d-78e628ae43015a2a8b6a1d7339eb7eb63ab56848.zip
external_mesa3d-78e628ae43015a2a8b6a1d7339eb7eb63ab56848.tar.gz
external_mesa3d-78e628ae43015a2a8b6a1d7339eb7eb63ab56848.tar.bz2
svga: add num-generate-mipmap HUD query
The actual increment of the num-generate-mipmap counter will be done in a subsequent patch when hw generate mipmap is supported. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_context.h4
-rw-r--r--src/gallium/drivers/svga/svga_pipe_query.c7
-rw-r--r--src/gallium/drivers/svga/svga_screen.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index e4f29b8..f1a2041 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -59,8 +59,9 @@
#define SVGA_QUERY_NUM_RESOURCES (PIPE_QUERY_DRIVER_SPECIFIC + 9)
#define SVGA_QUERY_NUM_STATE_OBJECTS (PIPE_QUERY_DRIVER_SPECIFIC + 10)
#define SVGA_QUERY_NUM_SURFACE_VIEWS (PIPE_QUERY_DRIVER_SPECIFIC + 11)
+#define SVGA_QUERY_NUM_GENERATE_MIPMAP (PIPE_QUERY_DRIVER_SPECIFIC + 12)
/*SVGA_QUERY_MAX has to be last because it is size of an array*/
-#define SVGA_QUERY_MAX (PIPE_QUERY_DRIVER_SPECIFIC + 12)
+#define SVGA_QUERY_MAX (PIPE_QUERY_DRIVER_SPECIFIC + 13)
/**
* Maximum supported number of constant buffers per shader
@@ -505,6 +506,7 @@ struct svga_context
uint64_t num_state_objects; /**< SVGA_QUERY_NUM_STATE_OBJECTS */
uint64_t num_surface_views; /**< SVGA_QUERY_NUM_SURFACE_VIEWS */
uint64_t num_bytes_uploaded; /**< SVGA_QUERY_NUM_BYTES_UPLOADED */
+ uint64_t num_generate_mipmap; /**< SVGA_QUERY_NUM_GENERATE_MIPMAP */
} hud;
/** The currently bound stream output targets */
diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c
index b67d56c..255494a 100644
--- a/src/gallium/drivers/svga/svga_pipe_query.c
+++ b/src/gallium/drivers/svga/svga_pipe_query.c
@@ -732,6 +732,7 @@ svga_create_query(struct pipe_context *pipe,
case SVGA_QUERY_NUM_SURFACE_VIEWS:
case SVGA_QUERY_NUM_RESOURCES_MAPPED:
case SVGA_QUERY_NUM_BYTES_UPLOADED:
+ case SVGA_QUERY_NUM_GENERATE_MIPMAP:
break;
default:
assert(!"unexpected query type in svga_create_query()");
@@ -800,6 +801,7 @@ svga_destroy_query(struct pipe_context *pipe, struct pipe_query *q)
case SVGA_QUERY_NUM_SURFACE_VIEWS:
case SVGA_QUERY_NUM_RESOURCES_MAPPED:
case SVGA_QUERY_NUM_BYTES_UPLOADED:
+ case SVGA_QUERY_NUM_GENERATE_MIPMAP:
/* nothing */
break;
default:
@@ -887,6 +889,7 @@ svga_begin_query(struct pipe_context *pipe, struct pipe_query *q)
case SVGA_QUERY_NUM_RESOURCES:
case SVGA_QUERY_NUM_STATE_OBJECTS:
case SVGA_QUERY_NUM_SURFACE_VIEWS:
+ case SVGA_QUERY_NUM_GENERATE_MIPMAP:
/* nothing */
break;
default:
@@ -980,6 +983,7 @@ svga_end_query(struct pipe_context *pipe, struct pipe_query *q)
case SVGA_QUERY_NUM_RESOURCES:
case SVGA_QUERY_NUM_STATE_OBJECTS:
case SVGA_QUERY_NUM_SURFACE_VIEWS:
+ case SVGA_QUERY_NUM_GENERATE_MIPMAP:
/* nothing */
break;
default:
@@ -1090,6 +1094,9 @@ svga_get_query_result(struct pipe_context *pipe,
case SVGA_QUERY_NUM_SURFACE_VIEWS:
vresult->u64 = svga->hud.num_surface_views;
break;
+ case SVGA_QUERY_NUM_GENERATE_MIPMAP:
+ vresult->u64 = svga->hud.num_generate_mipmap;
+ break;
default:
assert(!"unexpected query type in svga_get_query_result");
}
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 0528d8d..1ff3143 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -823,6 +823,8 @@ svga_get_driver_query_info(struct pipe_screen *screen,
PIPE_DRIVER_QUERY_TYPE_UINT64),
QUERY("num-surface-views", SVGA_QUERY_NUM_SURFACE_VIEWS,
PIPE_DRIVER_QUERY_TYPE_UINT64),
+ QUERY("num-generate-mipmap", SVGA_QUERY_NUM_GENERATE_MIPMAP,
+ PIPE_DRIVER_QUERY_TYPE_UINT64),
};
#undef QUERY