From: Marek Olšák <marek.ol...@amd.com>

For coherency with the current context.
---
 src/gallium/drivers/radeon/r600_texture.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c 
b/src/gallium/drivers/radeon/r600_texture.c
index fb3068a..e7be768 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -511,41 +511,41 @@ static void r600_degrade_tile_mode_to_linear(struct 
r600_common_context *rctx,
        p_atomic_inc(&rctx->screen->dirty_tex_descriptor_counter);
 }
 
 static boolean r600_texture_get_handle(struct pipe_screen* screen,
                                       struct pipe_context *ctx,
                                       struct pipe_resource *resource,
                                       struct winsys_handle *whandle,
                                        unsigned usage)
 {
        struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
-       struct r600_common_context *aux_context =
-               (struct r600_common_context*)rscreen->aux_context;
+       struct r600_common_context *rctx = (struct r600_common_context*)
+                                          (ctx ? ctx : rscreen->aux_context);
        struct r600_resource *res = (struct r600_resource*)resource;
        struct r600_texture *rtex = (struct r600_texture*)resource;
        struct radeon_bo_metadata metadata;
        bool update_metadata = false;
 
        /* This is not supported now, but it might be required for OpenCL
         * interop in the future.
         */
        if (resource->target != PIPE_BUFFER &&
            (resource->nr_samples > 1 || rtex->is_depth))
                return false;
 
        if (resource->target != PIPE_BUFFER) {
                /* Since shader image stores don't support DCC on VI,
                 * disable it for external clients that want write
                 * access.
                 */
                if (usage & PIPE_HANDLE_USAGE_WRITE && rtex->dcc_offset) {
-                       if (r600_texture_disable_dcc(aux_context, rtex))
+                       if (r600_texture_disable_dcc(rctx, rtex))
                                update_metadata = true;
                }
 
                if (!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) &&
                    rtex->cmask.size) {
                        /* Eliminate fast clear (both CMASK and DCC) */
                        r600_eliminate_fast_color_clear(rscreen, rtex);
 
                        /* Disable CMASK if flush_resource isn't going
                         * to be called.
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to