PIPE_MAX_SHADER_SAMPLER_VIEWS); /* textures */
elem_types[5] = LLVMArrayType(sampler_type,
PIPE_MAX_SAMPLERS); /* samplers */
+ elem_types[6] = LLVMArrayType(LLVMPointerType(int_type, 0), /* vs_ssbo */
+ LP_MAX_TGSI_SHADER_BUFFERS);
+ elem_types[7] = LLVMArrayType(int_type, /* num_vs_ssbos */
+ LP_MAX_TGSI_SHADER_BUFFERS);
context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
ARRAY_SIZE(elem_types), 0);
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, samplers,
target, context_type,
DRAW_JIT_CTX_SAMPLERS);
+ LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, vs_ssbos,
+ target, context_type, DRAW_JIT_CTX_SSBOS);
+ LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, num_vs_ssbos,
+ target, context_type, DRAW_JIT_CTX_NUM_SSBOS);
LP_CHECK_STRUCT_SIZE(struct draw_jit_context,
target, context_type);
elem_types[8] = LLVMPointerType(LLVMVectorType(int_type,
vector_length), 0);
+ elem_types[9] = LLVMArrayType(LLVMPointerType(int_type, 0), /* ssbos */
+ LP_MAX_TGSI_SHADER_BUFFERS);
+ elem_types[10] = LLVMArrayType(int_type, /* num_ssbos */
+ LP_MAX_TGSI_SHADER_BUFFERS);
context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
ARRAY_SIZE(elem_types), 0);
LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, emitted_prims,
target, context_type,
DRAW_GS_JIT_CTX_EMITTED_PRIMS);
+ LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, ssbos,
+ target, context_type, DRAW_GS_JIT_CTX_SSBOS);
+ LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, num_ssbos,
+ target, context_type, DRAW_GS_JIT_CTX_NUM_SSBOS);
LP_CHECK_STRUCT_SIZE(struct draw_gs_jit_context,
target, context_type);
draw_jit_context_vs_constants(variant->gallivm, context_ptr);
LLVMValueRef num_consts_ptr =
draw_jit_context_num_vs_constants(variant->gallivm, context_ptr);
+ LLVMValueRef ssbos_ptr =
+ draw_jit_context_vs_ssbos(variant->gallivm, context_ptr);
+ LLVMValueRef num_ssbos_ptr =
+ draw_jit_context_num_vs_ssbos(variant->gallivm, context_ptr);
lp_build_tgsi_soa(variant->gallivm,
tokens,
NULL,
draw_sampler,
&llvm->draw->vs.vertex_shader->info,
- NULL, NULL, NULL);
+ NULL, ssbos_ptr, num_ssbos_ptr);
{
LLVMValueRef out;
struct draw_gs_llvm_iface gs_iface;
const struct tgsi_token *tokens = variant->shader->base.state.tokens;
LLVMValueRef consts_ptr, num_consts_ptr;
+ LLVMValueRef ssbos_ptr, num_ssbos_ptr;
LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][TGSI_NUM_CHANNELS];
struct lp_build_mask_context mask;
const struct tgsi_shader_info *gs_info = &variant->shader->base.info;
num_consts_ptr =
draw_gs_jit_context_num_constants(variant->gallivm, context_ptr);
+ ssbos_ptr = draw_gs_jit_context_ssbos(variant->gallivm, context_ptr);
+ num_ssbos_ptr =
+ draw_gs_jit_context_num_ssbos(variant->gallivm, context_ptr);
+
/* code generated texture sampling */
sampler = draw_llvm_sampler_soa_create(variant->key.samplers);
NULL,
sampler,
&llvm->draw->gs.geometry_shader->info,
- (const struct lp_build_tgsi_gs_iface *)&gs_iface, NULL, NULL);
+ (const struct lp_build_tgsi_gs_iface *)&gs_iface, ssbos_ptr, num_ssbos_ptr);
sampler->destroy(sampler);
struct draw_jit_texture textures[PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct draw_jit_sampler samplers[PIPE_MAX_SAMPLERS];
+
+ const uint32_t *vs_ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
+ int num_vs_ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
};
enum {
DRAW_JIT_CTX_VIEWPORT = 3,
DRAW_JIT_CTX_TEXTURES = 4,
DRAW_JIT_CTX_SAMPLERS = 5,
+ DRAW_JIT_CTX_SSBOS = 6,
+ DRAW_JIT_CTX_NUM_SSBOS = 7,
DRAW_JIT_CTX_NUM_FIELDS
};
#define draw_jit_context_samplers(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_SAMPLERS, "samplers")
+#define draw_jit_context_vs_ssbos(_gallivm, _ptr) \
+ lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_SSBOS, "vs_ssbos")
+
+#define draw_jit_context_num_vs_ssbos(_gallivm, _ptr) \
+ lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_NUM_SSBOS, "num_vs_ssbos")
+
+
#define draw_jit_header_id(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_VERTEX_VERTEX_ID, "id")
int **prim_lengths;
int *emitted_vertices;
int *emitted_prims;
+ const uint32_t *ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
+ int num_ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
+
};
enum {
DRAW_GS_JIT_CTX_PRIM_LENGTHS = 6,
DRAW_GS_JIT_CTX_EMITTED_VERTICES = 7,
DRAW_GS_JIT_CTX_EMITTED_PRIMS = 8,
- DRAW_GS_JIT_CTX_NUM_FIELDS = 9
+ DRAW_GS_JIT_CTX_SSBOS = 9,
+ DRAW_GS_JIT_CTX_NUM_SSBOS = 10,
+ DRAW_GS_JIT_CTX_NUM_FIELDS = 11
};
#define draw_gs_jit_context_constants(_gallivm, _ptr) \
#define draw_gs_jit_emitted_prims(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, DRAW_GS_JIT_CTX_EMITTED_PRIMS, "emitted_prims")
+#define draw_gs_jit_context_ssbos(_gallivm, _ptr) \
+ lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_GS_JIT_CTX_SSBOS, "ssbos")
+#define draw_gs_jit_context_num_ssbos(_gallivm, _ptr) \
+ lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_GS_JIT_CTX_NUM_SSBOS, "num_ssbos")
typedef boolean
(*draw_jit_vert_func)(struct draw_jit_context *context,