mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 16:00:09 +01:00
pvr, pco: handle stencil input attachments
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
d9e5183875
commit
6d051ce480
3 changed files with 9 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ typedef struct _pco_fs_data {
|
|||
enum pipe_format ia_formats[8];
|
||||
|
||||
uint8_t ia_tile_buffers;
|
||||
uint8_t ia_has_stencil;
|
||||
|
||||
unsigned num_tile_buffers;
|
||||
|
||||
|
|
|
|||
|
|
@ -185,6 +185,11 @@ lower_image_derefs(nir_builder *b, nir_intrinsic_instr *intr, pco_data *data)
|
|||
unsigned ia_idx = var->data.index;
|
||||
bool onchip = data->fs.ia_formats[ia_idx] != PIPE_FORMAT_NONE;
|
||||
|
||||
bool is_stencil = data->fs.ia_has_stencil & BITFIELD_BIT(ia_idx);
|
||||
is_stencil &= glsl_get_sampler_result_type(glsl_without_array_or_matrix(
|
||||
var->type)) != GLSL_TYPE_FLOAT;
|
||||
onchip &= !is_stencil;
|
||||
|
||||
if (onchip) {
|
||||
nir_def *elem = array_elem_from_deref(b, deref);
|
||||
nir_def *index = nir_vec4(b,
|
||||
|
|
|
|||
|
|
@ -2019,6 +2019,7 @@ static void pvr_init_fs_input_attachments(
|
|||
continue;
|
||||
|
||||
VkFormat vk_format = pass->attachments[idx].vk_format;
|
||||
bool has_stencil = vk_format_has_stencil(vk_format);
|
||||
if (hw_subpass->input_access[u].type ==
|
||||
PVR_RENDERPASS_HWSETUP_INPUT_ACCESS_ONCHIP_ZREPLICATE) {
|
||||
vk_format = VK_FORMAT_R32_SFLOAT;
|
||||
|
|
@ -2026,6 +2027,8 @@ static void pvr_init_fs_input_attachments(
|
|||
|
||||
fs->ia_formats[u] = vk_format_to_pipe_format(vk_format);
|
||||
assert(fs->ia_formats[u] != PIPE_FORMAT_NONE);
|
||||
if (has_stencil)
|
||||
fs->ia_has_stencil |= BITFIELD_BIT(u);
|
||||
|
||||
unsigned mrt_idx = hw_subpass->input_access[u].on_chip_rt;
|
||||
const struct usc_mrt_resource *mrt_resource =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue