Mesa (master): gallium: add a cond rendering hook for vulkan.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 27 01:28:57 UTC 2021
Module: Mesa
Branch: master
Commit: 86328fc7b700f6e93d2f569fbfffc992954f855f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=86328fc7b700f6e93d2f569fbfffc992954f855f
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Dec 4 17:27:16 2020 +1000
gallium: add a cond rendering hook for vulkan.
The vulkan cond rendering hook is quite different than the
traditional gallium one so add a new interface for it.
This just conditionalises rendering on the memory location.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8182>
---
docs/gallium/context.rst | 3 +++
src/gallium/include/pipe/p_context.h | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/docs/gallium/context.rst b/docs/gallium/context.rst
index 3503f02c8d5..6c0752b57cd 100644
--- a/docs/gallium/context.rst
+++ b/docs/gallium/context.rst
@@ -563,6 +563,9 @@ Normally, if the occlusion query returned a non-zero result subsequent
drawing happens normally so fragments may be generated, shaded and
processed even where they're known to be obscured.
+The ''render_condition_mem'' function specifies the drawing is dependant
+on a value in memory. A buffer resource and offset denote which 32-bit
+value to use for the query. This is used for Vulkan API.
Flushing
^^^^^^^^
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 7707eb6f2b6..99aeea21d7e 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -153,6 +153,16 @@ struct pipe_context {
bool condition,
enum pipe_render_cond_flag mode );
+ /**
+ * Predicate subsequent rendering on a value in a buffer
+ * \param buffer The buffer to query for the value
+ * \param offset Offset in the buffer to query 32-bit
+ * \param condition whether to skip on FALSE or TRUE query results
+ */
+ void (*render_condition_mem)( struct pipe_context *pipe,
+ struct pipe_resource *buffer,
+ uint32_t offset,
+ bool condition );
/**
* Query objects
*/
More information about the mesa-commit
mailing list