mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
llvmpipe: Use the generic conversion routine for depths.
This allows for z32f depth format to work correctly.
This commit is contained in:
parent
14dc02a1b2
commit
1acf7a09e7
1 changed files with 18 additions and 7 deletions
|
|
@ -147,6 +147,20 @@ generate_depth(LLVMBuilderRef builder,
|
|||
format_desc = util_format_description(key->zsbuf_format);
|
||||
assert(format_desc);
|
||||
|
||||
/*
|
||||
* Depths are expected to be between 0 and 1, even if they are stored in
|
||||
* floats. Setting these bits here will ensure that the lp_build_conv() call
|
||||
* below won't try to unnecessarily clamp the incoming values.
|
||||
*/
|
||||
if(src_type.floating) {
|
||||
src_type.sign = FALSE;
|
||||
src_type.norm = TRUE;
|
||||
}
|
||||
else {
|
||||
assert(!src_type.sign);
|
||||
assert(src_type.norm);
|
||||
}
|
||||
|
||||
/* Pick the depth type. */
|
||||
dst_type = lp_depth_type(format_desc, src_type.width*src_type.length);
|
||||
|
||||
|
|
@ -154,14 +168,11 @@ generate_depth(LLVMBuilderRef builder,
|
|||
assert(dst_type.width == src_type.width);
|
||||
assert(dst_type.length == src_type.length);
|
||||
|
||||
#if 1
|
||||
src = lp_build_clamped_float_to_unsigned_norm(builder,
|
||||
src_type,
|
||||
dst_type.width,
|
||||
src);
|
||||
#else
|
||||
lp_build_conv(builder, src_type, dst_type, &src, 1, &src, 1);
|
||||
#endif
|
||||
|
||||
dst_ptr = LLVMBuildBitCast(builder,
|
||||
dst_ptr,
|
||||
LLVMPointerType(lp_build_vec_type(dst_type), 0), "");
|
||||
|
||||
lp_build_depth_test(builder,
|
||||
&key->depth,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue