mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 17:00:09 +01:00
zink: force 4 component formats for samplerview/render textures
this fixes a bunch of issues with 3-component formats, which aren't supported for various operations on certain drivers Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8697>
This commit is contained in:
parent
b45c8a8671
commit
84821964eb
1 changed files with 10 additions and 2 deletions
|
|
@ -669,8 +669,16 @@ zink_is_format_supported(struct pipe_screen *pscreen,
|
|||
return false;
|
||||
|
||||
if (bind & PIPE_BIND_SAMPLER_VIEW &&
|
||||
!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))
|
||||
return false;
|
||||
!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))
|
||||
return false;
|
||||
|
||||
if ((bind & PIPE_BIND_SAMPLER_VIEW) || (bind & PIPE_BIND_RENDER_TARGET)) {
|
||||
/* if this is a 3-component texture, force gallium to give us 4 components by rejecting this one */
|
||||
const struct util_format_description *desc = util_format_description(format);
|
||||
if (desc->nr_channels == 3 &&
|
||||
(desc->block.bits == 24 || desc->block.bits == 48 || desc->block.bits == 96))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bind & PIPE_BIND_DEPTH_STENCIL &&
|
||||
!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue