summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-12-18 15:55:07 +1000
committerDave Airlie <airlied@redhat.com>2014-02-05 10:49:39 +1000
commit20adc7449cc4abe2caf6d78d2c62cc0e6e86b87c (patch)
treea924d93be195c5611b3cad126f502f3e2ce84595 /src/gallium/drivers
parentdefebc0293a660155ef3027ee8cc65319379b2ed (diff)
r600g/gs: fix cases where number of gs inputs != number of gs outputs
this fixes a bunch of the geom shader built-in tests Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/r600_shader.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index f4a3194fe59..07b343bd5fe 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -285,6 +285,7 @@ struct r600_shader_ctx {
int fragcoord_input;
int native_integers;
int next_ring_offset;
+ int gs_out_ring_offset;
int gs_next_vertex;
struct r600_shader *gs_for_vs;
};
@@ -619,6 +620,9 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx)
ctx->cv_output = i;
break;
}
+ if (ctx->type == TGSI_PROCESSOR_GEOMETRY) {
+ ctx->gs_out_ring_offset += 16;
+ }
} else if (ctx->type == TGSI_PROCESSOR_FRAGMENT) {
switch (d->Semantic.Name) {
case TGSI_SEMANTIC_COLOR:
@@ -1313,7 +1317,7 @@ static int emit_gs_ring_writes(struct r600_shader_ctx *ctx)
/* next_ring_offset after parsing input decls contains total size of
* single vertex data, gs_next_vertex - current vertex index */
- ring_offset += ctx->next_ring_offset * ctx->gs_next_vertex;
+ ring_offset += ctx->gs_out_ring_offset * ctx->gs_next_vertex;
memset(&output, 0, sizeof(struct r600_bytecode_output));
output.gpr = ctx->shader->output[i].gpr;
@@ -1379,6 +1383,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
}
ctx.next_ring_offset = 0;
+ ctx.gs_out_ring_offset = 0;
ctx.gs_next_vertex = 0;
ctx.face_gpr = -1;