summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_exec.h
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-02-08 18:42:17 -0800
committerRoland Scheidegger <[email protected]>2013-02-08 18:54:40 -0800
commit75d99673a8f47f62458034b0566d6c0221fae5d1 (patch)
treee55fb994549b7747626e3f66a1d9c04e2a8e0e19 /src/gallium/auxiliary/tgsi/tgsi_exec.h
parent4f1d757b8617e83f6a5e55f8dd9c8ddd45e32da3 (diff)
softpipe: clean up lod computation
This should handle the new lod_zero modifier more correctly. The runtime-conditional is a bit more complex however we now also do scalar lod computation when appropriate which should more than make up for it. The refactoring should also fix an issue with explicit lods (lod clamp wasn't applied to them). Also, always pass lod as the 5th element from tgsi executor, which simplifies things (get rid of annoying conditionals later). v2: based on Brian's feedback, use switch in a couple of places, fix up some function parameter names, fix up comments. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.h')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index 1a7d979ca21..a66c9197f75 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -89,8 +89,11 @@ struct tgsi_interp_coef
};
enum tgsi_sampler_control {
+ tgsi_sampler_lod_none,
tgsi_sampler_lod_bias,
- tgsi_sampler_lod_explicit
+ tgsi_sampler_lod_explicit,
+ tgsi_sampler_lod_zero
+ /* FIXME: tgsi_sampler_derivs_explicit */
};
/**
@@ -107,15 +110,14 @@ struct tgsi_sampler
layer for 1D arrays.
* p - the third coordinate for sampling for 3D, cube, cube arrays,
* layer for 2D arrays. Compare value for 1D/2D shadows.
- * c0 - lod value for lod variants, compare value for shadow cube
- * and shadow 2d arrays.
- * c1 - cube array only - lod for cube map arrays
- * compare for shadow cube map arrays.
+ * c0 - Compare value for shadow cube and shadow 2d arrays,
+ * layer for cube arrays.
+ * lod - lod value, except for shadow cube arrays (compare value there).
*/
void (*get_samples)(struct tgsi_sampler *sampler,
const float s[TGSI_QUAD_SIZE],
const float t[TGSI_QUAD_SIZE],
- const float p[TGSI_QUAD_SIZE],
+ const float r[TGSI_QUAD_SIZE],
const float c0[TGSI_QUAD_SIZE],
const float c1[TGSI_QUAD_SIZE],
enum tgsi_sampler_control control,