It now calls get_isl_format to get both linear and tiled views of the
format and determines linear/tiled properties from that. Buffer properties
are determined from the linear format.
This commit does two things. First, it introduces choose_* functions for
chosing formats and aspects. Second, it changes the copy (not blit) code
to use appropreately sized UINT formats for everything except depth. There
are two main reasons for this: First, it means that compressed and other
non-renderable texture upload should "just work" because it won't be
tripping over non-renderable formats. Second, it allows us to easly copy
an RGB buffer to and from an RGBX image because the formats will get
switched over to their UINT variants and the shader will deal with the
extra channel for us.
We've been trying to move away from anv_format for a while and this should
help with the transition. There are cases (mostly in meta) where we need
the original format for the image and not the isl_format. These will be
moved over to the new vk_format and everythign else will use the isl_format
from the particular anv_surface.
Many formats are not power-of-two bytes per pixels and we need the
non-power-of-two align macro here.
This reverts the revert from 4f9a211b, but keeps the change from a827b553
that fixed the yuv if-else mix-up.
This avoids making a lot of small allocations and handles allocation
failure correctly.
Fixes dEQP-VK.api.object_management.alloc_callback_fail.* failures.
Failure during instance creation will leave instance->wayland_wsi
undefined. When we then try to clean that up we crash. Set
instance->wayland_wsi to NULL on failure and only clean it up if it's
non-NULL.
Fixes part of dEQP-VK.api.object_management.alloc_callback_fail.*
isl always aligned the row pitch to the surface's image alignment. This
was sometimes wrong when the surface backed a VkBuffer. For a VkBuffer,
the surface's row pitch is set by VkBufferImageCopy::bufferRowLength,
whose required alignment is only that of the VkFormat.
In particular, VkBuffer rows are packed in many dEQP and Crucible tests.
And packed rows are rarely aligned to the surface's image alignment.
Fixes: dEQP-VK.pipeline.image.view_type.2d.format.r8g8b8a8_unorm.size.13x13
They were completely bogus before. For one thing, OpDecorationGroup
created a value of type undef rather than decoration_group. Also
OpGroupMemberDecorate didn't properly apply the decoration to the different
members of the different groups. It *should* be correct now but there's no
good way to test it yet.
The kernel is going to give us whole pages anyway, so allocating part of a
page doesn't help. And this ensures that we can always work with whole
pages.
As per the spec:
minMemoryMapAlignment is the minimum required alignment, in bytes, of
host-visible memory allocations within the host address space. When
mapping a memory allocation with vkMapMemory, subtracting offset bytes
from the returned pointer will always produce a multiple of the value of
this limit.
First off, it now uses isl formats instead of anv_format. Also, it
properly handles integer vs. floating-point default channels and can
properly handle alpha-only channels. (Not sure if those are allowed).
Thanks to the addition of nir_clone, we now have a num_elements field in
nir_constant which we weren't setting. Also, constants have to be parented
to the variable they initialize, so we have to make a copy.
This is done by passing the entrypoint name into spirv_to_nir. It will
then process the shader as if that were the only entrypoint we care about.
Instead of returning a nir_shader, it now returns a nir_function.
When aligning to isl_format_layout::bs (which is the number of bytes in
the pixel), use isl_align_npot() instead of isl_align(), because
isl_align() works only for power-of-2 alignment.
Fixes assertion in
dEQP-VK.pipeline.image.view_type.1d.format.r16g16b16_sfloat.size.512x1.