swr: Remove hard-coded constant and "todo" comment.
authorBruce Cherniak <bruce.cherniak@intel.com>
Wed, 12 Jul 2017 20:04:45 +0000 (15:04 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 12 Jul 2017 21:56:40 +0000 (16:56 -0500)
Removed the hard-coded constant in favor of a #define.  Also removed
TODO comment.  The constant value doesn't need an environment
configurable option.

Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/swr_scratch.cpp

index 6a9ab10ee2f3cecd5f698804ed0ec0a129085770..d298a48dc0bbe61fd18d87ec55456125d805f230 100644 (file)
@@ -28,6 +28,7 @@
 #include "swr_fence_work.h"
 #include "api.h"
 
+#define SCRATCH_SINGLE_ALLOCATION_LIMIT 2048
 
 void *
 swr_copy_to_scratch_space(struct swr_context *ctx,
@@ -39,7 +40,7 @@ swr_copy_to_scratch_space(struct swr_context *ctx,
    assert(space);
    assert(size);
 
-   if (size >= 2048) { /* XXX TODO create KNOB_ for this */
+   if (size >= SCRATCH_SINGLE_ALLOCATION_LIMIT) {
       /* Use per draw SwrAllocDrawContextMemory for larger copies */
       ptr = ctx->api.pfnSwrAllocDrawContextMemory(ctx->swrContext, size, 4);
    } else {