r300g: support rendering more than 65535 vertices in one batch on r500
authorMarek Olšák <maraeo@gmail.com>
Mon, 26 Apr 2010 04:35:21 +0000 (06:35 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 26 Apr 2010 05:22:00 +0000 (07:22 +0200)
and disable batch splitting on these chipsets.

src/gallium/drivers/r300/r300_render.c

index 8e2acc4ac32fd302a17f4c4c7b9f1c67422883a2..5c3380d9c1b602cda312886feb9a199569113b7d 100644 (file)
@@ -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) {