diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 26 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.h | 17 | ||||
| -rw-r--r-- | src/video_core/command_processor.cpp | 170 | ||||
| -rw-r--r-- | src/video_core/command_processor.h | 17 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/gpu.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 8 | ||||
| -rw-r--r-- | src/video_core/rasterizer_interface.h | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 28 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.ui | 7 |
14 files changed, 147 insertions, 140 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 4cdf7f613..8e0f9a9e5 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/hle/service/nvdrv/devices/nvhost_gpu.h" | 9 | #include "core/hle/service/nvdrv/devices/nvhost_gpu.h" |
| 10 | #include "core/memory.h" | 10 | #include "core/memory.h" |
| 11 | #include "video_core/command_processor.h" | ||
| 11 | #include "video_core/gpu.h" | 12 | #include "video_core/gpu.h" |
| 12 | #include "video_core/memory_manager.h" | 13 | #include "video_core/memory_manager.h" |
| 13 | 14 | ||
| @@ -134,17 +135,16 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp | |||
| 134 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", | 135 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", |
| 135 | params.address, params.num_entries, params.flags); | 136 | params.address, params.num_entries, params.flags); |
| 136 | 137 | ||
| 137 | ASSERT_MSG(input.size() == | 138 | ASSERT_MSG(input.size() == sizeof(IoctlSubmitGpfifo) + |
| 138 | sizeof(IoctlSubmitGpfifo) + params.num_entries * sizeof(IoctlGpfifoEntry), | 139 | params.num_entries * sizeof(Tegra::CommandListHeader), |
| 139 | "Incorrect input size"); | 140 | "Incorrect input size"); |
| 140 | 141 | ||
| 141 | std::vector<IoctlGpfifoEntry> entries(params.num_entries); | 142 | std::vector<Tegra::CommandListHeader> entries(params.num_entries); |
| 142 | std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], | 143 | std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], |
| 143 | params.num_entries * sizeof(IoctlGpfifoEntry)); | 144 | params.num_entries * sizeof(Tegra::CommandListHeader)); |
| 144 | for (auto entry : entries) { | 145 | |
| 145 | Tegra::GPUVAddr va_addr = entry.Address(); | 146 | Core::System::GetInstance().GPU().ProcessCommandLists(entries); |
| 146 | Core::System::GetInstance().GPU().ProcessCommandList(va_addr, entry.sz); | 147 | |
| 147 | } | ||
| 148 | params.fence_out.id = 0; | 148 | params.fence_out.id = 0; |
| 149 | params.fence_out.value = 0; | 149 | params.fence_out.value = 0; |
| 150 | std::memcpy(output.data(), ¶ms, sizeof(IoctlSubmitGpfifo)); | 150 | std::memcpy(output.data(), ¶ms, sizeof(IoctlSubmitGpfifo)); |
| @@ -160,14 +160,12 @@ u32 nvhost_gpu::KickoffPB(const std::vector<u8>& input, std::vector<u8>& output) | |||
| 160 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", | 160 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", |
| 161 | params.address, params.num_entries, params.flags); | 161 | params.address, params.num_entries, params.flags); |
| 162 | 162 | ||
| 163 | std::vector<IoctlGpfifoEntry> entries(params.num_entries); | 163 | std::vector<Tegra::CommandListHeader> entries(params.num_entries); |
| 164 | Memory::ReadBlock(params.address, entries.data(), | 164 | Memory::ReadBlock(params.address, entries.data(), |
| 165 | params.num_entries * sizeof(IoctlGpfifoEntry)); | 165 | params.num_entries * sizeof(Tegra::CommandListHeader)); |
| 166 | |||
| 167 | Core::System::GetInstance().GPU().ProcessCommandLists(entries); | ||
| 166 | 168 | ||
| 167 | for (auto entry : entries) { | ||
| 168 | Tegra::GPUVAddr va_addr = entry.Address(); | ||
| 169 | Core::System::GetInstance().GPU().ProcessCommandList(va_addr, entry.sz); | ||
| 170 | } | ||
| 171 | params.fence_out.id = 0; | 169 | params.fence_out.id = 0; |
| 172 | params.fence_out.value = 0; | 170 | params.fence_out.value = 0; |
| 173 | std::memcpy(output.data(), ¶ms, output.size()); | 171 | std::memcpy(output.data(), ¶ms, output.size()); |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h index 03b7356d0..baaefd79a 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/swap.h" | 11 | #include "common/swap.h" |
| 12 | #include "core/hle/service/nvdrv/devices/nvdevice.h" | 12 | #include "core/hle/service/nvdrv/devices/nvdevice.h" |
| 13 | #include "video_core/memory_manager.h" | ||
| 14 | 13 | ||
| 15 | namespace Service::Nvidia::Devices { | 14 | namespace Service::Nvidia::Devices { |
| 16 | 15 | ||
| @@ -151,22 +150,6 @@ private: | |||
| 151 | }; | 150 | }; |
| 152 | static_assert(sizeof(IoctlAllocObjCtx) == 16, "IoctlAllocObjCtx is incorrect size"); | 151 | static_assert(sizeof(IoctlAllocObjCtx) == 16, "IoctlAllocObjCtx is incorrect size"); |
| 153 | 152 | ||
| 154 | struct IoctlGpfifoEntry { | ||
| 155 | u32_le entry0; // gpu_va_lo | ||
| 156 | union { | ||
| 157 | u32_le entry1; // gpu_va_hi | (unk_0x02 << 0x08) | (size << 0x0A) | (unk_0x01 << 0x1F) | ||
| 158 | BitField<0, 8, u32_le> gpu_va_hi; | ||
| 159 | BitField<8, 2, u32_le> unk1; | ||
| 160 | BitField<10, 21, u32_le> sz; | ||
| 161 | BitField<31, 1, u32_le> unk2; | ||
| 162 | }; | ||
| 163 | |||
| 164 | Tegra::GPUVAddr Address() const { | ||
| 165 | return (static_cast<Tegra::GPUVAddr>(gpu_va_hi) << 32) | entry0; | ||
| 166 | } | ||
| 167 | }; | ||
| 168 | static_assert(sizeof(IoctlGpfifoEntry) == 8, "IoctlGpfifoEntry is incorrect size"); | ||
| 169 | |||
| 170 | struct IoctlSubmitGpfifo { | 153 | struct IoctlSubmitGpfifo { |
| 171 | u64_le address; // pointer to gpfifo entry structs | 154 | u64_le address; // pointer to gpfifo entry structs |
| 172 | u32_le num_entries; // number of fence objects being submitted | 155 | u32_le num_entries; // number of fence objects being submitted |
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index d5831e752..2625ddfdc 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -28,98 +28,106 @@ enum class BufferMethods { | |||
| 28 | CountBufferMethods = 0x40, | 28 | CountBufferMethods = 0x40, |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) { | 31 | MICROPROFILE_DEFINE(ProcessCommandLists, "GPU", "Execute command buffer", MP_RGB(128, 128, 192)); |
| 32 | LOG_TRACE(HW_GPU, | ||
| 33 | "Processing method {:08X} on subchannel {} value " | ||
| 34 | "{:08X} remaining params {}", | ||
| 35 | method, subchannel, value, remaining_params); | ||
| 36 | |||
| 37 | ASSERT(subchannel < bound_engines.size()); | ||
| 38 | |||
| 39 | if (method == static_cast<u32>(BufferMethods::BindObject)) { | ||
| 40 | // Bind the current subchannel to the desired engine id. | ||
| 41 | LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value); | ||
| 42 | bound_engines[subchannel] = static_cast<EngineID>(value); | ||
| 43 | return; | ||
| 44 | } | ||
| 45 | 32 | ||
| 46 | if (method < static_cast<u32>(BufferMethods::CountBufferMethods)) { | 33 | void GPU::ProcessCommandLists(const std::vector<CommandListHeader>& commands) { |
| 47 | // TODO(Subv): Research and implement these methods. | 34 | MICROPROFILE_SCOPE(ProcessCommandLists); |
| 48 | LOG_ERROR(HW_GPU, "Special buffer methods other than Bind are not implemented"); | ||
| 49 | return; | ||
| 50 | } | ||
| 51 | 35 | ||
| 52 | const EngineID engine = bound_engines[subchannel]; | 36 | auto WriteReg = [this](u32 method, u32 subchannel, u32 value, u32 remaining_params) { |
| 53 | 37 | LOG_TRACE(HW_GPU, | |
| 54 | switch (engine) { | 38 | "Processing method {:08X} on subchannel {} value " |
| 55 | case EngineID::FERMI_TWOD_A: | 39 | "{:08X} remaining params {}", |
| 56 | fermi_2d->WriteReg(method, value); | 40 | method, subchannel, value, remaining_params); |
| 57 | break; | ||
| 58 | case EngineID::MAXWELL_B: | ||
| 59 | maxwell_3d->WriteReg(method, value, remaining_params); | ||
| 60 | break; | ||
| 61 | case EngineID::MAXWELL_COMPUTE_B: | ||
| 62 | maxwell_compute->WriteReg(method, value); | ||
| 63 | break; | ||
| 64 | case EngineID::MAXWELL_DMA_COPY_A: | ||
| 65 | maxwell_dma->WriteReg(method, value); | ||
| 66 | break; | ||
| 67 | default: | ||
| 68 | UNIMPLEMENTED_MSG("Unimplemented engine"); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | 41 | ||
| 72 | void GPU::ProcessCommandList(GPUVAddr address, u32 size) { | 42 | ASSERT(subchannel < bound_engines.size()); |
| 73 | const boost::optional<VAddr> head_address = memory_manager->GpuToCpuAddress(address); | 43 | |
| 74 | VAddr current_addr = *head_address; | 44 | if (method == static_cast<u32>(BufferMethods::BindObject)) { |
| 75 | while (current_addr < *head_address + size * sizeof(CommandHeader)) { | 45 | // Bind the current subchannel to the desired engine id. |
| 76 | const CommandHeader header = {Memory::Read32(current_addr)}; | 46 | LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value); |
| 77 | current_addr += sizeof(u32); | 47 | bound_engines[subchannel] = static_cast<EngineID>(value); |
| 78 | 48 | return; | |
| 79 | switch (header.mode.Value()) { | ||
| 80 | case SubmissionMode::IncreasingOld: | ||
| 81 | case SubmissionMode::Increasing: { | ||
| 82 | // Increase the method value with each argument. | ||
| 83 | for (unsigned i = 0; i < header.arg_count; ++i) { | ||
| 84 | WriteReg(header.method + i, header.subchannel, Memory::Read32(current_addr), | ||
| 85 | header.arg_count - i - 1); | ||
| 86 | current_addr += sizeof(u32); | ||
| 87 | } | ||
| 88 | break; | ||
| 89 | } | 49 | } |
| 90 | case SubmissionMode::NonIncreasingOld: | 50 | |
| 91 | case SubmissionMode::NonIncreasing: { | 51 | if (method < static_cast<u32>(BufferMethods::CountBufferMethods)) { |
| 92 | // Use the same method value for all arguments. | 52 | // TODO(Subv): Research and implement these methods. |
| 93 | for (unsigned i = 0; i < header.arg_count; ++i) { | 53 | LOG_ERROR(HW_GPU, "Special buffer methods other than Bind are not implemented"); |
| 94 | WriteReg(header.method, header.subchannel, Memory::Read32(current_addr), | 54 | return; |
| 95 | header.arg_count - i - 1); | 55 | } |
| 96 | current_addr += sizeof(u32); | 56 | |
| 97 | } | 57 | const EngineID engine = bound_engines[subchannel]; |
| 58 | |||
| 59 | switch (engine) { | ||
| 60 | case EngineID::FERMI_TWOD_A: | ||
| 61 | fermi_2d->WriteReg(method, value); | ||
| 62 | break; | ||
| 63 | case EngineID::MAXWELL_B: | ||
| 64 | maxwell_3d->WriteReg(method, value, remaining_params); | ||
| 98 | break; | 65 | break; |
| 66 | case EngineID::MAXWELL_COMPUTE_B: | ||
| 67 | maxwell_compute->WriteReg(method, value); | ||
| 68 | break; | ||
| 69 | case EngineID::MAXWELL_DMA_COPY_A: | ||
| 70 | maxwell_dma->WriteReg(method, value); | ||
| 71 | break; | ||
| 72 | default: | ||
| 73 | UNIMPLEMENTED_MSG("Unimplemented engine"); | ||
| 99 | } | 74 | } |
| 100 | case SubmissionMode::IncreaseOnce: { | 75 | }; |
| 101 | ASSERT(header.arg_count.Value() >= 1); | ||
| 102 | 76 | ||
| 103 | // Use the original method for the first argument and then the next method for all other | 77 | for (auto entry : commands) { |
| 104 | // arguments. | 78 | Tegra::GPUVAddr address = entry.Address(); |
| 105 | WriteReg(header.method, header.subchannel, Memory::Read32(current_addr), | 79 | u32 size = entry.sz; |
| 106 | header.arg_count - 1); | 80 | const boost::optional<VAddr> head_address = memory_manager->GpuToCpuAddress(address); |
| 81 | VAddr current_addr = *head_address; | ||
| 82 | while (current_addr < *head_address + size * sizeof(CommandHeader)) { | ||
| 83 | const CommandHeader header = {Memory::Read32(current_addr)}; | ||
| 107 | current_addr += sizeof(u32); | 84 | current_addr += sizeof(u32); |
| 108 | 85 | ||
| 109 | for (unsigned i = 1; i < header.arg_count; ++i) { | 86 | switch (header.mode.Value()) { |
| 110 | WriteReg(header.method + 1, header.subchannel, Memory::Read32(current_addr), | 87 | case SubmissionMode::IncreasingOld: |
| 111 | header.arg_count - i - 1); | 88 | case SubmissionMode::Increasing: { |
| 89 | // Increase the method value with each argument. | ||
| 90 | for (unsigned i = 0; i < header.arg_count; ++i) { | ||
| 91 | WriteReg(header.method + i, header.subchannel, Memory::Read32(current_addr), | ||
| 92 | header.arg_count - i - 1); | ||
| 93 | current_addr += sizeof(u32); | ||
| 94 | } | ||
| 95 | break; | ||
| 96 | } | ||
| 97 | case SubmissionMode::NonIncreasingOld: | ||
| 98 | case SubmissionMode::NonIncreasing: { | ||
| 99 | // Use the same method value for all arguments. | ||
| 100 | for (unsigned i = 0; i < header.arg_count; ++i) { | ||
| 101 | WriteReg(header.method, header.subchannel, Memory::Read32(current_addr), | ||
| 102 | header.arg_count - i - 1); | ||
| 103 | current_addr += sizeof(u32); | ||
| 104 | } | ||
| 105 | break; | ||
| 106 | } | ||
| 107 | case SubmissionMode::IncreaseOnce: { | ||
| 108 | ASSERT(header.arg_count.Value() >= 1); | ||
| 109 | |||
| 110 | // Use the original method for the first argument and then the next method for all | ||
| 111 | // other arguments. | ||
| 112 | WriteReg(header.method, header.subchannel, Memory::Read32(current_addr), | ||
| 113 | header.arg_count - 1); | ||
| 112 | current_addr += sizeof(u32); | 114 | current_addr += sizeof(u32); |
| 115 | |||
| 116 | for (unsigned i = 1; i < header.arg_count; ++i) { | ||
| 117 | WriteReg(header.method + 1, header.subchannel, Memory::Read32(current_addr), | ||
| 118 | header.arg_count - i - 1); | ||
| 119 | current_addr += sizeof(u32); | ||
| 120 | } | ||
| 121 | break; | ||
| 122 | } | ||
| 123 | case SubmissionMode::Inline: { | ||
| 124 | // The register value is stored in the bits 16-28 as an immediate | ||
| 125 | WriteReg(header.method, header.subchannel, header.inline_data, 0); | ||
| 126 | break; | ||
| 127 | } | ||
| 128 | default: | ||
| 129 | UNIMPLEMENTED(); | ||
| 113 | } | 130 | } |
| 114 | break; | ||
| 115 | } | ||
| 116 | case SubmissionMode::Inline: { | ||
| 117 | // The register value is stored in the bits 16-28 as an immediate | ||
| 118 | WriteReg(header.method, header.subchannel, header.inline_data, 0); | ||
| 119 | break; | ||
| 120 | } | ||
| 121 | default: | ||
| 122 | UNIMPLEMENTED(); | ||
| 123 | } | 131 | } |
| 124 | } | 132 | } |
| 125 | } | 133 | } |
diff --git a/src/video_core/command_processor.h b/src/video_core/command_processor.h index a01153e0b..bd766e77a 100644 --- a/src/video_core/command_processor.h +++ b/src/video_core/command_processor.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <type_traits> | 7 | #include <type_traits> |
| 8 | #include "common/bit_field.h" | 8 | #include "common/bit_field.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "video_core/memory_manager.h" | ||
| 10 | 11 | ||
| 11 | namespace Tegra { | 12 | namespace Tegra { |
| 12 | 13 | ||
| @@ -19,6 +20,22 @@ enum class SubmissionMode : u32 { | |||
| 19 | IncreaseOnce = 5 | 20 | IncreaseOnce = 5 |
| 20 | }; | 21 | }; |
| 21 | 22 | ||
| 23 | struct CommandListHeader { | ||
| 24 | u32 entry0; // gpu_va_lo | ||
| 25 | union { | ||
| 26 | u32 entry1; // gpu_va_hi | (unk_0x02 << 0x08) | (size << 0x0A) | (unk_0x01 << 0x1F) | ||
| 27 | BitField<0, 8, u32> gpu_va_hi; | ||
| 28 | BitField<8, 2, u32> unk1; | ||
| 29 | BitField<10, 21, u32> sz; | ||
| 30 | BitField<31, 1, u32> unk2; | ||
| 31 | }; | ||
| 32 | |||
| 33 | GPUVAddr Address() const { | ||
| 34 | return (static_cast<GPUVAddr>(gpu_va_hi) << 32) | entry0; | ||
| 35 | } | ||
| 36 | }; | ||
| 37 | static_assert(sizeof(CommandListHeader) == 8, "CommandListHeader is incorrect size"); | ||
| 38 | |||
| 22 | union CommandHeader { | 39 | union CommandHeader { |
| 23 | u32 hex; | 40 | u32 hex; |
| 24 | 41 | ||
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 1308080b5..329079ddd 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -135,8 +135,6 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) { | |||
| 135 | break; | 135 | break; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | rasterizer.NotifyMaxwellRegisterChanged(method); | ||
| 139 | |||
| 140 | if (debug_context) { | 138 | if (debug_context) { |
| 141 | debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandProcessed, nullptr); | 139 | debug_context->OnEvent(Tegra::DebugContext::Event::MaxwellCommandProcessed, nullptr); |
| 142 | } | 140 | } |
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index e6d8e65c6..86a809f86 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -66,6 +66,7 @@ u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { | |||
| 66 | case RenderTargetFormat::RGBA8_UINT: | 66 | case RenderTargetFormat::RGBA8_UINT: |
| 67 | case RenderTargetFormat::RGB10_A2_UNORM: | 67 | case RenderTargetFormat::RGB10_A2_UNORM: |
| 68 | case RenderTargetFormat::BGRA8_UNORM: | 68 | case RenderTargetFormat::BGRA8_UNORM: |
| 69 | case RenderTargetFormat::BGRA8_SRGB: | ||
| 69 | case RenderTargetFormat::RG16_UNORM: | 70 | case RenderTargetFormat::RG16_UNORM: |
| 70 | case RenderTargetFormat::RG16_SNORM: | 71 | case RenderTargetFormat::RG16_SNORM: |
| 71 | case RenderTargetFormat::RG16_UINT: | 72 | case RenderTargetFormat::RG16_UINT: |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index d29f31f52..589a59b4f 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <memory> | 8 | #include <memory> |
| 9 | #include <vector> | ||
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 10 | #include "core/hle/service/nvflinger/buffer_queue.h" | 11 | #include "core/hle/service/nvflinger/buffer_queue.h" |
| 11 | #include "video_core/memory_manager.h" | 12 | #include "video_core/memory_manager.h" |
| @@ -26,6 +27,7 @@ enum class RenderTargetFormat : u32 { | |||
| 26 | RG32_FLOAT = 0xCB, | 27 | RG32_FLOAT = 0xCB, |
| 27 | RG32_UINT = 0xCD, | 28 | RG32_UINT = 0xCD, |
| 28 | BGRA8_UNORM = 0xCF, | 29 | BGRA8_UNORM = 0xCF, |
| 30 | BGRA8_SRGB = 0xD0, | ||
| 29 | RGB10_A2_UNORM = 0xD1, | 31 | RGB10_A2_UNORM = 0xD1, |
| 30 | RGBA8_UNORM = 0xD5, | 32 | RGBA8_UNORM = 0xD5, |
| 31 | RGBA8_SRGB = 0xD6, | 33 | RGBA8_SRGB = 0xD6, |
| @@ -67,6 +69,7 @@ u32 RenderTargetBytesPerPixel(RenderTargetFormat format); | |||
| 67 | /// Returns the number of bytes per pixel of each depth format. | 69 | /// Returns the number of bytes per pixel of each depth format. |
| 68 | u32 DepthFormatBytesPerPixel(DepthFormat format); | 70 | u32 DepthFormatBytesPerPixel(DepthFormat format); |
| 69 | 71 | ||
| 72 | struct CommandListHeader; | ||
| 70 | class DebugContext; | 73 | class DebugContext; |
| 71 | 74 | ||
| 72 | /** | 75 | /** |
| @@ -115,7 +118,7 @@ public: | |||
| 115 | ~GPU(); | 118 | ~GPU(); |
| 116 | 119 | ||
| 117 | /// Processes a command list stored at the specified address in GPU memory. | 120 | /// Processes a command list stored at the specified address in GPU memory. |
| 118 | void ProcessCommandList(GPUVAddr address, u32 size); | 121 | void ProcessCommandLists(const std::vector<CommandListHeader>& commands); |
| 119 | 122 | ||
| 120 | /// Returns a reference to the Maxwell3D GPU engine. | 123 | /// Returns a reference to the Maxwell3D GPU engine. |
| 121 | Engines::Maxwell3D& Maxwell3D(); | 124 | Engines::Maxwell3D& Maxwell3D(); |
| @@ -130,9 +133,6 @@ public: | |||
| 130 | const Tegra::MemoryManager& MemoryManager() const; | 133 | const Tegra::MemoryManager& MemoryManager() const; |
| 131 | 134 | ||
| 132 | private: | 135 | private: |
| 133 | /// Writes a single register in the engine bound to the specified subchannel | ||
| 134 | void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params); | ||
| 135 | |||
| 136 | std::unique_ptr<Tegra::MemoryManager> memory_manager; | 136 | std::unique_ptr<Tegra::MemoryManager> memory_manager; |
| 137 | 137 | ||
| 138 | /// Mapping of command subchannels to their bound engine ids. | 138 | /// Mapping of command subchannels to their bound engine ids. |
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index 9d78e8b6b..cd819d69f 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h | |||
| @@ -20,9 +20,6 @@ public: | |||
| 20 | /// Clear the current framebuffer | 20 | /// Clear the current framebuffer |
| 21 | virtual void Clear() = 0; | 21 | virtual void Clear() = 0; |
| 22 | 22 | ||
| 23 | /// Notify rasterizer that the specified Maxwell register has been changed | ||
| 24 | virtual void NotifyMaxwellRegisterChanged(u32 method) = 0; | ||
| 25 | |||
| 26 | /// Notify rasterizer that all caches should be flushed to Switch memory | 23 | /// Notify rasterizer that all caches should be flushed to Switch memory |
| 27 | virtual void FlushAll() = 0; | 24 | virtual void FlushAll() = 0; |
| 28 | 25 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d37863a00..c59f3af1b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -534,8 +534,6 @@ void RasterizerOpenGL::DrawArrays() { | |||
| 534 | state.Apply(); | 534 | state.Apply(); |
| 535 | } | 535 | } |
| 536 | 536 | ||
| 537 | void RasterizerOpenGL::NotifyMaxwellRegisterChanged(u32 method) {} | ||
| 538 | |||
| 539 | void RasterizerOpenGL::FlushAll() {} | 537 | void RasterizerOpenGL::FlushAll() {} |
| 540 | 538 | ||
| 541 | void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) {} | 539 | void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) {} |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index a39f9cdf6..745c3dc0c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -46,7 +46,6 @@ public: | |||
| 46 | 46 | ||
| 47 | void DrawArrays() override; | 47 | void DrawArrays() override; |
| 48 | void Clear() override; | 48 | void Clear() override; |
| 49 | void NotifyMaxwellRegisterChanged(u32 method) override; | ||
| 50 | void FlushAll() override; | 49 | void FlushAll() override; |
| 51 | void FlushRegion(VAddr addr, u64 size) override; | 50 | void FlushRegion(VAddr addr, u64 size) override; |
| 52 | void InvalidateRegion(VAddr addr, u64 size) override; | 51 | void InvalidateRegion(VAddr addr, u64 size) override; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 20a8e1cda..29d61eccd 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -52,12 +52,28 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 52 | params.type = GetFormatType(params.pixel_format); | 52 | params.type = GetFormatType(params.pixel_format); |
| 53 | params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); | 53 | params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); |
| 54 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); | 54 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); |
| 55 | params.depth = config.tic.Depth(); | ||
| 56 | params.unaligned_height = config.tic.Height(); | 55 | params.unaligned_height = config.tic.Height(); |
| 57 | params.size_in_bytes = params.SizeInBytes(); | ||
| 58 | params.cache_width = Common::AlignUp(params.width, 8); | 56 | params.cache_width = Common::AlignUp(params.width, 8); |
| 59 | params.cache_height = Common::AlignUp(params.height, 8); | 57 | params.cache_height = Common::AlignUp(params.height, 8); |
| 60 | params.target = SurfaceTargetFromTextureType(config.tic.texture_type); | 58 | params.target = SurfaceTargetFromTextureType(config.tic.texture_type); |
| 59 | |||
| 60 | switch (params.target) { | ||
| 61 | case SurfaceTarget::Texture1D: | ||
| 62 | case SurfaceTarget::Texture2D: | ||
| 63 | params.depth = 1; | ||
| 64 | break; | ||
| 65 | case SurfaceTarget::Texture3D: | ||
| 66 | case SurfaceTarget::Texture2DArray: | ||
| 67 | params.depth = config.tic.Depth(); | ||
| 68 | break; | ||
| 69 | default: | ||
| 70 | LOG_CRITICAL(HW_GPU, "Unknown depth for target={}", static_cast<u32>(params.target)); | ||
| 71 | UNREACHABLE(); | ||
| 72 | params.depth = 1; | ||
| 73 | break; | ||
| 74 | } | ||
| 75 | |||
| 76 | params.size_in_bytes = params.SizeInBytes(); | ||
| 61 | return params; | 77 | return params; |
| 62 | } | 78 | } |
| 63 | 79 | ||
| @@ -72,12 +88,12 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 72 | params.type = GetFormatType(params.pixel_format); | 88 | params.type = GetFormatType(params.pixel_format); |
| 73 | params.width = config.width; | 89 | params.width = config.width; |
| 74 | params.height = config.height; | 90 | params.height = config.height; |
| 75 | params.depth = 1; | ||
| 76 | params.unaligned_height = config.height; | 91 | params.unaligned_height = config.height; |
| 77 | params.size_in_bytes = params.SizeInBytes(); | ||
| 78 | params.cache_width = Common::AlignUp(params.width, 8); | 92 | params.cache_width = Common::AlignUp(params.width, 8); |
| 79 | params.cache_height = Common::AlignUp(params.height, 8); | 93 | params.cache_height = Common::AlignUp(params.height, 8); |
| 80 | params.target = SurfaceTarget::Texture2D; | 94 | params.target = SurfaceTarget::Texture2D; |
| 95 | params.depth = 1; | ||
| 96 | params.size_in_bytes = params.SizeInBytes(); | ||
| 81 | return params; | 97 | return params; |
| 82 | } | 98 | } |
| 83 | 99 | ||
| @@ -93,12 +109,12 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 93 | params.type = GetFormatType(params.pixel_format); | 109 | params.type = GetFormatType(params.pixel_format); |
| 94 | params.width = zeta_width; | 110 | params.width = zeta_width; |
| 95 | params.height = zeta_height; | 111 | params.height = zeta_height; |
| 96 | params.depth = 1; | ||
| 97 | params.unaligned_height = zeta_height; | 112 | params.unaligned_height = zeta_height; |
| 98 | params.size_in_bytes = params.SizeInBytes(); | ||
| 99 | params.cache_width = Common::AlignUp(params.width, 8); | 113 | params.cache_width = Common::AlignUp(params.width, 8); |
| 100 | params.cache_height = Common::AlignUp(params.height, 8); | 114 | params.cache_height = Common::AlignUp(params.height, 8); |
| 101 | params.target = SurfaceTarget::Texture2D; | 115 | params.target = SurfaceTarget::Texture2D; |
| 116 | params.depth = 1; | ||
| 117 | params.size_in_bytes = params.SizeInBytes(); | ||
| 102 | return params; | 118 | return params; |
| 103 | } | 119 | } |
| 104 | 120 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index e215f260f..e660998d0 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -297,6 +297,7 @@ struct SurfaceParams { | |||
| 297 | return PixelFormat::ABGR8S; | 297 | return PixelFormat::ABGR8S; |
| 298 | case Tegra::RenderTargetFormat::RGBA8_UINT: | 298 | case Tegra::RenderTargetFormat::RGBA8_UINT: |
| 299 | return PixelFormat::ABGR8UI; | 299 | return PixelFormat::ABGR8UI; |
| 300 | case Tegra::RenderTargetFormat::BGRA8_SRGB: | ||
| 300 | case Tegra::RenderTargetFormat::BGRA8_UNORM: | 301 | case Tegra::RenderTargetFormat::BGRA8_UNORM: |
| 301 | return PixelFormat::BGRA8; | 302 | return PixelFormat::BGRA8; |
| 302 | case Tegra::RenderTargetFormat::RGB10_A2_UNORM: | 303 | case Tegra::RenderTargetFormat::RGB10_A2_UNORM: |
| @@ -569,6 +570,7 @@ struct SurfaceParams { | |||
| 569 | case Tegra::RenderTargetFormat::RGBA8_UNORM: | 570 | case Tegra::RenderTargetFormat::RGBA8_UNORM: |
| 570 | case Tegra::RenderTargetFormat::RGBA8_SRGB: | 571 | case Tegra::RenderTargetFormat::RGBA8_SRGB: |
| 571 | case Tegra::RenderTargetFormat::BGRA8_UNORM: | 572 | case Tegra::RenderTargetFormat::BGRA8_UNORM: |
| 573 | case Tegra::RenderTargetFormat::BGRA8_SRGB: | ||
| 572 | case Tegra::RenderTargetFormat::RGB10_A2_UNORM: | 574 | case Tegra::RenderTargetFormat::RGB10_A2_UNORM: |
| 573 | case Tegra::RenderTargetFormat::R8_UNORM: | 575 | case Tegra::RenderTargetFormat::R8_UNORM: |
| 574 | case Tegra::RenderTargetFormat::RG16_UNORM: | 576 | case Tegra::RenderTargetFormat::RG16_UNORM: |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index d8caee1e8..9292d9a42 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -20,7 +20,6 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) | |||
| 20 | this->setConfiguration(); | 20 | this->setConfiguration(); |
| 21 | 21 | ||
| 22 | ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 22 | ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| 23 | ui->use_multi_core->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | ||
| 24 | ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 23 | ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| 25 | } | 24 | } |
| 26 | 25 | ||
| @@ -31,7 +30,6 @@ void ConfigureGeneral::setConfiguration() { | |||
| 31 | ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); | 30 | ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); |
| 32 | ui->theme_combobox->setCurrentIndex(ui->theme_combobox->findData(UISettings::values.theme)); | 31 | ui->theme_combobox->setCurrentIndex(ui->theme_combobox->findData(UISettings::values.theme)); |
| 33 | ui->use_cpu_jit->setChecked(Settings::values.use_cpu_jit); | 32 | ui->use_cpu_jit->setChecked(Settings::values.use_cpu_jit); |
| 34 | ui->use_multi_core->setChecked(Settings::values.use_multi_core); | ||
| 35 | ui->use_docked_mode->setChecked(Settings::values.use_docked_mode); | 33 | ui->use_docked_mode->setChecked(Settings::values.use_docked_mode); |
| 36 | } | 34 | } |
| 37 | 35 | ||
| @@ -46,6 +44,5 @@ void ConfigureGeneral::applyConfiguration() { | |||
| 46 | ui->theme_combobox->itemData(ui->theme_combobox->currentIndex()).toString(); | 44 | ui->theme_combobox->itemData(ui->theme_combobox->currentIndex()).toString(); |
| 47 | 45 | ||
| 48 | Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked(); | 46 | Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked(); |
| 49 | Settings::values.use_multi_core = ui->use_multi_core->isChecked(); | ||
| 50 | Settings::values.use_docked_mode = ui->use_docked_mode->isChecked(); | 47 | Settings::values.use_docked_mode = ui->use_docked_mode->isChecked(); |
| 51 | } | 48 | } |
diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 233adbe27..1775c4d40 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui | |||
| @@ -58,13 +58,6 @@ | |||
| 58 | </property> | 58 | </property> |
| 59 | </widget> | 59 | </widget> |
| 60 | </item> | 60 | </item> |
| 61 | <item> | ||
| 62 | <widget class="QCheckBox" name="use_multi_core"> | ||
| 63 | <property name="text"> | ||
| 64 | <string>Enable multi-core</string> | ||
| 65 | </property> | ||
| 66 | </widget> | ||
| 67 | </item> | ||
| 68 | </layout> | 61 | </layout> |
| 69 | </item> | 62 | </item> |
| 70 | </layout> | 63 | </layout> |