early-access version 3602

This commit is contained in:
pineappleEA 2023-05-22 08:51:16 +02:00
parent 4029a125f8
commit 44145b1f0a
9 changed files with 39 additions and 3 deletions

View file

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

View file

@ -144,6 +144,10 @@ public:
return state_tracker; return state_tracker;
} }
void CheckFeedbackLoop(ImageView& image_view) const noexcept {
// OpenGL does not require a barrier for attachment feedback loops.
}
private: private:
struct StagingBuffers { struct StagingBuffers {
explicit StagingBuffers(GLenum storage_flags_, GLenum map_flags_); explicit StagingBuffers(GLenum storage_flags_, GLenum map_flags_);

View file

@ -175,6 +175,7 @@ public:
std::array<f32, 4> words{}; std::array<f32, 4> words{};
}; };
template <bool CheckFeedbackLoop = false>
inline void PushImageDescriptors(TextureCache& texture_cache, inline void PushImageDescriptors(TextureCache& texture_cache,
GuestDescriptorQueue& guest_descriptor_queue, GuestDescriptorQueue& guest_descriptor_queue,
const Shader::Info& info, RescalingPushConstant& rescaling, const Shader::Info& info, RescalingPushConstant& rescaling,
@ -192,6 +193,9 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
const VkImageView vk_image_view{image_view.Handle(desc.type)}; const VkImageView vk_image_view{image_view.Handle(desc.type)};
guest_descriptor_queue.AddSampledImage(vk_image_view, sampler); guest_descriptor_queue.AddSampledImage(vk_image_view, sampler);
rescaling.PushTexture(texture_cache.IsRescaling(image_view)); rescaling.PushTexture(texture_cache.IsRescaling(image_view));
if constexpr (CheckFeedbackLoop) {
texture_cache.CheckFeedbackLoop(image_view);
}
} }
} }
for (const auto& desc : info.image_descriptors) { for (const auto& desc : info.image_descriptors) {
@ -203,6 +207,9 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
const VkImageView vk_image_view{image_view.StorageView(desc.type, desc.format)}; const VkImageView vk_image_view{image_view.StorageView(desc.type, desc.format)};
guest_descriptor_queue.AddImage(vk_image_view); guest_descriptor_queue.AddImage(vk_image_view);
rescaling.PushImage(texture_cache.IsRescaling(image_view)); rescaling.PushImage(texture_cache.IsRescaling(image_view));
if constexpr (CheckFeedbackLoop) {
texture_cache.CheckFeedbackLoop(image_view);
}
} }
} }
} }

View file

@ -457,8 +457,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
const VideoCommon::ImageViewInOut* views_it{views.data()}; const VideoCommon::ImageViewInOut* views_it{views.data()};
const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE { const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE {
buffer_cache.BindHostStageBuffers(stage); buffer_cache.BindHostStageBuffers(stage);
PushImageDescriptors(texture_cache, guest_descriptor_queue, stage_infos[stage], rescaling, PushImageDescriptors<true>(texture_cache, guest_descriptor_queue, stage_infos[stage],
samplers_it, views_it); rescaling, samplers_it, views_it);
const auto& info{stage_infos[0]}; const auto& info{stage_infos[0]};
if (info.uses_render_area) { if (info.uses_render_area) {
render_area.uses_render_area = true; render_area.uses_render_area = true;

View file

@ -106,6 +106,15 @@ public:
return *master_semaphore; return *master_semaphore;
} }
[[nodiscard]] bool IsRenderpassImage(VkImage image) const noexcept {
for (u32 i = 0; i < num_renderpass_images; i++) {
if (image == renderpass_images[i]) {
return true;
}
}
return false;
}
std::mutex submit_mutex; std::mutex submit_mutex;
private: private:

View file

@ -861,6 +861,12 @@ VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) {
return *buffers[level]; return *buffers[level];
} }
void TextureCacheRuntime::CheckFeedbackLoop(ImageView& image_view) {
if (scheduler.IsRenderpassImage(image_view.ImageHandle())) {
scheduler.RequestOutsideRenderPassOperationContext();
}
}
void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src,
std::span<const VideoCommon::ImageCopy> copies) { std::span<const VideoCommon::ImageCopy> copies) {
std::vector<VkBufferImageCopy> vk_in_copies(copies.size()); std::vector<VkBufferImageCopy> vk_in_copies(copies.size());

View file

@ -103,6 +103,8 @@ public:
[[nodiscard]] VkBuffer GetTemporaryBuffer(size_t needed_size); [[nodiscard]] VkBuffer GetTemporaryBuffer(size_t needed_size);
void CheckFeedbackLoop(ImageView& image_view);
const Device& device; const Device& device;
Scheduler& scheduler; Scheduler& scheduler;
MemoryAllocator& memory_allocator; MemoryAllocator& memory_allocator;

View file

@ -2374,6 +2374,11 @@ bool TextureCache<P>::IsFullClear(ImageViewId id) {
scissor.max_y >= size.height; scissor.max_y >= size.height;
} }
template <class P>
void TextureCache<P>::CheckFeedbackLoop(ImageView& image_view) {
runtime.CheckFeedbackLoop(image_view);
}
template <class P> template <class P>
void TextureCache<P>::CreateChannel(struct Tegra::Control::ChannelState& channel) { void TextureCache<P>::CreateChannel(struct Tegra::Control::ChannelState& channel) {
VideoCommon::ChannelSetupCaches<TextureCacheChannelInfo>::CreateChannel(channel); VideoCommon::ChannelSetupCaches<TextureCacheChannelInfo>::CreateChannel(channel);

View file

@ -224,6 +224,9 @@ public:
[[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept; [[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept;
/// Handle feedback loops during draws.
void CheckFeedbackLoop(ImageView& image_view);
/// Create channel state. /// Create channel state.
void CreateChannel(Tegra::Control::ChannelState& channel) final override; void CreateChannel(Tegra::Control::ChannelState& channel) final override;