diff options
-rw-r--r-- | src/core/memory/dmnt_cheat_vm.cpp | 2 | ||||
-rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 33 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 12 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 2 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 15 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.h | 2 | ||||
-rw-r--r-- | src/yuzu/applets/qt_amiibo_settings.cpp | 4 |
7 files changed, 36 insertions, 34 deletions
diff --git a/src/core/memory/dmnt_cheat_vm.cpp b/src/core/memory/dmnt_cheat_vm.cpp index de96fcb8e..31ffc4fbb 100644 --- a/src/core/memory/dmnt_cheat_vm.cpp +++ b/src/core/memory/dmnt_cheat_vm.cpp @@ -761,7 +761,7 @@ void DmntCheatVm::Execute(const CheatProcessMetadata& metadata) { u64 src_address = GetCheatProcessAddress(metadata, begin_cond->mem_type, begin_cond->rel_address); u64 src_value = 0; - switch (store_static->bit_width) { + switch (begin_cond->bit_width) { case 1: case 2: case 4: diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 2ba33543c..599551013 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -992,7 +992,20 @@ void BufferCache<P>::BindHostIndexBuffer() { TouchBuffer(buffer, index_buffer.buffer_id); const u32 offset = buffer.Offset(index_buffer.cpu_addr); const u32 size = index_buffer.size; - SynchronizeBuffer(buffer, index_buffer.cpu_addr, size); + if (maxwell3d->inline_index_draw_indexes.size()) { + if constexpr (USE_MEMORY_MAPS) { + auto upload_staging = runtime.UploadStagingBuffer(size); + std::array<BufferCopy, 1> copies{ + {BufferCopy{.src_offset = upload_staging.offset, .dst_offset = 0, .size = size}}}; + std::memcpy(upload_staging.mapped_span.data(), + maxwell3d->inline_index_draw_indexes.data(), size); + runtime.CopyBuffer(buffer, upload_staging.buffer, copies); + } else { + buffer.ImmediateUpload(0, maxwell3d->inline_index_draw_indexes); + } + } else { + SynchronizeBuffer(buffer, index_buffer.cpu_addr, size); + } if constexpr (HAS_FULL_INDEX_AND_PRIMITIVE_SUPPORT) { const u32 new_offset = offset + maxwell3d->regs.index_buffer.first * maxwell3d->regs.index_buffer.FormatSizeInBytes(); @@ -1275,7 +1288,15 @@ void BufferCache<P>::UpdateIndexBuffer() { } flags[Dirty::IndexBuffer] = false; last_index_count = index_array.count; - + if (maxwell3d->inline_index_draw_indexes.size()) { + auto inline_index_size = static_cast<u32>(maxwell3d->inline_index_draw_indexes.size()); + index_buffer = Binding{ + .cpu_addr = 0, + .size = inline_index_size, + .buffer_id = CreateBuffer(0, inline_index_size), + }; + return; + } const GPUVAddr gpu_addr_begin = index_array.StartAddress(); const GPUVAddr gpu_addr_end = index_array.EndAddress(); const std::optional<VAddr> cpu_addr = gpu_memory->GpuToCpuAddress(gpu_addr_begin); @@ -1491,6 +1512,14 @@ typename BufferCache<P>::OverlapResult BufferCache<P>::ResolveOverlaps(VAddr cpu VAddr end = cpu_addr + wanted_size; int stream_score = 0; bool has_stream_leap = false; + if (begin == 0) { + return OverlapResult{ + .ids = std::move(overlap_ids), + .begin = begin, + .end = end, + .has_stream_leap = has_stream_leap, + }; + } for (; cpu_addr >> YUZU_PAGEBITS < Common::DivCeil(end, YUZU_PAGESIZE); cpu_addr += YUZU_PAGESIZE) { const BufferId overlap_id = page_table[cpu_addr >> YUZU_PAGEBITS]; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 115a5e010..354c6e429 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -222,8 +222,6 @@ void RasterizerOpenGL::Draw(bool is_indexed, u32 instance_count) { pipeline->SetEngine(maxwell3d, gpu_memory); pipeline->Configure(is_indexed); - BindInlineIndexBuffer(); - SyncState(); const GLenum primitive_mode = MaxwellToGL::PrimitiveTopology(maxwell3d->regs.draw.topology); @@ -1140,16 +1138,6 @@ void RasterizerOpenGL::ReleaseChannel(s32 channel_id) { query_cache.EraseChannel(channel_id); } -void RasterizerOpenGL::BindInlineIndexBuffer() { - if (maxwell3d->inline_index_draw_indexes.empty()) { - return; - } - const auto data_count = static_cast<u32>(maxwell3d->inline_index_draw_indexes.size()); - auto buffer = Buffer(buffer_cache_runtime, *this, 0, data_count); - buffer.ImmediateUpload(0, maxwell3d->inline_index_draw_indexes); - buffer_cache_runtime.BindIndexBuffer(buffer, 0, data_count); -} - AccelerateDMA::AccelerateDMA(BufferCache& buffer_cache_) : buffer_cache{buffer_cache_} {} bool AccelerateDMA::BufferCopy(GPUVAddr src_address, GPUVAddr dest_address, u64 amount) { diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 449a14f12..fc183c3ca 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -199,8 +199,6 @@ private: /// End a transform feedback void EndTransformFeedback(); - void BindInlineIndexBuffer(); - Tegra::GPU& gpu; const Device& device; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 67b88621a..12b13cc59 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -191,8 +191,6 @@ void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { pipeline->SetEngine(maxwell3d, gpu_memory); pipeline->Configure(is_indexed); - BindInlineIndexBuffer(); - BeginTransformFeedback(); UpdateDynamicStates(); @@ -1029,17 +1027,4 @@ void RasterizerVulkan::ReleaseChannel(s32 channel_id) { query_cache.EraseChannel(channel_id); } -void RasterizerVulkan::BindInlineIndexBuffer() { - if (maxwell3d->inline_index_draw_indexes.empty()) { - return; - } - const auto data_count = static_cast<u32>(maxwell3d->inline_index_draw_indexes.size()); - auto buffer = buffer_cache_runtime.UploadStagingBuffer(data_count); - std::memcpy(buffer.mapped_span.data(), maxwell3d->inline_index_draw_indexes.data(), data_count); - buffer_cache_runtime.BindIndexBuffer( - maxwell3d->regs.draw.topology, maxwell3d->regs.index_buffer.format, - maxwell3d->regs.index_buffer.first, maxwell3d->regs.index_buffer.count, buffer.buffer, - static_cast<u32>(buffer.offset), data_count); -} - } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 70f36d58a..ee483cfd9 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -141,8 +141,6 @@ private: void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs); - void BindInlineIndexBuffer(); - Tegra::GPU& gpu; ScreenInfo& screen_info; diff --git a/src/yuzu/applets/qt_amiibo_settings.cpp b/src/yuzu/applets/qt_amiibo_settings.cpp index efb7f6ecc..93ad4b4f9 100644 --- a/src/yuzu/applets/qt_amiibo_settings.cpp +++ b/src/yuzu/applets/qt_amiibo_settings.cpp @@ -13,7 +13,9 @@ #include "input_common/drivers/virtual_amiibo.h" #include "input_common/main.h" #include "ui_qt_amiibo_settings.h" +#ifdef ENABLE_WEB_SERVICE #include "web_service/web_backend.h" +#endif #include "yuzu/applets/qt_amiibo_settings.h" #include "yuzu/main.h" @@ -90,6 +92,7 @@ void QtAmiiboSettingsDialog::LoadAmiiboInfo() { } void QtAmiiboSettingsDialog::LoadAmiiboApiInfo(std::string_view amiibo_id) { +#ifdef ENABLE_WEB_SERVICE // TODO: Host this data on our website WebService::Client client{"https://amiiboapi.com", {}, {}}; WebService::Client image_client{"https://raw.githubusercontent.com", {}, {}}; @@ -134,6 +137,7 @@ void QtAmiiboSettingsDialog::LoadAmiiboApiInfo(std::string_view amiibo_id) { pixmap = pixmap.scaled(250, 350, Qt::AspectRatioMode::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation); ui->amiiboImageLabel->setPixmap(pixmap); +#endif } void QtAmiiboSettingsDialog::LoadAmiiboData() { |