st/pbo_compute: special case stencil extraction from Z24S8
this otherwise tries to use the depth component and a UNORM format, which returns all zeroes cc: mesa-stable Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29841>
This commit is contained in:

committed by
Marge Bot

parent
968163524a
commit
ef0a156670
@@ -95,6 +95,7 @@ get_convert_format(struct gl_context *ctx,
|
||||
struct st_context *st = st_context(ctx);
|
||||
GLint bpp = _mesa_bytes_per_pixel(format, type);
|
||||
if (_mesa_is_depth_format(format) ||
|
||||
format == GL_STENCIL_INDEX ||
|
||||
format == GL_GREEN_INTEGER ||
|
||||
format == GL_BLUE_INTEGER) {
|
||||
switch (bpp) {
|
||||
@@ -1264,6 +1265,10 @@ st_GetTexSubImage_shader(struct gl_context * ctx,
|
||||
if (src_format == PIPE_FORMAT_NONE)
|
||||
return false;
|
||||
|
||||
/* special case for stencil extraction */
|
||||
if (format == GL_STENCIL_INDEX && util_format_is_depth_and_stencil(src_format))
|
||||
src_format = PIPE_FORMAT_X24S8_UINT;
|
||||
|
||||
if (texImage->_BaseFormat != _mesa_get_format_base_format(texImage->TexFormat)) {
|
||||
/* special handling for drivers that don't support these formats natively */
|
||||
if (texImage->_BaseFormat == GL_LUMINANCE)
|
||||
|
Reference in New Issue
Block a user