summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dd.h
diff options
context:
space:
mode:
authorRobert Bragg <[email protected]>2015-04-29 08:41:34 +0100
committerRobert Bragg <[email protected]>2017-02-22 14:07:09 +0000
commit0e7464f0a93908cc31d05fb33611f3cd73a7be65 (patch)
treef781e2a8d246f73e2cf971b0770c295a3ebcfc81 /src/mesa/main/dd.h
parentd83a33a9de94212b622053ab341655a3e92cc033 (diff)
mesa: Model INTEL perf query backend after query obj BE
Instead of using the same backend interface as AMD_performance_monitor this defines a dedicated INTEL_performance_query interface that is modelled more on the ARB_query_buffer_object interface (considering the similarity of the extensions) with the addition of vfuncs for initializing and enumerating query and counter info. Compared to the previous backend, some notable differences are: - The backend is free to represent counters using whatever data structures are optimal/convenient since queries and counters are enumerated via an iterator api instead of declaring them using structures directly shared with the frontend. This is also done to help us support the full range of data and semantic types available with INTEL_performance_query which is awkward while using a structure shared with the AMD_performance_monitor backend since neither extension's types are a subset of the other. - The backend must support waiting for a query instead of the frontend simply using glFinish(). - Objects go through 'Active' and 'Ready' states consistent with the query object backend (hopefully making them more familiar). There is no 'Ended' state (which used to show that a query has ended at least once for a given object). There is a new 'Used' state, set when a query is first begun which implies that we are expecting to get results back for the object at some point. There's no equivalent to the 'EverBound' state since the spec doesn't require there to be a limbo state between generating IDs and associating them with an object on query Begin. The INTEL_performance_query and AMD_performance_monitor extensions are now completely orthogonal within Mesa main (though a driver could optionally choose to implement both extensions within a unified backend if that were convenient for the sake of sharing state/code). v2: (Samuel Pitoiset) - init PerfQuery.NumQueries in frontend - s/return_string/output_clipped_string/ - s/backed/backend/ typo - remove redundant *bytesWritten = 0 v3: - Add InitPerfQueryInfo for lazy probing of available queries v4: - Clean up some internal usage of GL typedefs (Ken) Signed-off-by: Robert Bragg <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r--src/mesa/main/dd.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 7ebd084ca31..aba301cf22e 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -780,6 +780,47 @@ struct dd_function_table {
/*@}*/
/**
+ * \name Performance Query objects
+ */
+ /*@{*/
+ unsigned (*InitPerfQueryInfo)(struct gl_context *ctx);
+ void (*GetPerfQueryInfo)(struct gl_context *ctx,
+ unsigned queryIndex,
+ const char **name,
+ GLuint *dataSize,
+ GLuint *numCounters,
+ GLuint *numActive);
+ void (*GetPerfCounterInfo)(struct gl_context *ctx,
+ unsigned queryIndex,
+ unsigned counterIndex,
+ const char **name,
+ const char **desc,
+ GLuint *offset,
+ GLuint *data_size,
+ GLuint *type_enum,
+ GLuint *data_type_enum,
+ GLuint64 *raw_max);
+ struct gl_perf_query_object * (*NewPerfQueryObject)(struct gl_context *ctx,
+ unsigned queryIndex);
+ void (*DeletePerfQuery)(struct gl_context *ctx,
+ struct gl_perf_query_object *obj);
+ GLboolean (*BeginPerfQuery)(struct gl_context *ctx,
+ struct gl_perf_query_object *obj);
+ void (*EndPerfQuery)(struct gl_context *ctx,
+ struct gl_perf_query_object *obj);
+ void (*WaitPerfQuery)(struct gl_context *ctx,
+ struct gl_perf_query_object *obj);
+ GLboolean (*IsPerfQueryReady)(struct gl_context *ctx,
+ struct gl_perf_query_object *obj);
+ void (*GetPerfQueryData)(struct gl_context *ctx,
+ struct gl_perf_query_object *obj,
+ GLsizei dataSize,
+ GLuint *data,
+ GLuint *bytesWritten);
+ /*@}*/
+
+
+ /**
* \name GREMEDY debug/marker functions
*/
/*@{*/