v8i32 = LLVMVectorType(i32, 8);
v16i8 = LLVMVectorType(i8, 16);
- params[SI_PARAM_CONST] = const_array(v16i8, SI_NUM_CONST_BUFFERS);
params[SI_PARAM_RW_BUFFERS] = const_array(v16i8, SI_NUM_RW_BUFFERS);
+ params[SI_PARAM_CONST] = const_array(v16i8, SI_NUM_CONST_BUFFERS);
params[SI_PARAM_SAMPLER] = const_array(v4i32, SI_NUM_SAMPLER_STATES);
params[SI_PARAM_RESOURCE] = const_array(v8i32, SI_NUM_SAMPLER_VIEWS);
last_array_pointer = SI_PARAM_RESOURCE;
params[SI_PARAM_BASE_VERTEX] = i32;
params[SI_PARAM_START_INSTANCE] = i32;
num_params = SI_PARAM_START_INSTANCE+1;
+
if (shader->key.vs.as_es) {
params[SI_PARAM_ES2GS_OFFSET] = i32;
num_params++;
} else {
+ if (shader->is_gs_copy_shader) {
+ last_array_pointer = SI_PARAM_CONST;
+ num_params = SI_PARAM_CONST+1;
+ }
+
/* The locations of the other parameters are assigned dynamically. */
/* Streamout SGPRs. */
outputs = MALLOC(gs->noutput * sizeof(outputs[0]));
si_shader_ctx->type = TGSI_PROCESSOR_VERTEX;
+ shader->is_gs_copy_shader = true;
radeon_llvm_context_init(&si_shader_ctx->radeon_bld);
#include "tgsi/tgsi_scan.h"
#include "si_state.h"
-#define SI_SGPR_CONST 0
-#define SI_SGPR_SAMPLER 2
-#define SI_SGPR_RESOURCE 4
-#define SI_SGPR_RW_BUFFERS 6 /* rings (& stream-out, VS only) */
+#define SI_SGPR_RW_BUFFERS 0 /* rings (& stream-out, VS only) */
+#define SI_SGPR_CONST 2
+#define SI_SGPR_SAMPLER 4
+#define SI_SGPR_RESOURCE 6
#define SI_SGPR_VERTEX_BUFFER 8 /* VS only */
#define SI_SGPR_BASE_VERTEX 10 /* VS only */
#define SI_SGPR_START_INSTANCE 11 /* VS only */
#define SI_VS_NUM_USER_SGPR 12
#define SI_GS_NUM_USER_SGPR 8
+#define SI_GSCOPY_NUM_USER_SGPR 4
#define SI_PS_NUM_USER_SGPR 9
/* LLVM function parameter indices */
-#define SI_PARAM_CONST 0
-#define SI_PARAM_SAMPLER 1
-#define SI_PARAM_RESOURCE 2
-#define SI_PARAM_RW_BUFFERS 3
+#define SI_PARAM_RW_BUFFERS 0
+#define SI_PARAM_CONST 1
+#define SI_PARAM_SAMPLER 2
+#define SI_PARAM_RESOURCE 3
/* VS only parameters */
#define SI_PARAM_VERTEX_BUFFER 4
bool vs_out_layer;
unsigned nr_pos_exports;
unsigned clip_dist_write;
+ bool is_gs_copy_shader;
};
static inline struct si_shader* si_get_vs_state(struct si_context *sctx)
vgpr_comp_cnt = shader->uses_instanceid ? 3 : 0;
- num_user_sgprs = SI_VS_NUM_USER_SGPR;
+ if (shader->is_gs_copy_shader)
+ num_user_sgprs = SI_GSCOPY_NUM_USER_SGPR;
+ else
+ num_user_sgprs = SI_VS_NUM_USER_SGPR;
+
num_sgprs = shader->num_sgprs;
if (num_user_sgprs > num_sgprs) {
/* Last 2 reserved SGPRs are used for VCC */