aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_sample.h
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-08-19 21:12:59 +0200
committerRoland Scheidegger <[email protected]>2013-08-20 23:00:24 +0200
commitac1a2714c78ab8bc9853478780dc27075d025080 (patch)
treeee5a9a93501877c0f8b0b106f2a7ba36624c3b1a /src/gallium/auxiliary/gallivm/lp_bld_sample.h
parentd427278a2de4c7f492ed1b7f0d342788ce2bbf4e (diff)
gallivm: implement better control of per-quad/per-element/scalar lod
There's a new debug value used to disable per-quad lod optimizations in fragment shader (ignored for vs/gs as the results are just too wrong typically). Also trying to detect if a supplied lod value is really a scalar (if it's coming from immediate or constant file) in which case sampler code can use this to stay on per-quad-lod path (in fact for explicit lod could simplify even further and use same lod for both quads in the avx case but this is not implemented yet). Still need to actually implement per-element lod bias (and derivatives), and need to handle per-element lod in size queries. v2: fix comments, prettify. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.h')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
index 6d8fe8890d6..6d173770da7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
@@ -61,6 +61,13 @@ struct lp_derivatives
};
+enum lp_sampler_lod_property {
+ LP_SAMPLER_LOD_SCALAR,
+ LP_SAMPLER_LOD_PER_ELEMENT,
+ LP_SAMPLER_LOD_PER_QUAD
+};
+
+
/**
* Texture static state.
*
@@ -476,7 +483,7 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
const struct lp_derivatives *derivs,
LLVMValueRef lod_bias,
LLVMValueRef explicit_lod,
- boolean scalar_lod,
+ enum lp_sampler_lod_property lod_property,
LLVMValueRef texel_out[4]);
@@ -497,7 +504,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
unsigned texture_unit,
unsigned target,
boolean is_sviewinfo,
- boolean scalar_lod,
+ enum lp_sampler_lod_property lod_property,
LLVMValueRef explicit_lod,
LLVMValueRef *sizes_out);