summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_sampler.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-09-16 10:45:52 +0100
committerKeith Whitwell <keithw@vmware.com>2010-09-16 17:34:19 +0100
commit5f00819cb382bdb70c29e2db3c6ff22a879bf10f (patch)
tree6c28495f4caef7c8610189ed011f50596b0e545c /src/gallium/drivers/llvmpipe/lp_state_sampler.c
parent045ee4601179c44f815ce3842ef900b36d54c914 (diff)
llvmpipe: add LP_PERF flag to disable various aspects of rasterization
Allows disabling various operations (mainly texture-related, but will grow) to try & identify bottlenecks. Unlike LP_DEBUG, this is active even in release builds - which is necessary for performance investigation.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_sampler.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_sampler.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
index 715ce2f02e..17a4a0ed02 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
@@ -37,6 +37,7 @@
#include "lp_context.h"
#include "lp_screen.h"
#include "lp_state.h"
+#include "lp_debug.h"
#include "state_tracker/sw_winsys.h"
@@ -44,7 +45,22 @@ static void *
llvmpipe_create_sampler_state(struct pipe_context *pipe,
const struct pipe_sampler_state *sampler)
{
- return mem_dup(sampler, sizeof(*sampler));
+ struct pipe_sampler_state *state = mem_dup(sampler, sizeof *sampler);
+
+ if (LP_PERF & PERF_NO_MIP_LINEAR) {
+ if (state->min_mip_filter == PIPE_TEX_MIPFILTER_LINEAR)
+ state->min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST;
+ }
+
+ if (LP_PERF & PERF_NO_MIPMAPS)
+ state->min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
+
+ if (LP_PERF & PERF_NO_LINEAR) {
+ state->mag_img_filter = PIPE_TEX_FILTER_NEAREST;
+ state->min_img_filter = PIPE_TEX_FILTER_NEAREST;
+ }
+
+ return state;
}