From: Marek Olšák Date: Mon, 26 Apr 2010 04:35:21 +0000 (+0200) Subject: r300g: support rendering more than 65535 vertices in one batch on r500 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54bcee1e40aae9dee750f901f85fd08706bd9321;p=mesa.git r300g: support rendering more than 65535 vertices in one batch on r500 and disable batch splitting on these chipsets. --- diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 8e2acc4ac32..5c3380d9c1b 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -41,9 +41,6 @@ #include "r300_render.h" #include "r300_state_derived.h" -/* XXX The DRM rejects VAP_ALT_NUM_VERTICES.. */ -//#define ENABLE_ALT_NUM_VERTS - static uint32_t r300_translate_primitive(unsigned prim) { switch (prim) { @@ -265,11 +262,7 @@ void r500_emit_draw_arrays(struct r300_context *r300, unsigned mode, unsigned count) { -#if defined(ENABLE_ALT_NUM_VERTS) boolean alt_num_verts = count > 65535; -#else - boolean alt_num_verts = FALSE; -#endif CS_LOCALS(r300); if (alt_num_verts) { @@ -307,11 +300,7 @@ void r500_emit_draw_elements(struct r300_context *r300, { uint32_t count_dwords; uint32_t offset_dwords = indexSize * start / sizeof(uint32_t); -#if defined(ENABLE_ALT_NUM_VERTS) boolean alt_num_verts = count > 65535; -#else - boolean alt_num_verts = FALSE; -#endif CS_LOCALS(r300); if (count >= (1 << 24)) { @@ -541,12 +530,9 @@ void r300_draw_range_elements(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); struct pipe_resource* orgIndexBuffer = indexBuffer; -#if defined(ENABLE_ALT_NUM_VERTS) boolean alt_num_verts = r300->screen->caps.is_r500 && - count > 65536; -#else - boolean alt_num_verts = FALSE; -#endif + count > 65536 && + r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0); unsigned short_count; if (r300->skip_rendering) { @@ -622,12 +608,9 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, unsigned start, unsigned count) { struct r300_context* r300 = r300_context(pipe); -#if defined(ENABLE_ALT_NUM_VERTS) boolean alt_num_verts = r300->screen->caps.is_r500 && - count > 65536; -#else - boolean alt_num_verts = FALSE; -#endif + count > 65536 && + r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0); unsigned short_count; if (r300->skip_rendering) {