summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nvfx_transfer.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-03-17 20:31:56 +0100
committerLuca Barbieri <luca@luca-barbieri.com>2010-03-23 15:40:41 +0100
commita6cc9cf38d6e01d39b34f17a51c42e2d4962c0c9 (patch)
tree95fb637578f50a1e1ddd9539239a67515700eede /src/gallium/drivers/nvfx/nvfx_transfer.c
parentc652ad907f0715a0c23476ebd48ab722c96a5064 (diff)
nvfx: stop incessantly spewing debug messages on the terminal
Currently we are continuously spewing messages about these variables since we call debug_get_bool_option everytime we want to check their value. This is annoying, slows things down due to terminal rerendering and obscures useful messages. This patch only calls debug_get_bool_option once and caches the result in a static variable.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_transfer.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_transfer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_transfer.c b/src/gallium/drivers/nvfx/nvfx_transfer.c
index 409b354d58..c81b44a789 100644
--- a/src/gallium/drivers/nvfx/nvfx_transfer.c
+++ b/src/gallium/drivers/nvfx/nvfx_transfer.c
@@ -42,6 +42,9 @@ nvfx_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt,
struct nvfx_miptree *mt = (struct nvfx_miptree *)pt;
struct nvfx_transfer *tx;
struct pipe_texture tx_tex_template, *tx_tex;
+ static int no_transfer = -1;
+ if(no_transfer < 0)
+ no_transfer = debug_get_bool_option("NOUVEAU_NO_TRANSFER", TRUE/*XXX:FALSE*/);
tx = CALLOC_STRUCT(nvfx_transfer);
if (!tx)
@@ -59,8 +62,7 @@ nvfx_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt,
tx->base.zslice = zslice;
/* Direct access to texture */
- if ((pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC ||
- debug_get_bool_option("NOUVEAU_NO_TRANSFER", TRUE/*XXX:FALSE*/)) &&
+ if ((pt->tex_usage & PIPE_TEXTURE_USAGE_DYNAMIC || no_transfer) &&
pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)
{
tx->direct = true;