diff options
author | Marek Olšák <[email protected]> | 2014-09-30 15:48:22 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-10-04 15:16:14 +0200 |
commit | 8908fae243cb4c15a675006a1cc472f6c59b0d43 (patch) | |
tree | 144042cc0d57a340427827836ae245a89fa0249c /src/gallium/auxiliary/draw/draw_gs.c | |
parent | 5233568861b082ee288d845f447012fa47e8bd1e (diff) |
tgsi: simplify shader properties in tgsi_shader_info
Use an array of properties indexed by TGSI_PROPERTY_* definitions.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_gs.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index 878fccabc07..0c2f8922dc5 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -750,9 +750,6 @@ draw_create_geometry_shader(struct draw_context *draw, tgsi_scan_shader(state->tokens, &gs->info); /* setup the defaults */ - gs->input_primitive = PIPE_PRIM_TRIANGLES; - gs->output_primitive = PIPE_PRIM_TRIANGLE_STRIP; - gs->max_output_vertices = 32; gs->max_out_prims = 0; #ifdef HAVE_LLVM @@ -768,17 +765,15 @@ draw_create_geometry_shader(struct draw_context *draw, gs->vector_length = 1; } - for (i = 0; i < gs->info.num_properties; ++i) { - if (gs->info.properties[i].name == - TGSI_PROPERTY_GS_INPUT_PRIM) - gs->input_primitive = gs->info.properties[i].data[0]; - else if (gs->info.properties[i].name == - TGSI_PROPERTY_GS_OUTPUT_PRIM) - gs->output_primitive = gs->info.properties[i].data[0]; - else if (gs->info.properties[i].name == - TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES) - gs->max_output_vertices = gs->info.properties[i].data[0]; - } + gs->input_primitive = + gs->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM][0]; + gs->output_primitive = + gs->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM][0]; + gs->max_output_vertices = + gs->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES][0]; + if (!gs->max_output_vertices) + gs->max_output_vertices = 32; + /* Primitive boundary is bigger than max_output_vertices by one, because * the specification says that the geometry shader should exit if the * number of emitted vertices is bigger or equal to max_output_vertices and |