radeonsi: drop useless memcmp() check in si_set_blend_color()
[mesa.git] / src / gallium / drivers / r600 / evergreen_compute.c
index fe43f37574998ab42d0ff238ca954951d3ed17cf..37ef1058d3fb22c425d25670c1f33ad0605069ec 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include "ac_binary.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_state.h"
 #include "pipe/p_context.h"
@@ -46,7 +47,6 @@
 #include "evergreen_compute_internal.h"
 #include "compute_memory_pool.h"
 #include "sb/sb_public.h"
-#include "radeon/radeon_elf_util.h"
 #include <inttypes.h>
 
 /**
@@ -87,9 +87,7 @@ struct r600_resource *r600_compute_buffer_alloc_vram(struct r600_screen *screen,
        assert(size);
 
        buffer = pipe_buffer_create((struct pipe_screen*) screen,
-                                   PIPE_BIND_CUSTOM,
-                                   PIPE_USAGE_IMMUTABLE,
-                                   size);
+                                   0, PIPE_USAGE_IMMUTABLE, size);
 
        return (struct r600_resource *)buffer;
 }
@@ -148,8 +146,8 @@ static void evergreen_cs_set_vertex_buffer(struct r600_context *rctx,
        struct pipe_vertex_buffer *vb = &state->vb[vb_index];
        vb->stride = 1;
        vb->buffer_offset = offset;
-       vb->buffer = buffer;
-       vb->user_buffer = NULL;
+       vb->buffer.resource = buffer;
+       vb->is_user_buffer = false;
 
        /* The vertex instructions in the compute shaders use the texture cache,
         * so we need to invalidate it. */
@@ -182,14 +180,14 @@ static void evergreen_cs_set_constant_buffer(struct r600_context *rctx,
 
 #ifdef HAVE_OPENCL
 
-static void r600_shader_binary_read_config(const struct radeon_shader_binary *binary,
+static void r600_shader_binary_read_config(const struct ac_shader_binary *binary,
                                           struct r600_bytecode *bc,
                                           uint64_t symbol_offset,
                                           boolean *use_kill)
 {
        unsigned i;
        const unsigned char *config =
-               radeon_shader_binary_config_start(binary, symbol_offset);
+               ac_shader_binary_config_start(binary, symbol_offset);
 
        for (i = 0; i < binary->config_size_per_symbol; i+= 8) {
                unsigned reg =
@@ -218,7 +216,7 @@ static void r600_shader_binary_read_config(const struct radeon_shader_binary *bi
 }
 
 static unsigned r600_create_shader(struct r600_bytecode *bc,
-                                  const struct radeon_shader_binary *binary,
+                                  const struct ac_shader_binary *binary,
                                   boolean *use_kill)
 
 {
@@ -253,7 +251,7 @@ static void *evergreen_create_compute_state(struct pipe_context *ctx,
        header = cso->prog;
        code = cso->prog + sizeof(struct pipe_llvm_program_header);
        radeon_shader_binary_init(&shader->binary);
-       radeon_elf_read(code, header->num_bytes, &shader->binary);
+       ac_elf_read(code, header->num_bytes, &shader->binary);
        r600_create_shader(&shader->bc, &shader->binary, &use_kill);
 
        /* Upload code + ROdata */
@@ -335,7 +333,7 @@ static void evergreen_compute_upload_input(struct pipe_context *ctx,
        if (!shader->kernel_param) {
                /* Add space for the grid dimensions */
                shader->kernel_param = (struct r600_resource *)
-                       pipe_buffer_create(ctx->screen, PIPE_BIND_CUSTOM,
+                       pipe_buffer_create(ctx->screen, 0,
                                        PIPE_USAGE_IMMUTABLE, input_size);
        }