diff options
author | Roland Scheidegger <[email protected]> | 2013-05-21 22:51:15 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-05-22 22:57:27 +0200 |
commit | 5314f5d82972a1a7a8ccd9d828e66db3fcdbd412 (patch) | |
tree | 6e2d2fd073d1891087fcd162292ddd6210af4875 /src/gallium/drivers/llvmpipe | |
parent | 6d20e251f25b47c19a5fcd80d9aa30bf75367590 (diff) |
llvmpipe: fix bug in early depth test / late depth write handling
Using wrong type if the format was less than 32bits.
No piglit changes as it doesn't hit that path.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_depth.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c index 2376ca73c51..08138f0ad7d 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c @@ -680,15 +680,15 @@ lp_build_depth_stencil_write_swizzled(struct gallivm_state *gallivm, LLVMTypeRef load_ptr_type; unsigned depth_bytes = format_desc->block.bits / 8; struct lp_type zs_type = lp_depth_type(format_desc, z_src_type.length); + struct lp_type z_type = zs_type; struct lp_type zs_load_type = zs_type; zs_load_type.length = zs_load_type.length / 2; load_ptr_type = LLVMPointerType(lp_build_vec_type(gallivm, zs_load_type), 0); - if (zs_type.width > 32) - zs_type.width = 32; + z_type.width = z_src_type.width; - lp_build_context_init(&z_bld, gallivm, zs_type); + lp_build_context_init(&z_bld, gallivm, z_type); /* * This is far from ideal, at least for late depth write we should do this @@ -742,7 +742,8 @@ lp_build_depth_stencil_write_swizzled(struct gallivm_state *gallivm, if (zs_type.width < z_src_type.width) { /* Truncate ZS values (e.g., when writing to Z16_UNORM) */ - z_value = LLVMBuildTrunc(builder, z_value, z_bld.vec_type, ""); + z_value = LLVMBuildTrunc(builder, z_value, + lp_build_int_vec_type(gallivm, zs_type), ""); } if (format_desc->block.bits <= 32) { @@ -762,9 +763,9 @@ lp_build_depth_stencil_write_swizzled(struct gallivm_state *gallivm, } else { if (z_src_type.length == 4) { - zs_dst1 = lp_build_interleave2(gallivm, zs_type, + zs_dst1 = lp_build_interleave2(gallivm, z_type, z_value, s_value, 0); - zs_dst2 = lp_build_interleave2(gallivm, zs_type, + zs_dst2 = lp_build_interleave2(gallivm, z_type, z_value, s_value, 1); } else { |