Mesa (master): util/threaded_context: support pipe_context::set_sample_locations

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 5 21:17:40 UTC 2021


Module: Mesa
Branch: master
Commit: 796e95d6a70b75f560ad24d1b40ad17a9f91760d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=796e95d6a70b75f560ad24d1b40ad17a9f91760d

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Apr  2 17:24:46 2021 -0400

util/threaded_context: support pipe_context::set_sample_locations

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10031>

---

 src/gallium/auxiliary/util/u_threaded_context.c    | 26 ++++++++++++++++++++++
 .../auxiliary/util/u_threaded_context_calls.h      |  1 +
 2 files changed, 27 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 139607b276b..d2259dd7cb7 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -893,6 +893,31 @@ tc_set_inlinable_constants(struct pipe_context *_pipe,
    memcpy(p->values, values, num_values * 4);
 }
 
+struct tc_sample_locations {
+   uint16_t size;
+   uint8_t locations[0];
+};
+
+
+static void
+tc_call_set_sample_locations(struct pipe_context *pipe, union tc_payload *payload)
+{
+   struct tc_sample_locations *p = (struct tc_sample_locations *)payload;
+   pipe->set_sample_locations(pipe, p->size, &p->locations[0]);
+}
+
+static void
+tc_set_sample_locations(struct pipe_context *_pipe, size_t size, const uint8_t *locations)
+{
+   struct threaded_context *tc = threaded_context(_pipe);
+   struct tc_sample_locations *p = (struct tc_sample_locations *)tc_add_sized_call(tc,
+                                   TC_CALL_set_sample_locations,
+                                   tc_payload_size_to_call_slots(sizeof(struct tc_sample_locations) + size));
+
+   p->size = size;
+   memcpy(&p->locations, locations, size);
+}
+
 struct tc_scissors {
    ubyte start, count;
    struct pipe_scissor_state slot[0]; /* more will be allocated if needed */
@@ -3144,6 +3169,7 @@ threaded_context_create(struct pipe_context *pipe,
    CTX_INIT(set_inlinable_constants);
    CTX_INIT(set_framebuffer_state);
    CTX_INIT(set_polygon_stipple);
+   CTX_INIT(set_sample_locations);
    CTX_INIT(set_scissor_states);
    CTX_INIT(set_viewport_states);
    CTX_INIT(set_window_rectangles);
diff --git a/src/gallium/auxiliary/util/u_threaded_context_calls.h b/src/gallium/auxiliary/util/u_threaded_context_calls.h
index 3007a746eab..062cdb3aae6 100644
--- a/src/gallium/auxiliary/util/u_threaded_context_calls.h
+++ b/src/gallium/auxiliary/util/u_threaded_context_calls.h
@@ -12,6 +12,7 @@ CALL(set_framebuffer_state)
 CALL(set_tess_state)
 CALL(set_constant_buffer)
 CALL(set_inlinable_constants)
+CALL(set_sample_locations)
 CALL(set_scissor_states)
 CALL(set_viewport_states)
 CALL(set_window_rectangles)



More information about the mesa-commit mailing list