aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-12-07 16:02:07 +0100
committerMarek Olšák <[email protected]>2014-12-10 21:59:37 +0100
commit508c1ca6af665a93d7e3f20203e9fb5d59975832 (patch)
tree837cd9ea08870a19486d7ae3691f75a377fbe078 /src/gallium
parentc6546cfb03e4f8bf5bea8def990248fcd70597ba (diff)
radeonsi: si_conv_pipe_prim shouldn't fail
An assertion should suffice. Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index e1b5f65ed4f..e87bc3c2661 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -341,7 +341,7 @@ void si_shader_init_pm4_state(struct si_shader *shader)
* Drawing
*/
-static unsigned si_conv_pipe_prim(unsigned pprim)
+static unsigned si_conv_pipe_prim(unsigned mode)
{
static const unsigned prim_conv[] = {
[PIPE_PRIM_POINTS] = V_008958_DI_PT_POINTLIST,
@@ -360,11 +360,8 @@ static unsigned si_conv_pipe_prim(unsigned pprim)
[PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY] = V_008958_DI_PT_TRISTRIP_ADJ,
[R600_PRIM_RECTANGLE_LIST] = V_008958_DI_PT_RECTLIST
};
- unsigned result = prim_conv[pprim];
- if (result == ~0) {
- R600_ERR("unsupported primitive type %d\n", pprim);
- }
- return result;
+ assert(mode < Elements(prim_conv));
+ return prim_conv[mode];
}
static unsigned si_conv_prim_to_gs_out(unsigned mode)
@@ -465,11 +462,6 @@ static bool si_update_draw_info_state(struct si_context *sctx,
if (pm4 == NULL)
return false;
- if (prim == ~0) {
- FREE(pm4);
- return false;
- }
-
if (sctx->b.chip_class >= CIK) {
si_pm4_set_reg(pm4, R_028B74_VGT_DISPATCH_DRAW_INDEX,
ib->index_size == 4 ? 0xFC000000 : 0xFC00);