early-access version 2078

This commit is contained in:
pineappleEA 2021-09-24 01:22:58 +02:00
parent c7ecb23a8c
commit 945f9b6650
6 changed files with 98 additions and 161 deletions

View file

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

View file

@ -570,13 +570,12 @@ bool BufferCache<P>::DMACopy(GPUVAddr src_address, GPUVAddr dest_address, u64 am
ForEachWrittenRange(*cpu_src_address, amount, mirror); ForEachWrittenRange(*cpu_src_address, amount, mirror);
// This subtraction in this order is important for overlapping copies. // This subtraction in this order is important for overlapping copies.
common_ranges.subtract(subtract_interval); common_ranges.subtract(subtract_interval);
bool atleast_1_download = tmp_intervals.size() != 0; const bool has_new_downloads = tmp_intervals.size() != 0;
for (const IntervalType add_interval : tmp_intervals) { for (const IntervalType& add_interval : tmp_intervals) {
common_ranges.add(add_interval); common_ranges.add(add_interval);
} }
runtime.CopyBuffer(dest_buffer, src_buffer, copies); runtime.CopyBuffer(dest_buffer, src_buffer, copies);
if (atleast_1_download) { if (has_new_downloads) {
dest_buffer.MarkRegionAsGpuModified(*cpu_dest_address, amount); dest_buffer.MarkRegionAsGpuModified(*cpu_dest_address, amount);
} }
std::vector<u8> tmp_buffer(amount); std::vector<u8> tmp_buffer(amount);

View file

@ -82,42 +82,42 @@ void MaxwellDMA::Launch() {
} }
void MaxwellDMA::CopyPitchToPitch() { void MaxwellDMA::CopyPitchToPitch() {
// When `multi_line_enable` bit is disabled the copy is performed as if we were copying a 1D // When `multi_line_enable` bit is enabled we copy a 2D image of dimensions
// buffer of length `line_length_in`. // (line_length_in, line_count).
// Otherwise we copy a 2D image of dimensions (line_length_in, line_count). // Otherwise the copy is performed as if we were copying a 1D buffer of length line_length_in.
auto& accelerate = rasterizer->AccessAccelerateDMA(); const bool remap_enabled = regs.launch_dma.remap_enable != 0;
if (!regs.launch_dma.multi_line_enable) { if (regs.launch_dma.multi_line_enable) {
const bool is_buffer_clear = regs.launch_dma.remap_enable != 0 && UNIMPLEMENTED_IF(remap_enabled);
regs.remap_const.dst_x == RemapConst::Swizzle::CONST_A;
// TODO: allow multisized components.
if (is_buffer_clear) {
ASSERT(regs.remap_const.component_size_minus_one == 3);
accelerate.BufferClear(regs.offset_out, regs.line_length_in, regs.remap_consta_value);
std::vector<u32> tmp_buffer(regs.line_length_in, regs.remap_consta_value);
memory_manager.WriteBlockUnsafe(regs.offset_out,
reinterpret_cast<u8*>(tmp_buffer.data()),
regs.line_length_in * sizeof(u32));
return;
}
UNIMPLEMENTED_IF(regs.launch_dma.remap_enable != 0);
if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) {
std::vector<u8> tmp_buffer(regs.line_length_in);
memory_manager.ReadBlockUnsafe(regs.offset_in, tmp_buffer.data(), regs.line_length_in);
memory_manager.WriteBlock(regs.offset_out, tmp_buffer.data(), regs.line_length_in);
}
return;
}
UNIMPLEMENTED_IF(regs.launch_dma.remap_enable != 0);
// Perform a line-by-line copy. // Perform a line-by-line copy.
// We're going to take a subrect of size (line_length_in, line_count) from the source rectangle. // We're going to take a subrect of size (line_length_in, line_count) from the source
// There is no need to manually flush/invalidate the regions because CopyBlock does that for us. // rectangle. There is no need to manually flush/invalidate the regions because CopyBlock
// does that for us.
for (u32 line = 0; line < regs.line_count; ++line) { for (u32 line = 0; line < regs.line_count; ++line) {
const GPUVAddr source_line = regs.offset_in + static_cast<size_t>(line) * regs.pitch_in; const GPUVAddr source_line = regs.offset_in + static_cast<size_t>(line) * regs.pitch_in;
const GPUVAddr dest_line = regs.offset_out + static_cast<size_t>(line) * regs.pitch_out; const GPUVAddr dest_line = regs.offset_out + static_cast<size_t>(line) * regs.pitch_out;
memory_manager.CopyBlock(dest_line, source_line, regs.line_length_in); memory_manager.CopyBlock(dest_line, source_line, regs.line_length_in);
} }
return;
}
// TODO: allow multisized components.
auto& accelerate = rasterizer->AccessAccelerateDMA();
const bool is_const_a_dst = regs.remap_const.dst_x == RemapConst::Swizzle::CONST_A;
const bool is_buffer_clear = remap_enabled && is_const_a_dst;
if (is_buffer_clear) {
ASSERT(regs.remap_const.component_size_minus_one == 3);
accelerate.BufferClear(regs.offset_out, regs.line_length_in, regs.remap_consta_value);
std::vector<u32> tmp_buffer(regs.line_length_in, regs.remap_consta_value);
memory_manager.WriteBlockUnsafe(regs.offset_out, reinterpret_cast<u8*>(tmp_buffer.data()),
regs.line_length_in * sizeof(u32));
return;
}
UNIMPLEMENTED_IF(remap_enabled);
if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) {
std::vector<u8> tmp_buffer(regs.line_length_in);
memory_manager.ReadBlockUnsafe(regs.offset_in, tmp_buffer.data(), regs.line_length_in);
memory_manager.WriteBlock(regs.offset_out, tmp_buffer.data(), regs.line_length_in);
}
} }
void MaxwellDMA::CopyBlockLinearToPitch() { void MaxwellDMA::CopyBlockLinearToPitch() {

View file

@ -175,7 +175,7 @@ public:
static_assert(sizeof(LaunchDMA) == 4); static_assert(sizeof(LaunchDMA) == 4);
struct RemapConst { struct RemapConst {
enum Swizzle : u32 { enum class Swizzle : u32 {
SRC_X = 0, SRC_X = 0,
SRC_Y = 1, SRC_Y = 1,
SRC_Z = 2, SRC_Z = 2,

View file

@ -147,8 +147,7 @@ void BufferCacheRuntime::CopyBuffer(Buffer& dst_buffer, Buffer& src_buffer,
void BufferCacheRuntime::ClearBuffer(Buffer& dest_buffer, u32 offset, size_t size, u32 value) { void BufferCacheRuntime::ClearBuffer(Buffer& dest_buffer, u32 offset, size_t size, u32 value) {
glClearNamedBufferSubData(dest_buffer.Handle(), GL_R32UI, static_cast<GLintptr>(offset), glClearNamedBufferSubData(dest_buffer.Handle(), GL_R32UI, static_cast<GLintptr>(offset),
static_cast<GLsizeiptr>(size / sizeof(u32)), GL_RED, GL_UNSIGNED_INT, static_cast<GLsizeiptr>(size), GL_RED, GL_UNSIGNED_INT, &value);
&value);
} }
void BufferCacheRuntime::BindIndexBuffer(Buffer& buffer, u32 offset, u32 size) { void BufferCacheRuntime::BindIndexBuffer(Buffer& buffer, u32 offset, u32 size) {

View file

@ -2,26 +2,15 @@
<ui version="4.0"> <ui version="4.0">
<class>ConfigureDebug</class> <class>ConfigureDebug</class>
<widget class="QWidget" name="ConfigureDebug"> <widget class="QWidget" name="ConfigureDebug">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>777</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1"> <layout class="QVBoxLayout" name="verticalLayout_1">
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Logging</string> <string>Logging</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QGridLayout" name="gridLayout_1">
<item> <item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_1">
<item> <item>
<widget class="QLabel" name="label_1"> <widget class="QLabel" name="label_1">
<property name="text"> <property name="text">
@ -34,25 +23,21 @@
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="toggle_console"> <widget class="QCheckBox" name="toggle_console">
<property name="text"> <property name="text">
<string>Show Log in Console</string> <string>Show Log in Console</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="1">
<widget class="QPushButton" name="open_log_button"> <widget class="QPushButton" name="open_log_button">
<property name="text"> <property name="text">
<string>Open Log Location</string> <string>Open Log Location</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="2" column="0">
</item>
<item>
<widget class="QCheckBox" name="extended_logging"> <widget class="QCheckBox" name="extended_logging">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
@ -61,22 +46,7 @@
<string>When checked, the max size of the log increases from 100 MB to 1 GB</string> <string>When checked, the max size of the log increases from 100 MB to 1 GB</string>
</property> </property>
<property name="text"> <property name="text">
<string>Enable Extended Logging</string> <string>Enable Extended Logging**</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>This will be reset automatically when yuzu closes.</string>
</property>
<property name="indent">
<number>20</number>
</property> </property>
</widget> </widget>
</item> </item>
@ -111,7 +81,7 @@
<property name="title"> <property name="title">
<string>Graphics</string> <string>Graphics</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="enable_graphics_debugging"> <widget class="QCheckBox" name="enable_graphics_debugging">
<property name="enabled"> <property name="enabled">
@ -176,33 +146,18 @@
<property name="title"> <property name="title">
<string>Debugging</string> <string>Debugging</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QGridLayout" name="gridLayout_3">
<item> <item row="0" column="0">
<widget class="QCheckBox" name="fs_access_log"> <widget class="QCheckBox" name="fs_access_log">
<property name="text"> <property name="text">
<string>Enable FS Access Log</string> <string>Enable FS Access Log</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QCheckBox" name="reporting_services"> <widget class="QCheckBox" name="reporting_services">
<property name="text"> <property name="text">
<string>Enable Verbose Reporting Services</string> <string>Enable Verbose Reporting Services**</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>This will be reset automatically when yuzu closes.</string>
</property>
<property name="indent">
<number>20</number>
</property> </property>
</widget> </widget>
</item> </item>
@ -214,35 +169,38 @@
<property name="title"> <property name="title">
<string>Advanced</string> <string>Advanced</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QGridLayout" name="gridLayout_4">
<item> <item> row="0" column="0">
<widget class="QCheckBox" name="quest_flag"> <widget class="QCheckBox" name="quest_flag">
<property name="text"> <property name="text">
<string>Kiosk (Quest) Mode</string> <string>Kiosk (Quest) Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QCheckBox" name="enable_cpu_debugging"> <widget class="QCheckBox" name="enable_cpu_debugging">
<property name="text"> <property name="text">
<string>Enable CPU Debugging</string> <string>Enable CPU Debugging</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QCheckBox" name="use_debug_asserts"> <widget class="QCheckBox" name="use_debug_asserts">
<property name="text"> <property name="text">
<string>Enable Debug Asserts</string> <string>Enable Debug Asserts</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QCheckBox" name="use_auto_stub"> <widget class="QCheckBox" name="use_auto_stub">
<property name="text"> <property name="text">
<string>Enable Auto-Stub</string> <string>Enable Auto-Stub**</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="font"> <property name="font">
@ -251,7 +209,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>This will be reset automatically when yuzu closes.</string> <string>**This will be reset automatically when yuzu closes.</string>
</property> </property>
<property name="indent"> <property name="indent">
<number>20</number> <number>20</number>
@ -260,25 +218,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops> <tabstops>
<tabstop>log_filter_edit</tabstop> <tabstop>log_filter_edit</tabstop>
<tabstop>toggle_console</tabstop> <tabstop>toggle_console</tabstop>