mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 20:24:30 +08:00
zink: set zink_resource_object::host_visible based on actual bo placement
the properties determined before allocation may not be the same as what gets allocated Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13849>
This commit is contained in:
parent
74d2e89201
commit
8f97af050e
@ -647,11 +647,6 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
|
||||
assert(reqs.memoryTypeBits & BITFIELD_BIT(mai.memoryTypeIndex));
|
||||
}
|
||||
|
||||
VkMemoryType mem_type = screen->info.mem_props.memoryTypes[mai.memoryTypeIndex];
|
||||
obj->coherent = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||
if (!(templ->flags & PIPE_RESOURCE_FLAG_SPARSE))
|
||||
obj->host_visible = mem_type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
|
||||
VkMemoryDedicatedAllocateInfo ded_alloc_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
|
||||
.pNext = mai.pNext,
|
||||
@ -717,6 +712,11 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
|
||||
obj->size = zink_bo_get_size(obj->bo);
|
||||
}
|
||||
|
||||
obj->coherent = obj->bo->base.placement & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||
if (!(templ->flags & PIPE_RESOURCE_FLAG_SPARSE)) {
|
||||
obj->host_visible = obj->bo->base.placement & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
}
|
||||
|
||||
if (templ->target == PIPE_BUFFER) {
|
||||
if (!(templ->flags & PIPE_RESOURCE_FLAG_SPARSE))
|
||||
if (VKSCR(BindBufferMemory)(screen->dev, obj->buffer, zink_bo_get_mem(obj->bo), obj->offset) != VK_SUCCESS)
|
||||
|
Loading…
Reference in New Issue
Block a user