early-access version 2540

This commit is contained in:
pineappleEA 2022-03-12 01:24:37 +01:00
parent 27a084db9c
commit 6f3fc253f0
4 changed files with 41 additions and 4 deletions

View file

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

View file

@ -7,6 +7,7 @@
#include "common/assert.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "video_core/dirty_flags.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/gpu.h"
#include "video_core/memory_manager.h"
@ -208,6 +209,14 @@ void Maxwell3D::ProcessMethodCall(u32 method, u32 argument, u32 nonshadow_argume
return ProcessCBBind(4);
case MAXWELL3D_REG_INDEX(draw.vertex_end_gl):
return DrawArrays();
case MAXWELL3D_REG_INDEX(small_index):
regs.index_array.count = regs.small_index.count;
regs.index_array.first = regs.small_index.first;
dirty.flags[VideoCommon::Dirty::IndexBuffer] = true;
return DrawArrays();
case MAXWELL3D_REG_INDEX(topology_override):
use_topology_override = true;
return;
case MAXWELL3D_REG_INDEX(clear_buffers):
return ProcessClearBuffers();
case MAXWELL3D_REG_INDEX(query.query_get):
@ -360,6 +369,12 @@ void Maxwell3D::CallMethodFromMME(u32 method, u32 method_argument) {
}
}
void Maxwell3D::ProcessTopologyOverride() {
if (use_topology_override) {
regs.draw.topology.Assign(regs.topology_override);
}
}
void Maxwell3D::FlushMMEInlineDraw() {
LOG_TRACE(HW_GPU, "called, topology={}, count={}", regs.draw.topology.Value(),
regs.vertex_buffer.count);
@ -370,6 +385,8 @@ void Maxwell3D::FlushMMEInlineDraw() {
ASSERT_MSG(!regs.draw.instance_next || !regs.draw.instance_cont,
"Illegal combination of instancing parameters");
ProcessTopologyOverride();
const bool is_indexed = mme_draw.current_mode == MMEDrawMode::Indexed;
if (ShouldExecute()) {
rasterizer->Draw(is_indexed, true);
@ -390,6 +407,7 @@ void Maxwell3D::FlushMMEInlineDraw() {
mme_draw.instance_mode = false;
mme_draw.gl_begin_consume = false;
mme_draw.gl_end_count = 0;
use_topology_override = false;
}
void Maxwell3D::ProcessMacroUpload(u32 data) {
@ -529,6 +547,8 @@ void Maxwell3D::DrawArrays() {
ASSERT_MSG(!regs.draw.instance_next || !regs.draw.instance_cont,
"Illegal combination of instancing parameters");
ProcessTopologyOverride();
if (regs.draw.instance_next) {
// Increment the current instance *before* drawing.
state.current_instance += 1;
@ -551,6 +571,7 @@ void Maxwell3D::DrawArrays() {
} else {
regs.vertex_buffer.count = 0;
}
use_topology_override = false;
}
std::optional<u64> Maxwell3D::GetQueryResult() {

View file

@ -1200,7 +1200,12 @@ public:
}
} index_array;
INSERT_PADDING_WORDS_NOINIT(0x7);
union {
BitField<0, 16, u32> first;
BitField<16, 16, u32> count;
} small_index;
INSERT_PADDING_WORDS_NOINIT(0x6);
INSERT_PADDING_WORDS_NOINIT(0x1F);
@ -1244,7 +1249,11 @@ public:
BitField<11, 1, u32> depth_clamp_disabled;
} view_volume_clip_control;
INSERT_PADDING_WORDS_NOINIT(0x1F);
INSERT_PADDING_WORDS_NOINIT(0xC);
PrimitiveTopology topology_override;
INSERT_PADDING_WORDS_NOINIT(0x12);
u32 depth_bounds_enable;
@ -1531,6 +1540,9 @@ private:
/// Handles a write to the VERTEX_END_GL register, triggering a draw.
void DrawArrays();
/// Handles use of topology overrides (e.g., to avoid using a topology assigned from a macro)
void ProcessTopologyOverride();
// Handles a instance drawcall from MME
void StepInstance(MMEDrawMode expected_mode, u32 count);
@ -1569,6 +1581,7 @@ private:
Upload::State upload_state;
bool execute_on{true};
bool use_topology_override{false};
};
#define ASSERT_REG_POSITION(field_name, position) \
@ -1685,6 +1698,7 @@ ASSERT_REG_POSITION(draw, 0x585);
ASSERT_REG_POSITION(primitive_restart, 0x591);
ASSERT_REG_POSITION(provoking_vertex_last, 0x5A1);
ASSERT_REG_POSITION(index_array, 0x5F2);
ASSERT_REG_POSITION(small_index, 0x5F9);
ASSERT_REG_POSITION(polygon_offset_clamp, 0x61F);
ASSERT_REG_POSITION(instanced_arrays, 0x620);
ASSERT_REG_POSITION(vp_point_size, 0x644);
@ -1694,6 +1708,7 @@ ASSERT_REG_POSITION(cull_face, 0x648);
ASSERT_REG_POSITION(pixel_center_integer, 0x649);
ASSERT_REG_POSITION(viewport_transform_enabled, 0x64B);
ASSERT_REG_POSITION(view_volume_clip_control, 0x64F);
ASSERT_REG_POSITION(topology_override, 0x65C);
ASSERT_REG_POSITION(depth_bounds_enable, 0x66F);
ASSERT_REG_POSITION(logic_op, 0x671);
ASSERT_REG_POSITION(clear_buffers, 0x674);

View file

@ -1067,7 +1067,8 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im
}
break;
case PixelFormat::A8B8G8R8_UNORM:
if (src_view.format == PixelFormat::S8_UINT_D24_UNORM) {
if (src_view.format == PixelFormat::S8_UINT_D24_UNORM ||
src_view.format == PixelFormat::D24_UNORM_S8_UINT) {
return blit_image_helper.ConvertD24S8ToABGR8(dst, src_view);
}
break;