radeonsi: inline util_blitter_copy_texture
[mesa.git] / src / gallium / drivers / radeonsi / si_compute.c
index 3aea7999426782b1e59a06b4fd6672788e1c0ea2..ead5862df3907efcb95a99694d0ee8edc0e7e4ba 100644 (file)
@@ -1,8 +1,33 @@
+/*
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
 #include "util/u_memory.h"
 
 #include "../radeon/r600_cs.h"
 #include "si_pipe.h"
 #include "si_shader.h"
+#include "sid.h"
 
 #include "radeon_llvm_util.h"
 
@@ -82,8 +107,12 @@ static void si_set_global_binding(
 
        for (i = first; i < first + n; i++) {
                uint64_t va;
+               uint32_t offset;
                program->global_buffers[i] = resources[i];
                va = r600_resource_va(ctx->screen, resources[i]);
+               offset = util_le32_to_cpu(*handles[i]);
+               va += offset;
+               va = util_cpu_to_le64(va);
                memcpy(handles[i], &va, sizeof(va));
        }
 }