[Mesa-dev] [PATCH 08/15] svga: implement pipe_screen::get_driver_query_group_info v4
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Jul 11 11:23:05 PDT 2014
This enables GL_AMD_performance_monitor for svga.
V2:
- s/pipe_context/pipe_screen in the commit msg
V3:
- use util_get_driver_query_group_info
V4:
- add SVGA_QUERY_COUNT in svga_context.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/gallium/drivers/svga/svga_context.h | 1 +
src/gallium/drivers/svga/svga_screen.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index a75f2a8..67f1816 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -45,6 +45,7 @@
/** Non-GPU queries for gallium HUD */
+#define SVGA_QUERY_COUNT 3
#define SVGA_QUERY_DRAW_CALLS (PIPE_QUERY_DRIVER_SPECIFIC + 0)
#define SVGA_QUERY_FALLBACKS (PIPE_QUERY_DRIVER_SPECIFIC + 1)
#define SVGA_QUERY_MEMORY_USED (PIPE_QUERY_DRIVER_SPECIFIC + 2)
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index f34664d..2e2f2bf 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -28,6 +28,7 @@
#include "util/u_inlines.h"
#include "util/u_string.h"
#include "util/u_math.h"
+#include "util/u_query.h"
#include "svga_winsys.h"
#include "svga_public.h"
@@ -555,6 +556,15 @@ svga_get_driver_query_info(struct pipe_screen *screen,
}
+static int
+svga_get_driver_query_group_info(struct pipe_screen *screen,
+ unsigned index,
+ struct pipe_driver_query_group_info *info)
+{
+ return util_get_driver_query_group_info(index, SVGA_QUERY_COUNT, info);
+}
+
+
static void
svga_destroy_screen( struct pipe_screen *screen )
{
@@ -615,6 +625,7 @@ svga_screen_create(struct svga_winsys_screen *sws)
screen->fence_signalled = svga_fence_signalled;
screen->fence_finish = svga_fence_finish;
screen->get_driver_query_info = svga_get_driver_query_info;
+ screen->get_driver_query_group_info = svga_get_driver_query_group_info;
svgascreen->sws = sws;
svga_init_screen_resource_functions(svgascreen);
--
2.0.0
More information about the mesa-dev
mailing list