[Mesa-dev] [PATCH v2 1/3] swr: Remove hard-coded constant and "todo" comment.

Bruce Cherniak bruce.cherniak at intel.com
Wed Jul 12 20:04:45 UTC 2017


Removed the hard-coded constant in favor of a #define.  Also removed
TODO comment.  The constant value doesn't need an environment
configurable option.
---
 src/gallium/drivers/swr/swr_scratch.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/swr/swr_scratch.cpp b/src/gallium/drivers/swr/swr_scratch.cpp
index db095dea7e..ea49bbefba 100644
--- a/src/gallium/drivers/swr/swr_scratch.cpp
+++ b/src/gallium/drivers/swr/swr_scratch.cpp
@@ -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 = SwrAllocDrawContextMemory(ctx->swrContext, size, 4);
    } else {
-- 
2.11.0



More information about the mesa-dev mailing list