mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-14 05:55:13 +01:00
Merge remote-tracking branch 'upstream/master' into fix-smashbros
This commit is contained in:
commit
a378014156
@ -7,7 +7,7 @@ if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dis
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Default clang-format points to default 3.5 version one
|
# Default clang-format points to default 3.5 version one
|
||||||
CLANG_FORMAT=clang-format-15
|
CLANG_FORMAT=clang-format-18
|
||||||
$CLANG_FORMAT --version
|
$CLANG_FORMAT --version
|
||||||
|
|
||||||
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
|
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
if [ "$TARGET" = "appimage" ]; then
|
if [ "$TARGET" = "appimage" ]; then
|
||||||
# Compile the AppImage we distribute with Clang.
|
# Compile the AppImage we distribute with Clang.
|
||||||
export EXTRA_CMAKE_FLAGS=(-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=/etc/bin/ld.lld)
|
export EXTRA_CMAKE_FLAGS=(-DCMAKE_LINKER=/etc/bin/ld.lld)
|
||||||
else
|
else
|
||||||
# For the linux-fresh verification target, verify compilation without PCH as well.
|
# For the linux-fresh verification target, verify compilation without PCH as well.
|
||||||
export EXTRA_CMAKE_FLAGS=(-DCITRA_USE_PRECOMPILED_HEADERS=OFF)
|
export EXTRA_CMAKE_FLAGS=(-DCITRA_USE_PRECOMPILED_HEADERS=OFF)
|
||||||
@ -13,6 +13,8 @@ cmake .. -G Ninja \
|
|||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DCMAKE_CXX_COMPILER=clang++-18 \
|
||||||
|
-DCMAKE_C_COMPILER=clang-18 \
|
||||||
"${EXTRA_CMAKE_FLAGS[@]}" \
|
"${EXTRA_CMAKE_FLAGS[@]}" \
|
||||||
-DENABLE_QT_TRANSLATION=ON \
|
-DENABLE_QT_TRANSLATION=ON \
|
||||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \
|
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: ["appimage", "fresh"]
|
target: ["appimage", "fresh"]
|
||||||
container:
|
container:
|
||||||
image: polarzincomfrio/lime-build-environments:linux-${{ matrix.target }}
|
image: opensauce04/lime3ds-build:latest
|
||||||
options: -u 1001
|
options: -u 1001
|
||||||
env:
|
env:
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
|
2
.github/workflows/format.yml
vendored
2
.github/workflows/format.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
clang-format:
|
clang-format:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: polarzincomfrio/lime-build-environments:linux-fresh
|
image: opensauce04/lime3ds-build:latest
|
||||||
options: -u 1001
|
options: -u 1001
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -117,7 +117,7 @@ else()
|
|||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||||
# _FORTIFY_SOURCE can't be used without optimizations.
|
# _FORTIFY_SOURCE can't be used without optimizations.
|
||||||
add_compile_options(-Wp,-D_FORTIFY_SOURCE=2)
|
add_compile_options(-D_FORTIFY_SOURCE=2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CITRA_WARNINGS_AS_ERRORS)
|
if (CITRA_WARNINGS_AS_ERRORS)
|
||||||
|
@ -42,7 +42,9 @@ struct CaptureSession final {
|
|||||||
|
|
||||||
#define MEMBER(type, name, func) \
|
#define MEMBER(type, name, func) \
|
||||||
struct type##Deleter { \
|
struct type##Deleter { \
|
||||||
void operator()(type* ptr) { type##_##func(ptr); } \
|
void operator()(type* ptr) { \
|
||||||
|
type##_##func(ptr); \
|
||||||
|
} \
|
||||||
}; \
|
}; \
|
||||||
std::unique_ptr<type, type##Deleter> name
|
std::unique_ptr<type, type##Deleter> name
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ class SharedContext_Android : public Frontend::GraphicsContext {
|
|||||||
public:
|
public:
|
||||||
SharedContext_Android(EGLDisplay egl_display, EGLConfig egl_config,
|
SharedContext_Android(EGLDisplay egl_display, EGLConfig egl_config,
|
||||||
EGLContext egl_share_context)
|
EGLContext egl_share_context)
|
||||||
: egl_display{egl_display}, egl_surface{eglCreatePbufferSurface(egl_display, egl_config,
|
: egl_display{egl_display},
|
||||||
egl_empty_attribs.data())},
|
egl_surface{eglCreatePbufferSurface(egl_display, egl_config, egl_empty_attribs.data())},
|
||||||
egl_context{eglCreateContext(egl_display, egl_config, egl_share_context,
|
egl_context{eglCreateContext(egl_display, egl_config, egl_share_context,
|
||||||
egl_context_attribs.data())} {
|
egl_context_attribs.data())} {
|
||||||
ASSERT_MSG(egl_surface, "eglCreatePbufferSurface() failed!");
|
ASSERT_MSG(egl_surface, "eglCreatePbufferSurface() failed!");
|
||||||
|
@ -215,8 +215,8 @@ Joystick::~Joystick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ButtonFactory::ButtonFactory()
|
ButtonFactory::ButtonFactory()
|
||||||
: button_list{std::make_shared<ButtonList>()}, analog_button_list{
|
: button_list{std::make_shared<ButtonList>()},
|
||||||
std::make_shared<AnalogButtonList>()} {}
|
analog_button_list{std::make_shared<AnalogButtonList>()} {}
|
||||||
|
|
||||||
std::unique_ptr<Input::ButtonDevice> ButtonFactory::Create(const Common::ParamPackage& params) {
|
std::unique_ptr<Input::ButtonDevice> ButtonFactory::Create(const Common::ParamPackage& params) {
|
||||||
if (params.Has("axis")) {
|
if (params.Has("axis")) {
|
||||||
|
@ -599,14 +599,14 @@ public:
|
|||||||
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
||||||
std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr>
|
std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr>
|
||||||
constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
||||||
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{
|
: impl_base{unexpect_t{}, std::move(e.value())},
|
||||||
detail::default_constructor_tag{}} {}
|
ctor_base{detail::default_constructor_tag{}} {}
|
||||||
|
|
||||||
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
||||||
std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr>
|
std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr>
|
||||||
constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
||||||
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{
|
: impl_base{unexpect_t{}, std::move(e.value())},
|
||||||
detail::default_constructor_tag{}} {}
|
ctor_base{detail::default_constructor_tag{}} {}
|
||||||
|
|
||||||
template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr>
|
template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr>
|
||||||
constexpr explicit Expected(unexpect_t, Args&&... args)
|
constexpr explicit Expected(unexpect_t, Args&&... args)
|
||||||
|
@ -204,8 +204,8 @@ public:
|
|||||||
explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val,
|
explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val,
|
||||||
const std::string& name)
|
const std::string& name)
|
||||||
requires(ranged)
|
requires(ranged)
|
||||||
: value{default_val},
|
: value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val},
|
||||||
default_value{default_val}, maximum{max_val}, minimum{min_val}, label{name} {}
|
label{name} {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a reference to the setting's value.
|
* Returns a reference to the setting's value.
|
||||||
@ -460,8 +460,7 @@ struct Values {
|
|||||||
// TODO: Add a null renderer backend for this, perhaps.
|
// TODO: Add a null renderer backend for this, perhaps.
|
||||||
#error "At least one renderer must be enabled."
|
#error "At least one renderer must be enabled."
|
||||||
#endif
|
#endif
|
||||||
GraphicsAPI::Software, GraphicsAPI::Vulkan, "graphics_api"
|
GraphicsAPI::Software, GraphicsAPI::Vulkan, "graphics_api"};
|
||||||
};
|
|
||||||
SwitchableSetting<u32> physical_device{0, "physical_device"};
|
SwitchableSetting<u32> physical_device{0, "physical_device"};
|
||||||
Setting<bool> use_gles{false, "use_gles"};
|
Setting<bool> use_gles{false, "use_gles"};
|
||||||
Setting<bool> renderer_debug{false, "renderer_debug"};
|
Setting<bool> renderer_debug{false, "renderer_debug"};
|
||||||
|
@ -396,7 +396,9 @@ public:
|
|||||||
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
|
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
|
||||||
// component names (x<->r) and permutations (xy<->yx)
|
// component names (x<->r) and permutations (xy<->yx)
|
||||||
#define _DEFINE_SWIZZLER2(a, b, name) \
|
#define _DEFINE_SWIZZLER2(a, b, name) \
|
||||||
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
|
[[nodiscard]] constexpr Vec2<T> name() const { \
|
||||||
|
return Vec2<T>(a, b); \
|
||||||
|
}
|
||||||
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
|
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
|
||||||
_DEFINE_SWIZZLER2(a, b, a##b); \
|
_DEFINE_SWIZZLER2(a, b, a##b); \
|
||||||
_DEFINE_SWIZZLER2(a, b, a2##b2); \
|
_DEFINE_SWIZZLER2(a, b, a2##b2); \
|
||||||
@ -596,7 +598,9 @@ public:
|
|||||||
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
|
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
|
||||||
// permutations (xy<->yx)
|
// permutations (xy<->yx)
|
||||||
#define _DEFINE_SWIZZLER2(a, b, name) \
|
#define _DEFINE_SWIZZLER2(a, b, name) \
|
||||||
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
|
[[nodiscard]] constexpr Vec2<T> name() const { \
|
||||||
|
return Vec2<T>(a, b); \
|
||||||
|
}
|
||||||
#define DEFINE_SWIZZLER2_COMP1(a, a2) \
|
#define DEFINE_SWIZZLER2_COMP1(a, a2) \
|
||||||
_DEFINE_SWIZZLER2(a, a, a##a); \
|
_DEFINE_SWIZZLER2(a, a, a##a); \
|
||||||
_DEFINE_SWIZZLER2(a, a, a2##a2)
|
_DEFINE_SWIZZLER2(a, a, a2##a2)
|
||||||
@ -621,7 +625,9 @@ public:
|
|||||||
#undef _DEFINE_SWIZZLER2
|
#undef _DEFINE_SWIZZLER2
|
||||||
|
|
||||||
#define _DEFINE_SWIZZLER3(a, b, c, name) \
|
#define _DEFINE_SWIZZLER3(a, b, c, name) \
|
||||||
[[nodiscard]] constexpr Vec3<T> name() const { return Vec3<T>(a, b, c); }
|
[[nodiscard]] constexpr Vec3<T> name() const { \
|
||||||
|
return Vec3<T>(a, b, c); \
|
||||||
|
}
|
||||||
#define DEFINE_SWIZZLER3_COMP1(a, a2) \
|
#define DEFINE_SWIZZLER3_COMP1(a, a2) \
|
||||||
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \
|
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \
|
||||||
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)
|
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)
|
||||||
|
@ -12,9 +12,8 @@
|
|||||||
#include "ui_configure_cheats.h"
|
#include "ui_configure_cheats.h"
|
||||||
|
|
||||||
ConfigureCheats::ConfigureCheats(Cheats::CheatEngine& cheat_engine_, u64 title_id_, QWidget* parent)
|
ConfigureCheats::ConfigureCheats(Cheats::CheatEngine& cheat_engine_, u64 title_id_, QWidget* parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent), ui(std::make_unique<Ui::ConfigureCheats>()), cheat_engine{cheat_engine_},
|
||||||
ui(std::make_unique<Ui::ConfigureCheats>()), cheat_engine{cheat_engine_}, title_id{
|
title_id{title_id_} {
|
||||||
title_id_} {
|
|
||||||
// Setup gui control settings
|
// Setup gui control settings
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->tableCheats->setColumnWidth(0, 30);
|
ui->tableCheats->setColumnWidth(0, 30);
|
||||||
|
@ -141,8 +141,8 @@ QString BreakPointModel::DebugContextEventToString(Pica::DebugContext::Event eve
|
|||||||
|
|
||||||
GraphicsBreakPointsWidget::GraphicsBreakPointsWidget(
|
GraphicsBreakPointsWidget::GraphicsBreakPointsWidget(
|
||||||
std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent)
|
std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent)
|
||||||
: QDockWidget(tr("Pica Breakpoints"), parent), Pica::DebugContext::BreakPointObserver(
|
: QDockWidget(tr("Pica Breakpoints"), parent),
|
||||||
debug_context) {
|
Pica::DebugContext::BreakPointObserver(debug_context) {
|
||||||
setObjectName(QStringLiteral("PicaBreakPointsWidget"));
|
setObjectName(QStringLiteral("PicaBreakPointsWidget"));
|
||||||
|
|
||||||
status_text = new QLabel(tr("Emulation running"));
|
status_text = new QLabel(tr("Emulation running"));
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
#include "ui_movie_play_dialog.h"
|
#include "ui_movie_play_dialog.h"
|
||||||
|
|
||||||
MoviePlayDialog::MoviePlayDialog(QWidget* parent, GameList* game_list_, const Core::System& system_)
|
MoviePlayDialog::MoviePlayDialog(QWidget* parent, GameList* game_list_, const Core::System& system_)
|
||||||
: QDialog(parent),
|
: QDialog(parent), ui(std::make_unique<Ui::MoviePlayDialog>()), game_list{game_list_},
|
||||||
ui(std::make_unique<Ui::MoviePlayDialog>()), game_list{game_list_}, system{system_} {
|
system{system_} {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
|
@ -43,8 +43,8 @@ struct GPU::Impl {
|
|||||||
: timing{system.CoreTiming()}, system{system}, memory{system.Memory()},
|
: timing{system.CoreTiming()}, system{system}, memory{system.Memory()},
|
||||||
debug_context{Pica::g_debug_context}, pica{memory, debug_context},
|
debug_context{Pica::g_debug_context}, pica{memory, debug_context},
|
||||||
renderer{VideoCore::CreateRenderer(emu_window, secondary_window, pica, system)},
|
renderer{VideoCore::CreateRenderer(emu_window, secondary_window, pica, system)},
|
||||||
rasterizer{renderer->Rasterizer()}, sw_blitter{std::make_unique<SwRenderer::SwBlitter>(
|
rasterizer{renderer->Rasterizer()},
|
||||||
memory, rasterizer)} {}
|
sw_blitter{std::make_unique<SwRenderer::SwBlitter>(memory, rasterizer)} {}
|
||||||
~Impl() = default;
|
~Impl() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,9 +31,8 @@ union CommandHeader {
|
|||||||
static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!");
|
static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!");
|
||||||
|
|
||||||
PicaCore::PicaCore(Memory::MemorySystem& memory_, std::shared_ptr<DebugContext> debug_context_)
|
PicaCore::PicaCore(Memory::MemorySystem& memory_, std::shared_ptr<DebugContext> debug_context_)
|
||||||
: memory{memory_}, debug_context{std::move(debug_context_)}, geometry_pipeline{regs.internal,
|
: memory{memory_}, debug_context{std::move(debug_context_)},
|
||||||
gs_unit,
|
geometry_pipeline{regs.internal, gs_unit, gs_setup},
|
||||||
gs_setup},
|
|
||||||
shader_engine{CreateEngine(Settings::values.use_shader_jit.GetValue())} {
|
shader_engine{CreateEngine(Settings::values.use_shader_jit.GetValue())} {
|
||||||
InitializeRegs();
|
InitializeRegs();
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@ OGLProgram CreateProgram(std::string_view frag) {
|
|||||||
|
|
||||||
BlitHelper::BlitHelper(const Driver& driver_)
|
BlitHelper::BlitHelper(const Driver& driver_)
|
||||||
: driver{driver_}, linear_sampler{CreateSampler(GL_LINEAR)},
|
: driver{driver_}, linear_sampler{CreateSampler(GL_LINEAR)},
|
||||||
nearest_sampler{CreateSampler(GL_NEAREST)}, bicubic_program{CreateProgram(
|
nearest_sampler{CreateSampler(GL_NEAREST)},
|
||||||
HostShaders::BICUBIC_FRAG)},
|
bicubic_program{CreateProgram(HostShaders::BICUBIC_FRAG)},
|
||||||
scale_force_program{CreateProgram(HostShaders::SCALE_FORCE_FRAG)},
|
scale_force_program{CreateProgram(HostShaders::SCALE_FORCE_FRAG)},
|
||||||
xbrz_program{CreateProgram(HostShaders::XBRZ_FREESCALE_FRAG)},
|
xbrz_program{CreateProgram(HostShaders::XBRZ_FREESCALE_FRAG)},
|
||||||
mmpx_program{CreateProgram(HostShaders::MMPX_FRAG)}, gradient_x_program{CreateProgram(
|
mmpx_program{CreateProgram(HostShaders::MMPX_FRAG)},
|
||||||
HostShaders::X_GRADIENT_FRAG)},
|
gradient_x_program{CreateProgram(HostShaders::X_GRADIENT_FRAG)},
|
||||||
gradient_y_program{CreateProgram(HostShaders::Y_GRADIENT_FRAG)},
|
gradient_y_program{CreateProgram(HostShaders::Y_GRADIENT_FRAG)},
|
||||||
refine_program{CreateProgram(HostShaders::REFINE_FRAG)},
|
refine_program{CreateProgram(HostShaders::REFINE_FRAG)},
|
||||||
d24s8_to_rgba8{CreateProgram(HostShaders::D24S8_TO_RGBA8_FRAG)},
|
d24s8_to_rgba8{CreateProgram(HostShaders::D24S8_TO_RGBA8_FRAG)},
|
||||||
|
@ -79,13 +79,12 @@ RasterizerOpenGL::RasterizerOpenGL(Memory::MemorySystem& memory, Pica::PicaCore&
|
|||||||
: VideoCore::RasterizerAccelerated{memory, pica}, driver{driver_},
|
: VideoCore::RasterizerAccelerated{memory, pica}, driver{driver_},
|
||||||
shader_manager{renderer.GetRenderWindow(), driver, !driver.IsOpenGLES()},
|
shader_manager{renderer.GetRenderWindow(), driver, !driver.IsOpenGLES()},
|
||||||
runtime{driver, renderer}, res_cache{memory, custom_tex_manager, runtime, regs, renderer},
|
runtime{driver, renderer}, res_cache{memory, custom_tex_manager, runtime, regs, renderer},
|
||||||
texture_buffer_size{TextureBufferSize()}, vertex_buffer{driver, GL_ARRAY_BUFFER,
|
texture_buffer_size{TextureBufferSize()},
|
||||||
VERTEX_BUFFER_SIZE},
|
vertex_buffer{driver, GL_ARRAY_BUFFER, VERTEX_BUFFER_SIZE},
|
||||||
uniform_buffer{driver, GL_UNIFORM_BUFFER, UNIFORM_BUFFER_SIZE},
|
uniform_buffer{driver, GL_UNIFORM_BUFFER, UNIFORM_BUFFER_SIZE},
|
||||||
index_buffer{driver, GL_ELEMENT_ARRAY_BUFFER, INDEX_BUFFER_SIZE},
|
index_buffer{driver, GL_ELEMENT_ARRAY_BUFFER, INDEX_BUFFER_SIZE},
|
||||||
texture_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size}, texture_lf_buffer{
|
texture_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size},
|
||||||
driver, GL_TEXTURE_BUFFER,
|
texture_lf_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size} {
|
||||||
texture_buffer_size} {
|
|
||||||
|
|
||||||
// Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0
|
// Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0
|
||||||
state.clip_distance[0] = true;
|
state.clip_distance[0] = true;
|
||||||
@ -965,10 +964,9 @@ void RasterizerOpenGL::SyncAndUploadLUTsLF() {
|
|||||||
if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
|
if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
|
||||||
std::array<Common::Vec2f, 128> new_data;
|
std::array<Common::Vec2f, 128> new_data;
|
||||||
|
|
||||||
std::transform(pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
|
std::transform(
|
||||||
[](const auto& entry) {
|
pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
|
||||||
return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()};
|
[](const auto& entry) { return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; });
|
||||||
});
|
|
||||||
|
|
||||||
if (new_data != fog_lut_data || invalidate) {
|
if (new_data != fog_lut_data || invalidate) {
|
||||||
fog_lut_data = new_data;
|
fog_lut_data = new_data;
|
||||||
|
@ -331,8 +331,8 @@ public:
|
|||||||
ShaderProgramManager::ShaderProgramManager(Frontend::EmuWindow& emu_window_, const Driver& driver_,
|
ShaderProgramManager::ShaderProgramManager(Frontend::EmuWindow& emu_window_, const Driver& driver_,
|
||||||
bool separable)
|
bool separable)
|
||||||
: emu_window{emu_window_}, driver{driver_},
|
: emu_window{emu_window_}, driver{driver_},
|
||||||
strict_context_required{emu_window.StrictContextRequired()}, impl{std::make_unique<Impl>(
|
strict_context_required{emu_window.StrictContextRequired()},
|
||||||
driver_, separable)} {}
|
impl{std::make_unique<Impl>(driver_, separable)} {}
|
||||||
|
|
||||||
ShaderProgramManager::~ShaderProgramManager() = default;
|
ShaderProgramManager::~ShaderProgramManager() = default;
|
||||||
|
|
||||||
|
@ -602,8 +602,8 @@ void Surface::BlitScale(const VideoCore::TextureBlit& blit, bool up_scale) {
|
|||||||
|
|
||||||
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
|
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
|
||||||
const Surface* color, const Surface* depth)
|
const Surface* color, const Surface* depth)
|
||||||
: VideoCore::FramebufferParams{params}, res_scale{color ? color->res_scale
|
: VideoCore::FramebufferParams{params},
|
||||||
: (depth ? depth->res_scale : 1u)} {
|
res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)} {
|
||||||
|
|
||||||
if (shadow_rendering && !color) {
|
if (shadow_rendering && !color) {
|
||||||
return;
|
return;
|
||||||
|
@ -75,9 +75,8 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons
|
|||||||
RendererOpenGL::RendererOpenGL(Core::System& system, Pica::PicaCore& pica_,
|
RendererOpenGL::RendererOpenGL(Core::System& system, Pica::PicaCore& pica_,
|
||||||
Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
|
Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
|
||||||
: VideoCore::RendererBase{system, window, secondary_window}, pica{pica_},
|
: VideoCore::RendererBase{system, window, secondary_window}, pica{pica_},
|
||||||
rasterizer{system.Memory(), pica, system.CustomTexManager(), *this, driver}, frame_dumper{
|
rasterizer{system.Memory(), pica, system.CustomTexManager(), *this, driver},
|
||||||
system,
|
frame_dumper{system, window} {
|
||||||
window} {
|
|
||||||
const bool has_debug_tool = driver.HasDebugTool();
|
const bool has_debug_tool = driver.HasDebugTool();
|
||||||
window.mailbox = std::make_unique<OGLTextureMailbox>(has_debug_tool);
|
window.mailbox = std::make_unique<OGLTextureMailbox>(has_debug_tool);
|
||||||
if (secondary_window) {
|
if (secondary_window) {
|
||||||
|
@ -54,7 +54,8 @@ RendererVulkan::RendererVulkan(Core::System& system, Pica::PicaCore& pica_,
|
|||||||
Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
|
Frontend::EmuWindow& window, Frontend::EmuWindow* secondary_window)
|
||||||
: RendererBase{system, window, secondary_window}, memory{system.Memory()}, pica{pica_},
|
: RendererBase{system, window, secondary_window}, memory{system.Memory()}, pica{pica_},
|
||||||
instance{window, Settings::values.physical_device.GetValue()}, scheduler{instance},
|
instance{window, Settings::values.physical_device.GetValue()}, scheduler{instance},
|
||||||
renderpass_cache{instance, scheduler}, main_window{window, instance, scheduler},
|
renderpass_cache{instance, scheduler}, pool{instance},
|
||||||
|
main_window{window, instance, scheduler},
|
||||||
vertex_buffer{instance, scheduler, vk::BufferUsageFlagBits::eVertexBuffer,
|
vertex_buffer{instance, scheduler, vk::BufferUsageFlagBits::eVertexBuffer,
|
||||||
VERTEX_BUFFER_SIZE},
|
VERTEX_BUFFER_SIZE},
|
||||||
update_queue{instance},
|
update_queue{instance},
|
||||||
|
@ -132,14 +132,14 @@ std::string GetReadableVersion(u32 version) {
|
|||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
Instance::Instance(bool enable_validation, bool dump_command_buffers)
|
Instance::Instance(bool enable_validation, bool dump_command_buffers)
|
||||||
: library{OpenLibrary()}, instance{CreateInstance(*library,
|
: library{OpenLibrary()},
|
||||||
Frontend::WindowSystemType::Headless,
|
instance{CreateInstance(*library, Frontend::WindowSystemType::Headless, enable_validation,
|
||||||
enable_validation, dump_command_buffers)},
|
dump_command_buffers)},
|
||||||
physical_devices{instance->enumeratePhysicalDevices()} {}
|
physical_devices{instance->enumeratePhysicalDevices()} {}
|
||||||
|
|
||||||
Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index)
|
Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index)
|
||||||
: library{OpenLibrary(&window)}, instance{CreateInstance(
|
: library{OpenLibrary(&window)},
|
||||||
*library, window.GetWindowInfo().type,
|
instance{CreateInstance(*library, window.GetWindowInfo().type,
|
||||||
Settings::values.renderer_debug.GetValue(),
|
Settings::values.renderer_debug.GetValue(),
|
||||||
Settings::values.dump_command_buffers.GetValue())},
|
Settings::values.dump_command_buffers.GetValue())},
|
||||||
debug_callback{CreateDebugCallback(*instance, debug_utils_supported)},
|
debug_callback{CreateDebugCallback(*instance, debug_utils_supported)},
|
||||||
|
@ -100,8 +100,8 @@ bool CanBlitToSwapchain(const vk::PhysicalDevice& physical_device, vk::Format fo
|
|||||||
PresentWindow::PresentWindow(Frontend::EmuWindow& emu_window_, const Instance& instance_,
|
PresentWindow::PresentWindow(Frontend::EmuWindow& emu_window_, const Instance& instance_,
|
||||||
Scheduler& scheduler_)
|
Scheduler& scheduler_)
|
||||||
: emu_window{emu_window_}, instance{instance_}, scheduler{scheduler_},
|
: emu_window{emu_window_}, instance{instance_}, scheduler{scheduler_},
|
||||||
surface{CreateSurface(instance.GetInstance(), emu_window)},
|
surface{CreateSurface(instance.GetInstance(), emu_window)}, next_surface{surface},
|
||||||
next_surface{surface}, swapchain{instance, emu_window.GetFramebufferLayout().width,
|
swapchain{instance, emu_window.GetFramebufferLayout().width,
|
||||||
emu_window.GetFramebufferLayout().height, surface},
|
emu_window.GetFramebufferLayout().height, surface},
|
||||||
graphics_queue{instance.GetGraphicsQueue()}, present_renderpass{CreateRenderpass()},
|
graphics_queue{instance.GetGraphicsQueue()}, present_renderpass{CreateRenderpass()},
|
||||||
vsync_enabled{Settings::values.use_vsync_new.GetValue()},
|
vsync_enabled{Settings::values.use_vsync_new.GetValue()},
|
||||||
|
@ -61,11 +61,9 @@ RasterizerVulkan::RasterizerVulkan(Memory::MemorySystem& memory, Pica::PicaCore&
|
|||||||
Scheduler& scheduler, RenderManager& renderpass_cache,
|
Scheduler& scheduler, RenderManager& renderpass_cache,
|
||||||
DescriptorUpdateQueue& update_queue_, u32 image_count)
|
DescriptorUpdateQueue& update_queue_, u32 image_count)
|
||||||
: RasterizerAccelerated{memory, pica}, instance{instance}, scheduler{scheduler},
|
: RasterizerAccelerated{memory, pica}, instance{instance}, scheduler{scheduler},
|
||||||
renderpass_cache{renderpass_cache}, update_queue{update_queue_},
|
renderpass_cache{renderpass_cache},
|
||||||
pipeline_cache{instance, scheduler, renderpass_cache, update_queue}, runtime{instance,
|
pipeline_cache{instance, scheduler, renderpass_cache, pool},
|
||||||
scheduler,
|
runtime{instance, scheduler, renderpass_cache, pool, pipeline_cache.TextureProvider(),
|
||||||
renderpass_cache,
|
|
||||||
update_queue,
|
|
||||||
image_count},
|
image_count},
|
||||||
res_cache{memory, custom_tex_manager, runtime, regs, renderer},
|
res_cache{memory, custom_tex_manager, runtime, regs, renderer},
|
||||||
stream_buffer{instance, scheduler, BUFFER_USAGE, STREAM_BUFFER_SIZE},
|
stream_buffer{instance, scheduler, BUFFER_USAGE, STREAM_BUFFER_SIZE},
|
||||||
@ -966,10 +964,9 @@ void RasterizerVulkan::SyncAndUploadLUTsLF() {
|
|||||||
if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
|
if (fs_uniform_block_data.fog_lut_dirty || invalidate) {
|
||||||
std::array<Common::Vec2f, 128> new_data;
|
std::array<Common::Vec2f, 128> new_data;
|
||||||
|
|
||||||
std::transform(pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
|
std::transform(
|
||||||
[](const auto& entry) {
|
pica.fog.lut.begin(), pica.fog.lut.end(), new_data.begin(),
|
||||||
return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()};
|
[](const auto& entry) { return Common::Vec2f{entry.ToFloat(), entry.DiffToFloat()}; });
|
||||||
});
|
|
||||||
|
|
||||||
if (new_data != fog_lut_data || invalidate) {
|
if (new_data != fog_lut_data || invalidate) {
|
||||||
fog_lut_data = new_data;
|
fog_lut_data = new_data;
|
||||||
|
@ -1450,8 +1450,8 @@ void Surface::BlitScale(const VideoCore::TextureBlit& blit, bool up_scale) {
|
|||||||
|
|
||||||
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
|
Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferParams& params,
|
||||||
Surface* color, Surface* depth)
|
Surface* color, Surface* depth)
|
||||||
: VideoCore::FramebufferParams{params}, res_scale{color ? color->res_scale
|
: VideoCore::FramebufferParams{params},
|
||||||
: (depth ? depth->res_scale : 1u)} {
|
res_scale{color ? color->res_scale : (depth ? depth->res_scale : 1u)} {
|
||||||
auto& renderpass_cache = runtime.GetRenderpassCache();
|
auto& renderpass_cache = runtime.GetRenderpassCache();
|
||||||
if (shadow_rendering && !color) {
|
if (shadow_rendering && !color) {
|
||||||
return;
|
return;
|
||||||
@ -1544,8 +1544,8 @@ Sampler::Sampler(TextureRuntime& runtime, const VideoCore::SamplerParams& params
|
|||||||
Sampler::~Sampler() = default;
|
Sampler::~Sampler() = default;
|
||||||
|
|
||||||
DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f color, std::string_view label)
|
DebugScope::DebugScope(TextureRuntime& runtime, Common::Vec4f color, std::string_view label)
|
||||||
: scheduler{runtime.GetScheduler()}, has_debug_tool{
|
: scheduler{runtime.GetScheduler()},
|
||||||
runtime.GetInstance().HasDebuggingToolAttached()} {
|
has_debug_tool{runtime.GetInstance().HasDebuggingToolAttached()} {
|
||||||
if (!has_debug_tool) {
|
if (!has_debug_tool) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user