summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_bld_interp.h
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2016-08-20 04:03:11 +0200
committerRoland Scheidegger <[email protected]>2016-08-20 04:05:33 +0200
commit0849621891041498c7438080338ccea562440a9a (patch)
treeaef2cd8e6eccaa8386c6decff0c9e6e332efc73f /src/gallium/drivers/llvmpipe/lp_bld_interp.h
parentb0a647f284b24ca4e0ee1f70c4839d8ec3d1a4e6 (diff)
llvmpipe: fix issues with depth clamp
We only did depth clamp when the value was written from the fs. This is very wrong both for d3d10 and GL, and only passed the corresponding piglit test due to pure luck (it no longer does with the enhanced test). Also, interpolation clamped values to 1.0 always, which can legitimately happen if depth clip is disabled, so fix that as well (untested). There is one unresolved issue left, d3d10 always does depth clamping, whereas GL does not (but does [0,1] clamp instead for fs depth outputs) - this information isn't in any gallium state object, leave it as-is for now (though it looks like llvmpipe misses the [0,1] clamp as well). This (with the previous patch) fixes piglit depth-clamp-range test. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_interp.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.h b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
index 9029d2a4180..1b9ef5e878c 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
@@ -85,6 +85,7 @@ struct lp_build_interp_soa_context
unsigned mask[1 + PIPE_MAX_SHADER_INPUTS]; /**< TGSI_WRITE_MASK_x */
enum lp_interp interp[1 + PIPE_MAX_SHADER_INPUTS];
boolean simple_interp;
+ boolean depth_clamp;
double pos_offset;
@@ -116,6 +117,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
unsigned num_inputs,
const struct lp_shader_input *inputs,
boolean pixel_center_integer,
+ boolean depth_clamp,
LLVMBuilderRef builder,
struct lp_type type,
LLVMValueRef a0_ptr,