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/gallivm | |
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/gallivm')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index c0bd7bec193..2d7f32d308d 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -3855,8 +3855,8 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, * were forgetting so we're using MAX_VERTEX_VARYING from * that spec even though we could debug_assert if it's not * set, but that's a lot uglier. */ - uint max_output_vertices = 32; - uint i = 0; + uint max_output_vertices; + /* inputs are always indirect with gs */ bld.indirect_files |= (1 << TGSI_FILE_INPUT); bld.gs_iface = gs_iface; @@ -3864,12 +3864,11 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, bld.bld_base.op_actions[TGSI_OPCODE_EMIT].emit = emit_vertex; bld.bld_base.op_actions[TGSI_OPCODE_ENDPRIM].emit = end_primitive; - for (i = 0; i < info->num_properties; ++i) { - if (info->properties[i].name == - TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES) { - max_output_vertices = info->properties[i].data[0]; - } - } + max_output_vertices = + info->properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES][0]; + if (!max_output_vertices) + max_output_vertices = 32; + bld.max_output_vertices_vec = lp_build_const_int_vec(gallivm, bld.bld_base.int_bld.type, max_output_vertices); |