This just adds the ssbo ptrs to the jit fragment shader api.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
PIPE_MAX_SHADER_SAMPLER_VIEWS);
elem_types[LP_JIT_CTX_SAMPLERS] = LLVMArrayType(sampler_type,
PIPE_MAX_SAMPLERS);
-
+ elem_types[LP_JIT_CTX_SSBOS] =
+ LLVMArrayType(LLVMPointerType(LLVMInt32TypeInContext(lc), 0), LP_MAX_TGSI_SHADER_BUFFERS);
+ elem_types[LP_JIT_CTX_NUM_SSBOS] =
+ LLVMArrayType(LLVMInt32TypeInContext(lc), LP_MAX_TGSI_SHADER_BUFFERS);
context_type = LLVMStructTypeInContext(lc, elem_types,
ARRAY_SIZE(elem_types), 0);
LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, samplers,
gallivm->target, context_type,
LP_JIT_CTX_SAMPLERS);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, ssbos,
+ gallivm->target, context_type,
+ LP_JIT_CTX_SSBOS);
+ LP_CHECK_MEMBER_OFFSET(struct lp_jit_context, num_ssbos,
+ gallivm->target, context_type,
+ LP_JIT_CTX_NUM_SSBOS);
LP_CHECK_STRUCT_SIZE(struct lp_jit_context,
gallivm->target, context_type);
struct lp_jit_texture textures[PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct lp_jit_sampler samplers[PIPE_MAX_SAMPLERS];
+
+ const uint32_t *ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
+ int num_ssbos[LP_MAX_TGSI_SHADER_BUFFERS];
};
LP_JIT_CTX_VIEWPORTS,
LP_JIT_CTX_TEXTURES,
LP_JIT_CTX_SAMPLERS,
+ LP_JIT_CTX_SSBOS,
+ LP_JIT_CTX_NUM_SSBOS,
LP_JIT_CTX_COUNT
};
#define lp_jit_context_samplers(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_SAMPLERS, "samplers")
+#define lp_jit_context_ssbos(_gallivm, _ptr) \
+ lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_SSBOS, "ssbos")
+
+#define lp_jit_context_num_ssbos(_gallivm, _ptr) \
+ lp_build_struct_get_ptr(_gallivm, _ptr, LP_JIT_CTX_NUM_SSBOS, "num_ssbos")
struct lp_jit_thread_data
{
LLVMTypeRef vec_type, int_vec_type;
LLVMValueRef mask_ptr, mask_val;
LLVMValueRef consts_ptr, num_consts_ptr;
+ LLVMValueRef ssbo_ptr, num_ssbo_ptr;
LLVMValueRef z;
LLVMValueRef z_value, s_value;
LLVMValueRef z_fb, s_fb;
consts_ptr = lp_jit_context_constants(gallivm, context_ptr);
num_consts_ptr = lp_jit_context_num_constants(gallivm, context_ptr);
+ ssbo_ptr = lp_jit_context_ssbos(gallivm, context_ptr);
+ num_ssbo_ptr = lp_jit_context_num_ssbos(gallivm, context_ptr);
+
lp_build_for_loop_begin(&loop_state, gallivm,
lp_build_const_int32(gallivm, 0),
LLVMIntULT,
consts_ptr, num_consts_ptr, &system_values,
interp->inputs,
outputs, context_ptr, thread_data_ptr,
- sampler, &shader->info.base, NULL, NULL, NULL);
+ sampler, &shader->info.base, NULL, ssbo_ptr, num_ssbo_ptr);
/* Alpha test */
if (key->alpha.enabled) {