Instead of trying to crawl through predecessor chains and build phi nodes,
we just do a poor-man's out-of-ssa on the spot. The into-SSA pass will
deal with putting the actual phi nodes in for us.
This is not really a cache yet, but it allows us to share one state
stream for all pipelines, which means we can bump the block size without
wasting a lot of memory.
gen7_filter_tiling() should filter out only tiling flags that are
incompatible with the surface. It shouldn't make performance decisions,
such as forcing linear for 1D; that's the role of the caller.
struct isl_format_layout contained two near-redundant members: bpb (bits
per block) and bs (block size). There do exist some hardware formats for
which bpb != 8 * bs, but Vulkan does not use them. Therefore we don't
need bpb.
Previously, anv_image_view had a anv_format pointer that we used for
everything. This commit replaces that pointer with a VkFormat enum copied
from the API and an isl_format. In order to implement RGB formats, we have
to use a different isl_format for the actual surface state than the obvious
one from the VkFormat. Separating the two helps us keep things streight.
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).