aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2015-08-29 18:31:07 +1000
committerMarek Olšák <[email protected]>2015-08-30 11:40:44 +0200
commitb4dee1b6360a91117c7a754ed70f359f6000a0de (patch)
tree1e7c548ff07bf48b498bd50a403cb9c3d3d3f28f
parent7b6369eb69e688e5bf739dbe60452950a794f55d (diff)
r600g: Move geometry properties state from shader to selector
Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c16
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h5
-rw-r--r--src/gallium/drivers/r600/r600_shader.c6
-rw-r--r--src/gallium/drivers/r600/r600_shader.h4
-rw-r--r--src/gallium/drivers/r600/r600_state.c12
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c2
6 files changed, 23 insertions, 22 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 6a91d4709f4..7c82390ba40 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -2143,11 +2143,11 @@ static void evergreen_emit_shader_stages(struct r600_context *rctx, struct r600_
if (state->geom_enable) {
uint32_t cut_val;
- if (rctx->gs_shader->current->shader.gs_max_out_vertices <= 128)
+ if (rctx->gs_shader->gs_max_out_vertices <= 128)
cut_val = V_028A40_GS_CUT_128;
- else if (rctx->gs_shader->current->shader.gs_max_out_vertices <= 256)
+ else if (rctx->gs_shader->gs_max_out_vertices <= 256)
cut_val = V_028A40_GS_CUT_256;
- else if (rctx->gs_shader->current->shader.gs_max_out_vertices <= 512)
+ else if (rctx->gs_shader->gs_max_out_vertices <= 512)
cut_val = V_028A40_GS_CUT_512;
else
cut_val = V_028A40_GS_CUT_1024;
@@ -3013,7 +3013,7 @@ void evergreen_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader
struct r600_shader *rshader = &shader->shader;
struct r600_shader *cp_shader = &shader->gs_copy_shader->shader;
unsigned gsvs_itemsize =
- (cp_shader->ring_item_size * rshader->gs_max_out_vertices) >> 2;
+ (cp_shader->ring_item_size * shader->selector->gs_max_out_vertices) >> 2;
r600_init_command_buffer(cb, 64);
@@ -3022,14 +3022,14 @@ void evergreen_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader
r600_store_context_reg(cb, R_028AB8_VGT_VTX_CNT_EN, 1);
r600_store_context_reg(cb, R_028B38_VGT_GS_MAX_VERT_OUT,
- S_028B38_MAX_VERT_OUT(rshader->gs_max_out_vertices));
+ S_028B38_MAX_VERT_OUT(shader->selector->gs_max_out_vertices));
r600_store_context_reg(cb, R_028A6C_VGT_GS_OUT_PRIM_TYPE,
- r600_conv_prim_to_gs_out(rshader->gs_output_prim));
+ r600_conv_prim_to_gs_out(shader->selector->gs_output_prim));
if (rctx->screen->b.info.drm_minor >= 35) {
r600_store_context_reg(cb, R_028B90_VGT_GS_INSTANCE_CNT,
- S_028B90_CNT(MIN2(rshader->gs_num_invocations, 127)) |
- S_028B90_ENABLE(rshader->gs_num_invocations > 0));
+ S_028B90_CNT(MIN2(shader->selector->gs_num_invocations, 127)) |
+ S_028B90_ENABLE(shader->selector->gs_num_invocations > 0));
}
r600_store_context_reg_seq(cb, R_02891C_SQ_GS_VERT_ITEMSIZE, 4);
r600_store_value(cb, cp_shader->ring_item_size >> 2);
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 3247aba969e..eb7036048e5 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -311,6 +311,11 @@ struct r600_pipe_shader_selector {
/* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
unsigned type;
+ /* geometry shader properties */
+ unsigned gs_output_prim;
+ unsigned gs_max_out_vertices;
+ unsigned gs_num_invocations;
+
unsigned nr_ps_max_color_exports;
};
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 44e41fb30a6..f0b794c809e 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -2010,13 +2010,13 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
/* we don't need this one */
break;
case TGSI_PROPERTY_GS_OUTPUT_PRIM:
- shader->gs_output_prim = property->u[0].Data;
+ pipeshader->selector->gs_output_prim = property->u[0].Data;
break;
case TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES:
- shader->gs_max_out_vertices = property->u[0].Data;
+ pipeshader->selector->gs_max_out_vertices = property->u[0].Data;
break;
case TGSI_PROPERTY_GS_INVOCATIONS:
- shader->gs_num_invocations = property->u[0].Data;
+ pipeshader->selector->gs_num_invocations = property->u[0].Data;
break;
}
break;
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index 2b99b22a6b2..f5ca9d67f1e 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -78,10 +78,6 @@ struct r600_shader {
/* Temporarily workaround SB not handling CF_INDEX_[01] index registers */
boolean uses_index_registers;
- /* geometry shader properties */
- unsigned gs_output_prim;
- unsigned gs_max_out_vertices;
- unsigned gs_num_invocations;
/* size in bytes of a data item in the ring (single vertex data) */
unsigned ring_item_size;
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 5cc2283792d..51527631efd 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -1951,11 +1951,11 @@ static void r600_emit_shader_stages(struct r600_context *rctx, struct r600_atom
if (state->geom_enable) {
uint32_t cut_val;
- if (rctx->gs_shader->current->shader.gs_max_out_vertices <= 128)
+ if (rctx->gs_shader->gs_max_out_vertices <= 128)
cut_val = V_028A40_GS_CUT_128;
- else if (rctx->gs_shader->current->shader.gs_max_out_vertices <= 256)
+ else if (rctx->gs_shader->gs_max_out_vertices <= 256)
cut_val = V_028A40_GS_CUT_256;
- else if (rctx->gs_shader->current->shader.gs_max_out_vertices <= 512)
+ else if (rctx->gs_shader->gs_max_out_vertices <= 512)
cut_val = V_028A40_GS_CUT_512;
else
cut_val = V_028A40_GS_CUT_1024;
@@ -2650,7 +2650,7 @@ void r600_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader *sha
struct r600_shader *rshader = &shader->shader;
struct r600_shader *cp_shader = &shader->gs_copy_shader->shader;
unsigned gsvs_itemsize =
- (cp_shader->ring_item_size * rshader->gs_max_out_vertices) >> 2;
+ (cp_shader->ring_item_size * shader->selector->gs_max_out_vertices) >> 2;
r600_init_command_buffer(cb, 64);
@@ -2659,10 +2659,10 @@ void r600_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader *sha
if (rctx->b.chip_class >= R700) {
r600_store_context_reg(cb, R_028B38_VGT_GS_MAX_VERT_OUT,
- S_028B38_MAX_VERT_OUT(rshader->gs_max_out_vertices));
+ S_028B38_MAX_VERT_OUT(shader->selector->gs_max_out_vertices));
}
r600_store_context_reg(cb, R_028A6C_VGT_GS_OUT_PRIM_TYPE,
- r600_conv_prim_to_gs_out(rshader->gs_output_prim));
+ r600_conv_prim_to_gs_out(shader->selector->gs_output_prim));
r600_store_context_reg(cb, R_0288C8_SQ_GS_VERT_ITEMSIZE,
cp_shader->ring_item_size >> 2);
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index a05dd8352c7..63746b55502 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -1524,7 +1524,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
unsigned prim = info.mode;
if (rctx->gs_shader) {
- prim = rctx->gs_shader->current->shader.gs_output_prim;
+ prim = rctx->gs_shader->gs_output_prim;
}
prim = r600_conv_prim_to_gs_out(prim); /* decrease the number of types to 3 */