summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm_sample.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-07-04 19:40:11 +0200
committerRoland Scheidegger <sroland@vmware.com>2013-07-04 19:42:04 +0200
commitf3bbf65929e395360e5565d08d015977dd5b79fa (patch)
tree75da0af344f282ea76a965f0b9f9af466837c0a7 /src/gallium/auxiliary/draw/draw_llvm_sample.c
parentbbd1e60198548a12be3405fc32dd39a87e8968ab (diff)
downloadexternal_mesa3d-f3bbf65929e395360e5565d08d015977dd5b79fa.zip
external_mesa3d-f3bbf65929e395360e5565d08d015977dd5b79fa.tar.gz
external_mesa3d-f3bbf65929e395360e5565d08d015977dd5b79fa.tar.bz2
gallivm: do per-pixel lod calculations for explicit lod
d3d10 requires per-pixel lod calculations for explicit lod, lod bias and explicit derivatives, and we should probably do it for OpenGL too - at least if they are used from vertex or geometry shaders (so doesn't apply to lod bias) this doesn't just affect neighboring pixels. Some code was already there to handle this so fix it up and enable it. There will no doubt be a performance hit unfortunately, we could do better if we'd knew we had a real vector shift instruction (with variable shift count) but this requires AVX2 on x86 (or a AMD Bulldozer family cpu). Don't do anything for lod bias and explicit derivatives yet, though no special magic should be needed for them neither. Likewise, the size query is still broken just the same. v2: Use information if lod is a (broadcast) scalar or not. The idea would be to base this on the actual value, for now just pretend it's a scalar in fs and not a scalar otherwise (so, per-pixel lod is only used in gs/vs but same code is generated for fs as before). Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm_sample.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm_sample.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c
index e51e011..0cb5c21 100644
--- a/src/gallium/auxiliary/draw/draw_llvm_sample.c
+++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c
@@ -238,6 +238,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
const struct lp_derivatives *derivs,
LLVMValueRef lod_bias, /* optional */
LLVMValueRef explicit_lod, /* optional */
+ boolean scalar_lod,
LLVMValueRef *texel)
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
@@ -256,7 +257,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
coords,
offsets,
derivs,
- lod_bias, explicit_lod,
+ lod_bias, explicit_lod, scalar_lod,
texel);
}