Mesa (master): swr: Remove hard-coded constant and "todo" comment.

Tim Rowley torowley at kemper.freedesktop.org
Wed Jul 12 21:58:41 UTC 2017


Module: Mesa
Branch: master
Commit: 5bd9554f3d35951f4d182b460f8ea5fb3bb04e02
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5bd9554f3d35951f4d182b460f8ea5fb3bb04e02

Author: Bruce Cherniak <bruce.cherniak at intel.com>
Date:   Wed Jul 12 15:04:45 2017 -0500

swr: Remove hard-coded constant and "todo" comment.

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 at intel.com>

---

 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 6a9ab10ee2..d298a48dc0 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 = ctx->api.pfnSwrAllocDrawContextMemory(ctx->swrContext, size, 4);
    } else {




More information about the mesa-commit mailing list