aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-11-30 14:44:30 +1000
committerDave Airlie <[email protected]>2015-12-07 09:59:00 +1000
commit79d88afd5c59b4d35c0277ca3886b061c8cfe761 (patch)
tree55970c1300efae3915b5738679cc7d2effb1c7d2
parent839dae0dc0d92f47dddaf67964603f3c9c4a0ad7 (diff)
r600: workout bitmask for the used tcs inputs/outputs.
This is used later to setup the constants to be given to the tessellation shaders. Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h3
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c25
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 068e2f8a302..ac06d1f51b6 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -330,6 +330,9 @@ struct r600_pipe_shader_selector {
unsigned gs_max_out_vertices;
unsigned gs_num_invocations;
+ /* TCS/VS */
+ uint64_t lds_patch_outputs_written_mask;
+ uint64_t lds_outputs_written_mask;
unsigned nr_ps_max_color_exports;
};
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index ab8a2c142cd..0c8ed524e76 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -855,6 +855,7 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
unsigned pipe_shader_type)
{
struct r600_pipe_shader_selector *sel = CALLOC_STRUCT(r600_pipe_shader_selector);
+ int i;
sel->type = pipe_shader_type;
sel->tokens = tgsi_dup_tokens(state->tokens);
@@ -870,6 +871,30 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
sel->gs_num_invocations =
sel->info.properties[TGSI_PROPERTY_GS_INVOCATIONS];
break;
+ case PIPE_SHADER_VERTEX:
+ case PIPE_SHADER_TESS_CTRL:
+ sel->lds_patch_outputs_written_mask = 0;
+ sel->lds_outputs_written_mask = 0;
+
+ for (i = 0; i < sel->info.num_outputs; i++) {
+ unsigned name = sel->info.output_semantic_name[i];
+ unsigned index = sel->info.output_semantic_index[i];
+
+ switch (name) {
+ case TGSI_SEMANTIC_TESSINNER:
+ case TGSI_SEMANTIC_TESSOUTER:
+ case TGSI_SEMANTIC_PATCH:
+ sel->lds_patch_outputs_written_mask |=
+ 1llu << r600_get_lds_unique_index(name, index);
+ break;
+ default:
+ sel->lds_outputs_written_mask |=
+ 1llu << r600_get_lds_unique_index(name, index);
+ }
+ }
+ break;
+ default:
+ break;
}
return sel;