early-access version 1900

This commit is contained in:
pineappleEA 2021-07-20 22:03:23 +02:00
parent 3566a37956
commit 4e5607f418
3 changed files with 37 additions and 23 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1899. This is the source code for early-access 1900.
## Legal Notice ## Legal Notice

View file

@ -123,7 +123,7 @@ private:
bool has_broken_texture_view_formats = false; bool has_broken_texture_view_formats = false;
StagingBuffers upload_buffers{GL_MAP_WRITE_BIT, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT}; StagingBuffers upload_buffers{GL_MAP_WRITE_BIT, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT};
StagingBuffers download_buffers{GL_MAP_READ_BIT, GL_MAP_READ_BIT}; StagingBuffers download_buffers{GL_MAP_READ_BIT | GL_CLIENT_STORAGE_BIT, GL_MAP_READ_BIT};
OGLTexture null_image_1d_array; OGLTexture null_image_1d_array;
OGLTexture null_image_cube_array; OGLTexture null_image_cube_array;

View file

@ -763,7 +763,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src,
dst_range.AddLayers(copy.dstSubresource); dst_range.AddLayers(copy.dstSubresource);
src_range.AddLayers(copy.srcSubresource); src_range.AddLayers(copy.srcSubresource);
} }
const std::array read_barriers{ const std::array pre_barriers{
VkImageMemoryBarrier{ VkImageMemoryBarrier{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.pNext = nullptr, .pNext = nullptr,
@ -772,7 +772,7 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src,
VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL, .oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_GENERAL, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = src_image, .image = src_image,
@ -793,29 +793,43 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src,
.subresourceRange = dst_range.SubresourceRange(aspect_mask), .subresourceRange = dst_range.SubresourceRange(aspect_mask),
}, },
}; };
const VkImageMemoryBarrier write_barrier{ const std::array post_barriers{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, VkImageMemoryBarrier{
.pNext = nullptr, .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, .pNext = nullptr,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | .srcAccessMask = 0,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | .dstAccessMask = 0,
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | .newLayout = VK_IMAGE_LAYOUT_GENERAL,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, .image = src_image,
.newLayout = VK_IMAGE_LAYOUT_GENERAL, .subresourceRange = src_range.SubresourceRange(aspect_mask),
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, },
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, VkImageMemoryBarrier{
.image = dst_image, .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.subresourceRange = dst_range.SubresourceRange(aspect_mask), .pNext = nullptr,
.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT |
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT |
VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = dst_image,
.subresourceRange = dst_range.SubresourceRange(aspect_mask),
},
}; };
cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
0, {}, {}, read_barriers); 0, {}, {}, pre_barriers);
cmdbuf.CopyImage(src_image, VK_IMAGE_LAYOUT_GENERAL, dst_image, cmdbuf.CopyImage(src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst_image,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, vk_copies); VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, vk_copies);
cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
0, write_barrier); 0, {}, {}, post_barriers);
}); });
} }