浏览代码

draw: don't crash if GS doesn't emit anything

Technically it's legal for geometry shader to not emit any
vertices. It's silly, but perfectly legal, so lets make draw
stop crashing if it happens.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
tags/mesa-9.2-rc1
Zack Rusin 12 年前
父节点
当前提交
d48054ff22

+ 9
- 0
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c 查看文件

@@ -299,6 +299,15 @@ static void fetch_pipeline_generic( struct draw_pt_middle_end *middle,
}
}
}
if (prim_info->count == 0) {
debug_printf("GS/IA didn't emit any vertices!\n");
FREE(vert_info->verts);
if (free_prim_info) {
FREE(prim_info->primitive_lengths);
}
return;
}


/* Stream output needs to be done before clipping.

+ 9
- 0
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c 查看文件

@@ -397,6 +397,15 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
}
}
}
if (prim_info->count == 0) {
debug_printf("GS/IA didn't emit any vertices!\n");
FREE(vert_info->verts);
if (free_prim_info) {
FREE(prim_info->primitive_lengths);
}
return;
}

/* stream output needs to be done before clipping */
draw_pt_so_emit( fpme->so_emit, vert_info, prim_info );

正在加载...
取消
保存