struct si_shader_context *si_shader_ctx = si_shader_context(bld_base);
struct lp_build_context *uint = &bld_base->uint_bld;
struct si_shader *shader = si_shader_ctx->shader;
+ struct tgsi_shader_info *info = &shader->selector->info;
struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMTypeRef i32 = LLVMInt32TypeInContext(gallivm->context);
LLVMValueRef soffset = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn,
build_intrinsic(gallivm->builder, "llvm.AMDGPU.kill",
LLVMVoidTypeInContext(gallivm->context), &kill, 1, 0);
- for (i = 0; i < shader->noutput; i++) {
+ for (i = 0; i < info->num_outputs; i++) {
LLVMValueRef *out_ptr =
- si_shader_ctx->radeon_bld.soa.outputs[shader->output[i].index];
+ si_shader_ctx->radeon_bld.soa.outputs[i];
for (chan = 0; chan < 4; chan++) {
LLVMValueRef out_val = LLVMBuildLoad(gallivm->builder, out_ptr[chan], "");
struct lp_build_context *uint = &bld_base->uint_bld;
struct si_shader *shader = si_shader_ctx->shader;
struct si_shader_output_values *outputs;
+ struct tgsi_shader_info *gsinfo = &gs->selector->info;
LLVMValueRef t_list_ptr, t_list;
LLVMValueRef args[9];
int i, r;
- outputs = MALLOC(gs->noutput * sizeof(outputs[0]));
+ outputs = MALLOC(gsinfo->num_outputs * sizeof(outputs[0]));
si_shader_ctx->type = TGSI_PROCESSOR_VERTEX;
shader->is_gs_copy_shader = true;
args[8] = uint->zero; /* TFE */
/* Fetch vertex data from GSVS ring */
- for (i = 0; i < gs->noutput; ++i) {
- struct si_shader_output *out = gs->output + i;
+ for (i = 0; i < gsinfo->num_outputs; ++i) {
unsigned chan;
- shader->output[i] = *out;
-
- outputs[i].name = out->name;
- outputs[i].index = out->index;
- outputs[i].sid = out->sid;
+ outputs[i].name = gsinfo->output_semantic_name[i];
+ outputs[i].index = i;
+ outputs[i].sid = gsinfo->output_semantic_index[i];
for (chan = 0; chan < 4; chan++) {
args[2] = lp_build_const_int32(gallivm,
base->elem_type, "");
}
}
- shader->noutput = gs->noutput;
- si_llvm_export_vs(bld_base, outputs, gs->noutput);
+ si_llvm_export_vs(bld_base, outputs, gsinfo->num_outputs);
radeon_llvm_finalize_module(&si_shader_ctx->radeon_bld);
static void si_shader_gs(struct pipe_context *ctx, struct si_shader *shader)
{
struct si_context *sctx = (struct si_context *)ctx;
- unsigned gs_vert_itemsize = shader->noutput * (16 >> 2);
+ unsigned gs_vert_itemsize = shader->selector->info.num_outputs * (16 >> 2);
unsigned gs_max_vert_out = shader->selector->gs_max_out_vertices;
unsigned gsvs_itemsize = gs_vert_itemsize * gs_max_vert_out;
unsigned cut_mode;
si_set_ring_buffer(ctx, PIPE_SHADER_GEOMETRY, SI_RING_GSVS,
sctx->gsvs_ring,
sctx->gs_shader->gs_max_out_vertices *
- sctx->gs_shader->current->noutput * 16,
+ sctx->gs_shader->info.num_outputs * 16,
64, true, true, 4, 16);
if (!sctx->gs_on) {