summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-04-04 16:04:30 -0400
committerMarek Olšák <[email protected]>2018-04-04 20:01:43 -0400
commit096942be2cb656a8f28b98905e1783adba3aae7f (patch)
tree852f111e8d4b11361839b3f10229af88d520fea9 /src/gallium/auxiliary/cso_cache
parentd9dc26c94e454385e2094727f4163e7ba4e20a7f (diff)
gallium/pp: use user constant buffers
This fixes a radeonsi crash. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105026
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c17
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 3fa57f16ff4..3a3a63a3327 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1548,6 +1548,23 @@ cso_set_constant_buffer_resource(struct cso_context *cso,
}
void
+cso_set_constant_user_buffer(struct cso_context *cso,
+ enum pipe_shader_type shader_stage,
+ unsigned index, void *ptr, unsigned size)
+{
+ if (ptr) {
+ struct pipe_constant_buffer cb;
+ cb.buffer = NULL;
+ cb.buffer_offset = 0;
+ cb.buffer_size = size;
+ cb.user_buffer = ptr;
+ cso_set_constant_buffer(cso, shader_stage, index, &cb);
+ } else {
+ cso_set_constant_buffer(cso, shader_stage, index, NULL);
+ }
+}
+
+void
cso_save_constant_buffer_slot0(struct cso_context *cso,
enum pipe_shader_type shader_stage)
{
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
index b1bc0813442..3a4e808f0c0 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.h
+++ b/src/gallium/auxiliary/cso_cache/cso_context.h
@@ -214,6 +214,9 @@ void cso_set_constant_buffer_resource(struct cso_context *cso,
enum pipe_shader_type shader_stage,
unsigned index,
struct pipe_resource *buffer);
+void cso_set_constant_user_buffer(struct cso_context *cso,
+ enum pipe_shader_type shader_stage,
+ unsigned index, void *ptr, unsigned size);
void cso_save_constant_buffer_slot0(struct cso_context *cso,
enum pipe_shader_type shader_stage);
void cso_restore_constant_buffer_slot0(struct cso_context *cso,