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