summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.h
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2013-11-21 16:45:28 +0900
committerMichel Dänzer <[email protected]>2014-01-29 11:06:28 +0900
commit404b29d765e2fe4d2bf80d17063e5672d2d59ca1 (patch)
treedb18b59b6517c6dde9fb92f6a6e26a636e9176fd /src/gallium/drivers/radeonsi/si_shader.h
parent51f89a03e1f8cee7de46735bb1ee6af388409b6d (diff)
radeonsi: Initial geometry shader support
Partly based on the corresponding r600g work by Vadim Girlin and Dave Airlie. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.h')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 766059bd056..19bad44c9e1 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -40,6 +40,7 @@
#define SI_SGPR_ALPHA_REF 6 /* PS only */
#define SI_VS_NUM_USER_SGPR 11
+#define SI_GS_NUM_USER_SGPR 6
#define SI_PS_NUM_USER_SGPR 7
/* LLVM function parameter indices */
@@ -53,6 +54,21 @@
#define SI_PARAM_START_INSTANCE 5
/* the other VS parameters are assigned dynamically */
+/* ES only parameters */
+#define SI_PARAM_ES2GS_OFFSET 6
+
+/* GS only parameters */
+#define SI_PARAM_GS2VS_OFFSET 3
+#define SI_PARAM_GS_WAVE_ID 4
+#define SI_PARAM_VTX0_OFFSET 5
+#define SI_PARAM_VTX1_OFFSET 6
+#define SI_PARAM_PRIMITIVE_ID 7
+#define SI_PARAM_VTX2_OFFSET 8
+#define SI_PARAM_VTX3_OFFSET 9
+#define SI_PARAM_VTX4_OFFSET 10
+#define SI_PARAM_VTX5_OFFSET 11
+#define SI_PARAM_GS_INSTANCE_ID 12
+
/* PS only parameters */
#define SI_PARAM_ALPHA_REF 3
#define SI_PARAM_PRIM_MASK 4
@@ -73,7 +89,7 @@
#define SI_PARAM_SAMPLE_COVERAGE 19
#define SI_PARAM_POS_FIXED_PT 20
-struct si_shader_io {
+struct si_shader_input {
unsigned name;
int sid;
unsigned param_offset;
@@ -81,6 +97,14 @@ struct si_shader_io {
bool centroid;
};
+struct si_shader_output {
+ unsigned name;
+ int sid;
+ unsigned param_offset;
+ unsigned index;
+ unsigned usage;
+};
+
struct si_pipe_shader;
struct si_pipe_shader_selector {
@@ -102,10 +126,15 @@ struct si_pipe_shader_selector {
struct si_shader {
unsigned ninput;
- struct si_shader_io input[40];
+ struct si_shader_input input[40];
unsigned noutput;
- struct si_shader_io output[40];
+ struct si_shader_output output[40];
+
+ /* geometry shader properties */
+ unsigned gs_input_prim;
+ unsigned gs_output_prim;
+ unsigned gs_max_out_vertices;
unsigned ninterp;
bool uses_kill;
@@ -131,12 +160,14 @@ union si_shader_key {
struct {
unsigned instance_divisors[PIPE_MAX_ATTRIBS];
unsigned ucps_enabled:2;
+ unsigned as_es:1;
} vs;
};
struct si_pipe_shader {
struct si_pipe_shader_selector *selector;
struct si_pipe_shader *next_variant;
+ struct si_pipe_shader *gs_copy_shader;
struct si_shader shader;
struct si_pm4_state *pm4;
struct r600_resource *bo;