aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-04-12 16:03:02 -0400
committerMarek Olšák <[email protected]>2019-05-01 21:16:13 -0400
commit2d48a6959f8ec4dc88b8bd8fcd75cee1169fc006 (patch)
treec099e13289334d7f268b00c494e876d317e52304 /src/gallium/drivers
parentbfd3d504875a1f0c73ab1220c4a2a80c13a1703a (diff)
radeonsi: set sampler state and view functions for compute-only contexts
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c2
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c17
-rw-r--r--src/gallium/drivers/radeonsi/si_state.h2
3 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index aaf5138a3a2..b0e0ca7af05 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -503,7 +503,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
sctx->b.set_context_param = si_set_context_param;
sctx->b.get_device_reset_status = si_get_reset_status;
sctx->b.set_device_reset_callback = si_set_device_reset_callback;
- sctx->b.memory_barrier = si_memory_barrier;
si_init_all_descriptors(sctx);
si_init_buffer_functions(sctx);
@@ -513,6 +512,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
si_init_compute_blit_functions(sctx);
si_init_debug_functions(sctx);
si_init_fence_functions(sctx);
+ si_init_state_compute_functions(sctx);
if (sscreen->debug_flags & DBG(FORCE_DMA))
sctx->b.resource_copy_region = sctx->dma_copy;
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 2266b0a0824..876a993b158 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -4720,7 +4720,7 @@ static void si_texture_barrier(struct pipe_context *ctx, unsigned flags)
}
/* This only ensures coherency for shader image/buffer stores. */
-void si_memory_barrier(struct pipe_context *ctx, unsigned flags)
+static void si_memory_barrier(struct pipe_context *ctx, unsigned flags)
{
struct si_context *sctx = (struct si_context *)ctx;
@@ -4785,6 +4785,15 @@ static void *si_create_blend_custom(struct si_context *sctx, unsigned mode)
static void si_init_config(struct si_context *sctx);
+void si_init_state_compute_functions(struct si_context *sctx)
+{
+ sctx->b.create_sampler_state = si_create_sampler_state;
+ sctx->b.delete_sampler_state = si_delete_sampler_state;
+ sctx->b.create_sampler_view = si_create_sampler_view;
+ sctx->b.sampler_view_destroy = si_sampler_view_destroy;
+ sctx->b.memory_barrier = si_memory_barrier;
+}
+
void si_init_state_functions(struct si_context *sctx)
{
sctx->atoms.s.framebuffer.emit = si_emit_framebuffer_state;
@@ -4823,12 +4832,6 @@ void si_init_state_functions(struct si_context *sctx)
sctx->b.set_framebuffer_state = si_set_framebuffer_state;
- sctx->b.create_sampler_state = si_create_sampler_state;
- sctx->b.delete_sampler_state = si_delete_sampler_state;
-
- sctx->b.create_sampler_view = si_create_sampler_view;
- sctx->b.sampler_view_destroy = si_sampler_view_destroy;
-
sctx->b.set_sample_mask = si_set_sample_mask;
sctx->b.create_vertex_elements_state = si_create_vertex_elements;
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index c15ce5cdf1f..6df24f9648a 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -490,7 +490,7 @@ void si_bindless_descriptor_slab_free(void *priv, struct pb_slab *pslab);
void si_rebind_buffer(struct si_context *sctx, struct pipe_resource *buf,
uint64_t old_va);
/* si_state.c */
-void si_memory_barrier(struct pipe_context *ctx, unsigned flags);
+void si_init_state_compute_functions(struct si_context *sctx);
void si_init_state_functions(struct si_context *sctx);
void si_init_screen_state_functions(struct si_screen *sscreen);
void