Mesa (master): swr: Fix crashes on Windows

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 18 11:35:20 UTC 2020


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

Author: jzielins <jan.zielinski at intel.com>
Date:   Thu Dec 17 14:46:18 2020 +0100

swr: Fix crashes on Windows

SWR is missing implementation of pipe_context::flush_resource
function, which is now in the execution path on Windows.
This change adds an empty implementation (flush_resource
is NOOP in SWR) to prevent crashes

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8159>

---

 src/gallium/drivers/swr/swr_context.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/swr/swr_context.cpp b/src/gallium/drivers/swr/swr_context.cpp
index 925cd2d26c8..33fa27c5efd 100644
--- a/src/gallium/drivers/swr/swr_context.cpp
+++ b/src/gallium/drivers/swr/swr_context.cpp
@@ -428,6 +428,13 @@ swr_render_condition(struct pipe_context *pipe,
    ctx->render_cond_cond = condition;
 }
 
+
+static void
+swr_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
+{
+   // NOOP
+}
+
 static void
 swr_UpdateStats(HANDLE hPrivateContext, const SWR_STATS *pStats)
 {
@@ -557,6 +564,7 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
 
    ctx->pipe.clear_texture = util_clear_texture;
    ctx->pipe.resource_copy_region = swr_resource_copy;
+   ctx->pipe.flush_resource = swr_flush_resource;
    ctx->pipe.render_condition = swr_render_condition;
 
    swr_state_init(&ctx->pipe);



More information about the mesa-commit mailing list