This fixes two bugs, one in clearing and one in sign extensions
for S8 only types, and enables it for use.
These are useful for vulkan support later.
v2: move casting to same place as Z casting.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
LLVMConstVector(shuffles, zs_type.length), "");
*s_fb = *z_fb;
+ if (format_desc->block.bits == 8) {
+ /* Extend stencil-only 8 bit values (S8_UINT) */
+ *s_fb = LLVMBuildZExt(builder, *s_fb,
+ lp_build_int_vec_type(gallivm, z_src_type), "");
+ }
+
if (format_desc->block.bits < z_src_type.width) {
/* Extend destination ZS values (e.g., when reading from Z16_UNORM) */
*z_fb = LLVMBuildZExt(builder, *z_fb,
switch (block_size) {
case 1:
assert(clear_mask == 0xff);
- memset(dst, (uint8_t) clear_value, height * width);
+ for (i = 0; i < height; i++) {
+ uint8_t *row = (uint8_t *)dst;
+ memset(row, (uint8_t) clear_value, width);
+ dst += dst_stride;
+ }
break;
case 2:
if (clear_mask == 0xffff) {
if (format_desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS)
return false;
-
- /* TODO: Support stencil-only formats */
- if (format_desc->swizzle[0] == PIPE_SWIZZLE_NONE) {
- return false;
- }
}
if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC ||