}
}
+void
+draw_set_mapped_shader_buffer(struct draw_context *draw,
+ enum pipe_shader_type shader_type,
+ unsigned slot,
+ const void *buffer,
+ unsigned size )
+{
+ debug_assert(shader_type == PIPE_SHADER_VERTEX ||
+ shader_type == PIPE_SHADER_GEOMETRY);
+ debug_assert(slot < PIPE_MAX_SHADER_BUFFERS);
+
+ draw_do_flush(draw, DRAW_FLUSH_PARAMETER_CHANGE);
+
+ switch (shader_type) {
+ case PIPE_SHADER_VERTEX:
+ draw->pt.user.vs_ssbos[slot] = buffer;
+ draw->pt.user.vs_ssbos_size[slot] = size;
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ draw->pt.user.gs_ssbos[slot] = buffer;
+ draw->pt.user.gs_ssbos_size[slot] = size;
+ break;
+ default:
+ assert(0 && "invalid shader type in draw_set_mapped_shader_buffer");
+ }
+}
/**
* Tells the draw module to draw points with triangles if their size
const void *buffer,
unsigned size);
+void
+draw_set_mapped_shader_buffer(struct draw_context *draw,
+ enum pipe_shader_type shader_type,
+ unsigned slot,
+ const void *buffer,
+ unsigned size);
+
void
draw_set_mapped_so_targets(struct draw_context *draw,
int num_targets,
unsigned vs_constants_size[PIPE_MAX_CONSTANT_BUFFERS];
const void *gs_constants[PIPE_MAX_CONSTANT_BUFFERS];
unsigned gs_constants_size[PIPE_MAX_CONSTANT_BUFFERS];
-
+
+ /** shader buffers (for vertex/geometry shader) */
+ const void *vs_ssbos[PIPE_MAX_SHADER_BUFFERS];
+ unsigned vs_ssbos_size[PIPE_MAX_SHADER_BUFFERS];
+ const void *gs_ssbos[PIPE_MAX_SHADER_BUFFERS];
+ unsigned gs_ssbos_size[PIPE_MAX_SHADER_BUFFERS];
+
/* pointer to planes */
float (*planes)[DRAW_TOTAL_CLIP_PLANES][4];
} user;
llvm->jit_context.vs_constants[i] = fake_const_buf;
}
}
+ for (i = 0; i < ARRAY_SIZE(llvm->jit_context.vs_ssbos); ++i) {
+ int num_ssbos = draw->pt.user.vs_ssbos_size[i];
+ llvm->jit_context.vs_ssbos[i] = draw->pt.user.vs_ssbos[i];
+ llvm->jit_context.num_vs_ssbos[i] = num_ssbos;
+ if (num_ssbos == 0) {
+ llvm->jit_context.vs_ssbos[i] = (const uint32_t *)fake_const_buf;
+ }
+ }
+
for (i = 0; i < ARRAY_SIZE(llvm->gs_jit_context.constants); ++i) {
int num_consts =
draw->pt.user.gs_constants_size[i] / (sizeof(float) * 4);
llvm->gs_jit_context.constants[i] = fake_const_buf;
}
}
+ for (i = 0; i < ARRAY_SIZE(llvm->gs_jit_context.ssbos); ++i) {
+ int num_ssbos = draw->pt.user.gs_ssbos_size[i];
+ llvm->gs_jit_context.ssbos[i] = draw->pt.user.gs_ssbos[i];
+ llvm->gs_jit_context.num_ssbos[i] = num_ssbos;
+ if (num_ssbos == 0) {
+ llvm->gs_jit_context.ssbos[i] = (const uint32_t *)fake_const_buf;
+ }
+ }
llvm->jit_context.planes =
(float (*)[DRAW_TOTAL_CLIP_PLANES][4]) draw->pt.user.planes[0];