mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-16 05:21:22 +00:00
Revert "[TEST] New optimal image layouts access"
This reverts commit 236696b0ff.
This commit is contained in:
@@ -252,8 +252,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
void MarkAttachmentUse() noexcept {}
|
||||
|
||||
bool IsRescaled() const;
|
||||
|
||||
bool ScaleUp(bool ignore = false);
|
||||
|
||||
@@ -246,8 +246,7 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
|
||||
!image_view.SupportsDepthComparison()) {
|
||||
vk_sampler = sampler.HandleWithoutDepthComparison();
|
||||
}
|
||||
guest_descriptor_queue.AddSampledImage(vk_image_view, vk_sampler,
|
||||
image_view.SampledLayout());
|
||||
guest_descriptor_queue.AddSampledImage(vk_image_view, vk_sampler);
|
||||
const bool element_rescaled{texture_cache.IsRescaling(image_view)};
|
||||
is_rescaled |= element_rescaled;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ constexpr bool ENABLE_MSAA_RESOLVE_CONSUME = true;
|
||||
constexpr bool ENABLE_MSAA_COLOR_DISCARD = true;
|
||||
constexpr bool ENABLE_MSAA_DEPTH_DISCARD = true;
|
||||
constexpr bool ENABLE_MSAA_DEPTH_RESOLVE = true;
|
||||
constexpr bool ENABLE_OPTIMAL_IMAGE_LAYOUTS = true;
|
||||
|
||||
constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||
if (color == std::array<float, 4>{0, 0, 0, 0}) {
|
||||
@@ -2488,7 +2487,6 @@ bool Image::EnableStorageUsage() {
|
||||
commit(scaled_image, new_scaled, scaled_info);
|
||||
}
|
||||
wants_storage = true;
|
||||
current_layout = initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
storage_image_views.clear();
|
||||
storage_image_views.resize(info.resources.levels);
|
||||
scale_framebuffer.reset();
|
||||
@@ -2498,13 +2496,6 @@ bool Image::EnableStorageUsage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
VkImageLayout Image::PreferredLayout() const noexcept {
|
||||
if (!ENABLE_OPTIMAL_IMAGE_LAYOUTS || wants_storage || attachment_used) {
|
||||
return VK_IMAGE_LAYOUT_GENERAL;
|
||||
}
|
||||
return VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
}
|
||||
|
||||
bool Image::IsRescaled() const noexcept {
|
||||
return True(flags & ImageFlagBits::Rescaled);
|
||||
}
|
||||
@@ -2841,13 +2832,6 @@ bool ImageView::IsRescaled() const noexcept {
|
||||
return (*slot_images)[image_id].IsRescaled();
|
||||
}
|
||||
|
||||
VkImageLayout ImageView::SampledLayout() const noexcept {
|
||||
if (slot_images == nullptr) {
|
||||
return VK_IMAGE_LAYOUT_GENERAL;
|
||||
}
|
||||
return (*slot_images)[image_id].PreferredLayout();
|
||||
}
|
||||
|
||||
vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_mask,
|
||||
std::optional<Shader::TextureType> texture_type) {
|
||||
VkImageViewType view_type = ImageViewType(type);
|
||||
|
||||
@@ -399,20 +399,6 @@ public:
|
||||
|
||||
bool EnableStorageUsage();
|
||||
|
||||
[[nodiscard]] VkImageLayout PreferredLayout() const noexcept;
|
||||
|
||||
[[nodiscard]] VkImageLayout CurrentLayout() const noexcept {
|
||||
return current_layout;
|
||||
}
|
||||
|
||||
void SetCurrentLayout(VkImageLayout layout) noexcept {
|
||||
current_layout = layout;
|
||||
}
|
||||
|
||||
void MarkAttachmentUse() noexcept {
|
||||
attachment_used = true;
|
||||
}
|
||||
|
||||
bool IsRescaled() const noexcept;
|
||||
|
||||
bool ScaleUp(bool ignore = false);
|
||||
@@ -433,8 +419,6 @@ private:
|
||||
|
||||
bool storage_capable = false;
|
||||
bool wants_storage = false;
|
||||
bool attachment_used = false;
|
||||
VkImageLayout current_layout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
||||
vk::Image original_image;
|
||||
vk::Image scaled_image;
|
||||
@@ -487,8 +471,6 @@ public:
|
||||
|
||||
[[nodiscard]] bool IsRescaled() const noexcept;
|
||||
|
||||
[[nodiscard]] VkImageLayout SampledLayout() const noexcept;
|
||||
|
||||
[[nodiscard]] VkImageView Handle(Shader::TextureType texture_type) const noexcept {
|
||||
return *image_views[static_cast<size_t>(texture_type)];
|
||||
}
|
||||
|
||||
@@ -45,12 +45,11 @@ public:
|
||||
return upload_start;
|
||||
}
|
||||
|
||||
void AddSampledImage(VkImageView image_view, VkSampler sampler,
|
||||
VkImageLayout image_layout = VK_IMAGE_LAYOUT_GENERAL) {
|
||||
void AddSampledImage(VkImageView image_view, VkSampler sampler) {
|
||||
*(payload_cursor++) = VkDescriptorImageInfo{
|
||||
.sampler = sampler,
|
||||
.imageView = image_view,
|
||||
.imageLayout = image_layout,
|
||||
.imageLayout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -2788,7 +2788,6 @@ void TextureCache<P>::BindRenderTarget(ImageViewId* old_id, ImageViewId new_id)
|
||||
const PendingDownload new_download{true, 0, old_view.image_id};
|
||||
uncommitted_downloads.emplace_back(new_download);
|
||||
}
|
||||
slot_images[old_view.image_id].MarkAttachmentUse();
|
||||
}
|
||||
*old_id = new_id;
|
||||
}
|
||||
@@ -2797,7 +2796,6 @@ template <class P>
|
||||
std::pair<FramebufferId, ImageViewId> TextureCache<P>::RenderTargetFromImage(
|
||||
ImageId image_id, const ImageViewInfo& view_info) {
|
||||
const ImageViewId view_id = FindOrEmplaceImageView(image_id, view_info);
|
||||
slot_images[image_id].MarkAttachmentUse();
|
||||
const ImageBase& image = slot_images[image_id];
|
||||
const bool is_rescaled = True(image.flags & ImageFlagBits::Rescaled);
|
||||
const bool is_color = GetFormatType(image.info.format) == SurfaceType::ColorTexture;
|
||||
|
||||
Reference in New Issue
Block a user