From 9f8c01b03c168f6cf7aa12046be73e0fc46940c6 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 10 Feb 2016 21:57:52 -0800 Subject: [PATCH] i965/gs: Pass VerticesIn though prog_data Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_compiler.h | 2 ++ src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 2 ++ src/mesa/drivers/dri/i965/gen8_gs_state.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h index b8423ec1342..27a95a3c661 100644 --- a/src/mesa/drivers/dri/i965/brw_compiler.h +++ b/src/mesa/drivers/dri/i965/brw_compiler.h @@ -626,6 +626,8 @@ struct brw_gs_prog_data { struct brw_vue_prog_data base; + unsigned vertices_in; + /** * Size of an output vertex, measured in HWORDS (32 bytes). */ diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp index 1b63d568d85..3f30f5b92d1 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp @@ -773,6 +773,8 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data, prog_data->output_topology = get_hw_prim_for_gl_prim(shader->info.gs.output_primitive); + prog_data->vertices_in = shader->info.gs.vertices_in; + /* The GLSL linker will have already matched up GS inputs and the outputs * of prior stages. The driver does extend VS outputs in some cases, but * only for legacy OpenGL or Gen4-5 hardware, neither of which offer diff --git a/src/mesa/drivers/dri/i965/gen8_gs_state.c b/src/mesa/drivers/dri/i965/gen8_gs_state.c index 6738e85eaba..c3cdb2f4350 100644 --- a/src/mesa/drivers/dri/i965/gen8_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen8_gs_state.c @@ -48,7 +48,7 @@ gen8_upload_gs_state(struct brw_context *brw) OUT_BATCH(_3DSTATE_GS << 16 | (10 - 2)); OUT_BATCH(stage_state->prog_offset); OUT_BATCH(0); - OUT_BATCH(brw->geometry_program->VerticesIn | + OUT_BATCH(brw->gs.prog_data->vertices_in | ((ALIGN(stage_state->sampler_count, 4)/4) << GEN6_GS_SAMPLER_COUNT_SHIFT) | ((prog_data->base.binding_table.size_bytes / 4) << -- 2.30.2