mirror of
https://github.com/citra-emu/citra-canary.git
synced 2026-10-26 22:36:16 +00:00
Compare commits
14 commits
canary-278
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9969810e2 | ||
|
|
0e9250c2f0 | ||
|
|
5d53d8c891 | ||
|
|
a37426f23d | ||
|
|
0ebc2068a0 | ||
|
|
ab626208c5 | ||
|
|
0ff3440232 | ||
|
|
69e758d738 | ||
|
|
f4768cd26c | ||
|
|
e0d2c1308e | ||
|
|
4f9fc88bb3 | ||
|
|
d857743075 | ||
|
|
b5042a5257 | ||
|
|
e524542a40 |
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
|
@ -81,7 +81,7 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.target }}-
|
||||
- name: Install tools
|
||||
run: brew install ccache glslang ninja
|
||||
run: brew install ccache ninja
|
||||
- name: Build
|
||||
run: ./.ci/macos.sh
|
||||
- name: Prepare outputs for caching
|
||||
|
|
@ -153,13 +153,6 @@ jobs:
|
|||
- name: Install extra tools (MSVC)
|
||||
run: choco install ccache ninja wget
|
||||
if: ${{ matrix.target == 'msvc' }}
|
||||
- name: Set up Vulkan SDK (MSVC)
|
||||
uses: humbletim/setup-vulkan-sdk@v1.2.0
|
||||
if: ${{ matrix.target == 'msvc' }}
|
||||
with:
|
||||
vulkan-query-version: latest
|
||||
vulkan-components: SPIRV-Tools, Glslang
|
||||
vulkan-use-cache: true
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
if: ${{ matrix.target == 'msys2' }}
|
||||
|
|
@ -168,10 +161,8 @@ jobs:
|
|||
update: true
|
||||
install: git make p7zip
|
||||
pacboy: >-
|
||||
toolchain:p ccache:p cmake:p ninja:p glslang:p
|
||||
toolchain:p ccache:p cmake:p ninja:p
|
||||
qt6-base:p qt6-multimedia:p qt6-multimedia-wmf:p qt6-tools:p qt6-translations:p
|
||||
- name: Test glslang
|
||||
run: glslang --version || glslangValidator --version
|
||||
- name: Disable line ending translation
|
||||
run: git config --global core.autocrlf input
|
||||
- name: Build
|
||||
|
|
@ -215,7 +206,7 @@ jobs:
|
|||
run: |
|
||||
sudo add-apt-repository -y ppa:theofficialgman/gpu-tools
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install ccache glslang-dev glslang-tools apksigner -y
|
||||
sudo apt-get install ccache apksigner -y
|
||||
- name: Build
|
||||
run: JAVA_HOME=$JAVA_HOME_17_X64 ./.ci/android.sh
|
||||
env:
|
||||
|
|
@ -253,7 +244,7 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-ios-
|
||||
- name: Install tools
|
||||
run: brew install ccache glslang ninja
|
||||
run: brew install ccache ninja
|
||||
- name: Build
|
||||
run: ./.ci/ios.sh
|
||||
release:
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
| [7372](https://github.com/citra-emu/citra//pull/7372) | [`265ed7ec1`](https://github.com/citra-emu/citra//pull/7372/files) | pica_types: Correctly restrict Float<M, E> precision | [vitor-k](https://github.com/vitor-k/) | Yes |
|
||||
| [7384](https://github.com/citra-emu/citra//pull/7384) | [`20ef8e47e`](https://github.com/citra-emu/citra//pull/7384/files) | host_shaders: Remove dependency on shaderSampledImageArrayDynamicIndexing | [GPUCode](https://github.com/GPUCode/) | Yes |
|
||||
| [7420](https://github.com/citra-emu/citra//pull/7420) | [`1d2f9bc7c`](https://github.com/citra-emu/citra//pull/7420/files) | 3dsx: Minor cleanups and add argument support | [GPUCode](https://github.com/GPUCode/) | Yes |
|
||||
| [7429](https://github.com/citra-emu/citra//pull/7429) | [`0c9037f07`](https://github.com/citra-emu/citra//pull/7429/files) | renderer_vulkan: Rewrite descriptor set management and various small fixes | [GPUCode](https://github.com/GPUCode/) | Yes |
|
||||
| [7456](https://github.com/citra-emu/citra//pull/7456) | [`d37c1f36a`](https://github.com/citra-emu/citra//pull/7456/files) | apt: Improve accuracy of applet slot states on system applet launch. | [Steveice10](https://github.com/Steveice10/) | Yes |
|
||||
| [7429](https://github.com/citra-emu/citra//pull/7429) | [`2fe2dd148`](https://github.com/citra-emu/citra//pull/7429/files) | renderer_vulkan: Rewrite descriptor set management and various small fixes | [GPUCode](https://github.com/GPUCode/) | Yes |
|
||||
| [7472](https://github.com/citra-emu/citra//pull/7472) | [`2855c5414`](https://github.com/citra-emu/citra//pull/7472/files) | y2r: Delay completion event | [GPUCode](https://github.com/GPUCode/) | Yes |
|
||||
|
||||
|
||||
End of merge log. You can find the original README.md below the break.
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ void SetColorConsoleBackendEnabled(bool enabled) {
|
|||
}
|
||||
|
||||
void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename,
|
||||
unsigned int line_num, const char* function, const char* format,
|
||||
unsigned int line_num, const char* function, fmt::string_view format,
|
||||
const fmt::format_args& args) {
|
||||
if (!initialization_in_progress_suppress_logging) {
|
||||
Impl::Instance().PushEntry(log_class, log_level, filename, line_num, function,
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ constexpr const char* TrimSourcePath(std::string_view source) {
|
|||
|
||||
/// Logs a message to the global logger, using fmt
|
||||
void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename,
|
||||
unsigned int line_num, const char* function, const char* format,
|
||||
unsigned int line_num, const char* function, fmt::string_view format,
|
||||
const fmt::format_args& args);
|
||||
|
||||
template <typename... Args>
|
||||
void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
|
||||
const char* function, const char* format, const Args&... args) {
|
||||
const char* function, fmt::format_string<Args...> format, const Args&... args) {
|
||||
FmtLogMessageImpl(log_class, log_level, filename, line_num, function, format,
|
||||
fmt::make_format_args(args...));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,18 +14,18 @@ namespace ConfigMem {
|
|||
Handler::Handler() {
|
||||
std::memset(&config_mem, 0, sizeof(config_mem));
|
||||
|
||||
// Values extracted from firmware 11.2.0-35E
|
||||
config_mem.kernel_version_min = 0x34;
|
||||
// Values extracted from firmware 11.17.0-50E
|
||||
config_mem.kernel_version_min = 0x3a;
|
||||
config_mem.kernel_version_maj = 0x2;
|
||||
config_mem.ns_tid = 0x0004013000008002;
|
||||
config_mem.sys_core_ver = 0x2;
|
||||
config_mem.unit_info = 0x1; // Bit 0 set for Retail
|
||||
config_mem.prev_firm = 0x1;
|
||||
config_mem.ctr_sdk_ver = 0x0000F297;
|
||||
config_mem.firm_version_min = 0x34;
|
||||
config_mem.ctr_sdk_ver = 0x0000F450;
|
||||
config_mem.firm_version_min = 0x3a;
|
||||
config_mem.firm_version_maj = 0x2;
|
||||
config_mem.firm_sys_core_ver = 0x2;
|
||||
config_mem.firm_ctr_sdk_ver = 0x0000F297;
|
||||
config_mem.firm_ctr_sdk_ver = 0x0000F450;
|
||||
}
|
||||
|
||||
ConfigMemDef& Handler::GetConfigMem() {
|
||||
|
|
|
|||
|
|
@ -210,10 +210,10 @@ void Process::Set3dsxKernelCaps() {
|
|||
};
|
||||
|
||||
// Similar to Rosalina, we set kernel version to a recent one.
|
||||
// This is 11.2.0, to be consistent with core/hle/kernel/config_mem.cpp
|
||||
// This is 11.17.0, to be consistent with core/hle/kernel/config_mem.cpp
|
||||
// TODO: refactor kernel version out so it is configurable and consistent
|
||||
// among all relevant places.
|
||||
kernel_version = 0x234;
|
||||
kernel_version = 0x23a;
|
||||
}
|
||||
|
||||
void Process::Run(s32 main_thread_priority, u32 stack_size) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "common/archives.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
|
|
@ -522,7 +523,13 @@ void Y2R_U::StartConversion(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
HW::Y2R::PerformConversion(system.Memory(), conversion);
|
||||
|
||||
completion_event->Signal();
|
||||
if (is_busy_conversion) {
|
||||
system.CoreTiming().RemoveEvent(completion_signal_event);
|
||||
}
|
||||
|
||||
static constexpr s64 MinY2RDelay = 50000;
|
||||
system.CoreTiming().ScheduleEvent(MinY2RDelay, completion_signal_event);
|
||||
is_busy_conversion = true;
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(ResultSuccess);
|
||||
|
|
@ -533,6 +540,10 @@ void Y2R_U::StartConversion(Kernel::HLERequestContext& ctx) {
|
|||
void Y2R_U::StopConversion(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
if (is_busy_conversion) {
|
||||
system.CoreTiming().RemoveEvent(completion_signal_event);
|
||||
}
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
|
|
@ -544,7 +555,7 @@ void Y2R_U::IsBusyConversion(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(0); // StartConversion always finishes immediately
|
||||
rb.Push(is_busy_conversion);
|
||||
|
||||
LOG_DEBUG(Service_Y2R, "called");
|
||||
}
|
||||
|
|
@ -558,34 +569,38 @@ void Y2R_U::SetPackageParameter(Kernel::HLERequestContext& ctx) {
|
|||
conversion.rotation = params.rotation;
|
||||
conversion.block_alignment = params.block_alignment;
|
||||
|
||||
Result result = conversion.SetInputLineWidth(params.input_line_width);
|
||||
|
||||
if (result.IsError())
|
||||
goto cleanup;
|
||||
|
||||
result = conversion.SetInputLines(params.input_lines);
|
||||
|
||||
if (result.IsError())
|
||||
goto cleanup;
|
||||
|
||||
result = conversion.SetStandardCoefficient(params.standard_coefficient);
|
||||
|
||||
if (result.IsError())
|
||||
goto cleanup;
|
||||
|
||||
conversion.padding = params.padding;
|
||||
conversion.alpha = params.alpha;
|
||||
|
||||
cleanup:
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(result);
|
||||
|
||||
LOG_DEBUG(Service_Y2R,
|
||||
"called input_format={} output_format={} rotation={} block_alignment={} "
|
||||
"input_line_width={} input_lines={} standard_coefficient={} reserved={} alpha={:X}",
|
||||
params.input_format, params.output_format, params.rotation, params.block_alignment,
|
||||
params.input_line_width, params.input_lines, params.standard_coefficient,
|
||||
params.padding, params.alpha);
|
||||
|
||||
auto result = conversion.SetInputLineWidth(params.input_line_width);
|
||||
|
||||
SCOPE_EXIT({
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||
rb.Push(result);
|
||||
});
|
||||
|
||||
if (result.IsError()) {
|
||||
return;
|
||||
}
|
||||
|
||||
result = conversion.SetInputLines(params.input_lines);
|
||||
|
||||
if (result.IsError()) {
|
||||
return;
|
||||
}
|
||||
|
||||
result = conversion.SetStandardCoefficient(params.standard_coefficient);
|
||||
|
||||
if (result.IsError()) {
|
||||
return;
|
||||
}
|
||||
|
||||
conversion.padding = params.padding;
|
||||
conversion.alpha = params.alpha;
|
||||
}
|
||||
|
||||
void Y2R_U::PingProcess(Kernel::HLERequestContext& ctx) {
|
||||
|
|
@ -697,6 +712,11 @@ Y2R_U::Y2R_U(Core::System& system) : ServiceFramework("y2r:u", 1), system(system
|
|||
RegisterHandlers(functions);
|
||||
|
||||
completion_event = system.Kernel().CreateEvent(Kernel::ResetType::OneShot, "Y2R:Completed");
|
||||
completion_signal_event =
|
||||
system.CoreTiming().RegisterEvent("Y2R Completion Signal Event", [this](uintptr_t, s64) {
|
||||
completion_event->Signal();
|
||||
is_busy_conversion = false;
|
||||
});
|
||||
}
|
||||
|
||||
Y2R_U::~Y2R_U() = default;
|
||||
|
|
|
|||
|
|
@ -349,11 +349,13 @@ private:
|
|||
Core::System& system;
|
||||
|
||||
std::shared_ptr<Kernel::Event> completion_event;
|
||||
Core::TimingEventType* completion_signal_event;
|
||||
ConversionConfiguration conversion{};
|
||||
DitheringWeightParams dithering_weight_params{};
|
||||
bool temporal_dithering_enabled = false;
|
||||
bool transfer_end_interrupt_enabled = false;
|
||||
bool spacial_dithering_enabled = false;
|
||||
bool is_busy_conversion = false;
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int);
|
||||
|
|
|
|||
|
|
@ -1014,8 +1014,8 @@ void SOC_U::Accept(Kernel::HLERequestContext& ctx) {
|
|||
ctr_addr_buf.resize(async_data->max_addr_len);
|
||||
}
|
||||
|
||||
LOG_DEBUG(Service_SOC, "called, pid={}, fd={}, ret={}", async_data->socket_handle,
|
||||
static_cast<s32>(async_data->ret));
|
||||
LOG_DEBUG(Service_SOC, "called, pid={}, fd={}, ret={}", async_data->pid,
|
||||
async_data->socket_handle, static_cast<s32>(async_data->ret));
|
||||
|
||||
IPC::RequestBuilder rb(ctx, 0x04, 2, 2);
|
||||
rb.Push(ResultSuccess);
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ static void SaveBanList(const Network::Room::BanList& ban_list, const std::strin
|
|||
static void InitializeLogging(const std::string& log_file) {
|
||||
Common::Log::Initialize(log_file);
|
||||
Common::Log::SetColorConsoleBackendEnabled(true);
|
||||
Common::Log::Start();
|
||||
}
|
||||
|
||||
/// Application entry point
|
||||
|
|
|
|||
|
|
@ -26,17 +26,6 @@ set(SHADER_FILES
|
|||
vulkan_blit_depth_stencil.frag
|
||||
)
|
||||
|
||||
find_program(GLSLANG "glslang")
|
||||
if ("${GLSLANG}" STREQUAL "GLSLANG-NOTFOUND")
|
||||
find_program(GLSLANG "glslangValidator")
|
||||
if ("${GLSLANG}" STREQUAL "GLSLANG-NOTFOUND")
|
||||
message(FATAL_ERROR "Required program `glslang` (or `glslangValidator`) not found.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(MACROS "-Dgl_VertexID=gl_VertexIndex")
|
||||
set(QUIET_FLAG "--quiet")
|
||||
|
||||
set(SHADER_INCLUDE ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
set(SHADER_DIR ${SHADER_INCLUDE}/video_core/host_shaders)
|
||||
set(HOST_SHADERS_INCLUDE ${SHADER_INCLUDE} PARENT_SCOPE)
|
||||
|
|
@ -44,57 +33,22 @@ set(HOST_SHADERS_INCLUDE ${SHADER_INCLUDE} PARENT_SCOPE)
|
|||
set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/source_shader.h.in)
|
||||
set(HEADER_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/StringShaderHeader.cmake)
|
||||
|
||||
# Check if `--quiet` is available on host's glslang version
|
||||
# glslang prints to STDERR iff an unrecognized flag is passed to it
|
||||
execute_process(
|
||||
COMMAND
|
||||
${GLSLANG} ${QUIET_FLAG}
|
||||
ERROR_VARIABLE
|
||||
GLSLANG_ERROR
|
||||
# STDOUT variable defined to silence unnecessary output during CMake configuration
|
||||
OUTPUT_VARIABLE
|
||||
GLSLANG_OUTPUT
|
||||
)
|
||||
|
||||
if (NOT GLSLANG_ERROR STREQUAL "")
|
||||
message(WARNING "Refusing to use unavailable flag `${QUIET_FLAG}` on `${GLSLANG}`")
|
||||
set(QUIET_FLAG "")
|
||||
endif()
|
||||
|
||||
foreach(FILENAME IN ITEMS ${SHADER_FILES})
|
||||
string(REPLACE "." "_" SHADER_NAME ${FILENAME})
|
||||
set(SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME})
|
||||
# Skip generating source headers on Vulkan exclusive files
|
||||
if (NOT ${FILENAME} MATCHES "vulkan.*")
|
||||
set(SOURCE_HEADER_FILE ${SHADER_DIR}/${SHADER_NAME}.h)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${SOURCE_HEADER_FILE}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -P ${HEADER_GENERATOR} ${SOURCE_FILE} ${SOURCE_HEADER_FILE} ${INPUT_FILE}
|
||||
MAIN_DEPENDENCY
|
||||
${SOURCE_FILE}
|
||||
DEPENDS
|
||||
${INPUT_FILE}
|
||||
# HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified
|
||||
)
|
||||
set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE})
|
||||
endif()
|
||||
# Skip compiling to SPIR-V OpenGL exclusive files
|
||||
if (NOT ${FILENAME} MATCHES "opengl.*")
|
||||
get_filename_component(FILE_NAME ${SHADER_NAME} NAME)
|
||||
string(TOUPPER ${FILE_NAME}_SPV SPIRV_VARIABLE_NAME)
|
||||
set(SPIRV_HEADER_FILE ${SHADER_DIR}/${SHADER_NAME}_spv.h)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${SPIRV_HEADER_FILE}
|
||||
COMMAND
|
||||
${GLSLANG} --target-env vulkan1.1 --glsl-version 450 ${QUIET_FLAG} ${MACROS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE}
|
||||
MAIN_DEPENDENCY
|
||||
${SOURCE_FILE}
|
||||
)
|
||||
set(SHADER_HEADERS ${SHADER_HEADERS} ${SPIRV_HEADER_FILE})
|
||||
endif()
|
||||
set(SOURCE_HEADER_FILE ${SHADER_DIR}/${SHADER_NAME}.h)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${SOURCE_HEADER_FILE}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -P ${HEADER_GENERATOR} ${SOURCE_FILE} ${SOURCE_HEADER_FILE} ${INPUT_FILE}
|
||||
MAIN_DEPENDENCY
|
||||
${SOURCE_FILE}
|
||||
DEPENDS
|
||||
${INPUT_FILE}
|
||||
# HEADER_GENERATOR should be included here but msbuild seems to assume it's always modified
|
||||
)
|
||||
set(SHADER_HEADERS ${SHADER_HEADERS} ${SOURCE_HEADER_FILE})
|
||||
endforeach()
|
||||
|
||||
set(SHADER_SOURCES ${SHADER_FILES})
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ layout(location = 0) out vec2 dst_coord;
|
|||
|
||||
layout(location = 0) uniform mediump ivec2 dst_size;
|
||||
|
||||
#ifdef VULKAN
|
||||
#define gl_VertexID gl_VertexIndex
|
||||
#endif
|
||||
|
||||
const vec2 vertices[4] =
|
||||
vec2[4](vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ out gl_PerVertex {
|
|||
layout(location = 0) out vec2 texcoord;
|
||||
|
||||
#ifdef VULKAN
|
||||
#define gl_VertexID gl_VertexIndex
|
||||
#define BEGIN_PUSH_CONSTANTS layout(push_constant) uniform PushConstants {
|
||||
#define END_PUSH_CONSTANTS };
|
||||
#define UNIFORM(n)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
//? #version 430 core
|
||||
layout(location = 0) out vec2 tex_coord;
|
||||
|
||||
#ifdef VULKAN
|
||||
#define gl_VertexID gl_VertexIndex
|
||||
#endif
|
||||
|
||||
const vec2 vertices[4] =
|
||||
vec2[4](vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
|
||||
|
||||
|
|
|
|||
|
|
@ -148,8 +148,6 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) {
|
|||
// Range check table for input
|
||||
if (index >= blend_func_table.size()) {
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index);
|
||||
UNREACHABLE();
|
||||
|
||||
return GL_ONE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,10 @@ inline vk::BlendFactor BlendFunc(Pica::FramebufferRegs::BlendFactor factor) {
|
|||
}};
|
||||
|
||||
const auto index = static_cast<std::size_t>(factor);
|
||||
ASSERT_MSG(index < blend_func_table.size(), "Unknown blend factor {}", index);
|
||||
if (index >= blend_func_table.size()) {
|
||||
LOG_CRITICAL(Render_Vulkan, "Unknown blend factor {}", index);
|
||||
return vk::BlendFactor::eOne;
|
||||
}
|
||||
return blend_func_table[index];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
#include "video_core/renderer_vulkan/vk_memory_util.h"
|
||||
#include "video_core/renderer_vulkan/vk_shader_util.h"
|
||||
|
||||
#include "video_core/host_shaders/vulkan_present_anaglyph_frag_spv.h"
|
||||
#include "video_core/host_shaders/vulkan_present_frag_spv.h"
|
||||
#include "video_core/host_shaders/vulkan_present_interlaced_frag_spv.h"
|
||||
#include "video_core/host_shaders/vulkan_present_vert_spv.h"
|
||||
#include "video_core/host_shaders/vulkan_present_anaglyph_frag.h"
|
||||
#include "video_core/host_shaders/vulkan_present_frag.h"
|
||||
#include "video_core/host_shaders/vulkan_present_interlaced_frag.h"
|
||||
#include "video_core/host_shaders/vulkan_present_vert.h"
|
||||
|
||||
#include <vk_mem_alloc.h>
|
||||
|
||||
|
|
@ -223,10 +223,14 @@ void RendererVulkan::LoadFBToScreenInfo(const Pica::FramebufferConfig& framebuff
|
|||
|
||||
void RendererVulkan::CompileShaders() {
|
||||
vk::Device device = instance.GetDevice();
|
||||
present_vertex_shader = CompileSPV(VULKAN_PRESENT_VERT_SPV, device);
|
||||
present_shaders[0] = CompileSPV(VULKAN_PRESENT_FRAG_SPV, device);
|
||||
present_shaders[1] = CompileSPV(VULKAN_PRESENT_ANAGLYPH_FRAG_SPV, device);
|
||||
present_shaders[2] = CompileSPV(VULKAN_PRESENT_INTERLACED_FRAG_SPV, device);
|
||||
present_vertex_shader =
|
||||
Compile(HostShaders::VULKAN_PRESENT_VERT, vk::ShaderStageFlagBits::eVertex, device);
|
||||
present_shaders[0] =
|
||||
Compile(HostShaders::VULKAN_PRESENT_FRAG, vk::ShaderStageFlagBits::eFragment, device);
|
||||
present_shaders[1] = Compile(HostShaders::VULKAN_PRESENT_ANAGLYPH_FRAG,
|
||||
vk::ShaderStageFlagBits::eFragment, device);
|
||||
present_shaders[2] = Compile(HostShaders::VULKAN_PRESENT_INTERLACED_FRAG,
|
||||
vk::ShaderStageFlagBits::eFragment, device);
|
||||
|
||||
auto properties = instance.GetPhysicalDevice().getProperties();
|
||||
for (std::size_t i = 0; i < present_samplers.size(); i++) {
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@
|
|||
#include "video_core/renderer_vulkan/vk_shader_util.h"
|
||||
#include "video_core/renderer_vulkan/vk_texture_runtime.h"
|
||||
|
||||
#include "video_core/host_shaders/format_reinterpreter/vulkan_d24s8_to_rgba8_comp_spv.h"
|
||||
#include "video_core/host_shaders/full_screen_triangle_vert_spv.h"
|
||||
#include "video_core/host_shaders/vulkan_blit_depth_stencil_frag_spv.h"
|
||||
#include "video_core/host_shaders/vulkan_depth_to_buffer_comp_spv.h"
|
||||
#include "video_core/host_shaders/format_reinterpreter/vulkan_d24s8_to_rgba8_comp.h"
|
||||
#include "video_core/host_shaders/full_screen_triangle_vert.h"
|
||||
#include "video_core/host_shaders/vulkan_blit_depth_stencil_frag.h"
|
||||
#include "video_core/host_shaders/vulkan_depth_to_buffer_comp.h"
|
||||
|
||||
namespace Vulkan {
|
||||
|
||||
|
|
@ -191,10 +191,14 @@ BlitHelper::BlitHelper(const Instance& instance_, Scheduler& scheduler_,
|
|||
PipelineLayoutCreateInfo(&compute_buffer_provider.Layout(), true))},
|
||||
two_textures_pipeline_layout{
|
||||
device.createPipelineLayout(PipelineLayoutCreateInfo(&two_textures_provider.Layout()))},
|
||||
full_screen_vert{CompileSPV(FULL_SCREEN_TRIANGLE_VERT_SPV, device)},
|
||||
d24s8_to_rgba8_comp{CompileSPV(VULKAN_D24S8_TO_RGBA8_COMP_SPV, device)},
|
||||
depth_to_buffer_comp{CompileSPV(VULKAN_DEPTH_TO_BUFFER_COMP_SPV, device)},
|
||||
blit_depth_stencil_frag{CompileSPV(VULKAN_BLIT_DEPTH_STENCIL_FRAG_SPV, device)},
|
||||
full_screen_vert{Compile(HostShaders::FULL_SCREEN_TRIANGLE_VERT,
|
||||
vk::ShaderStageFlagBits::eVertex, device)},
|
||||
d24s8_to_rgba8_comp{Compile(HostShaders::VULKAN_D24S8_TO_RGBA8_COMP,
|
||||
vk::ShaderStageFlagBits::eCompute, device)},
|
||||
depth_to_buffer_comp{Compile(HostShaders::VULKAN_DEPTH_TO_BUFFER_COMP,
|
||||
vk::ShaderStageFlagBits::eCompute, device)},
|
||||
blit_depth_stencil_frag{Compile(HostShaders::VULKAN_BLIT_DEPTH_STENCIL_FRAG,
|
||||
vk::ShaderStageFlagBits::eFragment, device)},
|
||||
d24s8_to_rgba8_pipeline{MakeComputePipeline(d24s8_to_rgba8_comp, compute_pipeline_layout)},
|
||||
depth_to_buffer_pipeline{
|
||||
MakeComputePipeline(depth_to_buffer_comp, compute_buffer_pipeline_layout)},
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
// Refer to the license.txt file included.
|
||||
|
||||
#include <boost/container/small_vector.hpp>
|
||||
#include <boost/container/static_vector.hpp>
|
||||
|
||||
#include "common/literals.h"
|
||||
#include "common/microprofile.h"
|
||||
|
|
@ -118,9 +119,9 @@ u32 UnpackDepthStencil(const VideoCore::StagingData& data, vk::Format dest) {
|
|||
}
|
||||
|
||||
boost::container::small_vector<vk::ImageMemoryBarrier, 3> MakeInitBarriers(
|
||||
vk::ImageAspectFlags aspect, std::span<const vk::Image> images, std::size_t num_images) {
|
||||
vk::ImageAspectFlags aspect, std::span<const vk::Image> images) {
|
||||
boost::container::small_vector<vk::ImageMemoryBarrier, 3> barriers;
|
||||
for (std::size_t i = 0; i < num_images; i++) {
|
||||
for (const vk::Image& image : images) {
|
||||
barriers.push_back(vk::ImageMemoryBarrier{
|
||||
.srcAccessMask = vk::AccessFlagBits::eNone,
|
||||
.dstAccessMask = vk::AccessFlagBits::eNone,
|
||||
|
|
@ -128,7 +129,7 @@ boost::container::small_vector<vk::ImageMemoryBarrier, 3> MakeInitBarriers(
|
|||
.newLayout = vk::ImageLayout::eGeneral,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.image = images[i],
|
||||
.image = image,
|
||||
.subresourceRange{
|
||||
.aspectMask = aspect,
|
||||
.baseMipLevel = 0,
|
||||
|
|
@ -218,11 +219,10 @@ Handle MakeHandle(const Instance* instance, u32 width, u32 height, u32 levels, T
|
|||
}
|
||||
|
||||
vk::UniqueFramebuffer MakeFramebuffer(vk::Device device, vk::RenderPass render_pass, u32 width,
|
||||
u32 height, std::span<const vk::ImageView> attachments,
|
||||
u32 num_attachments) {
|
||||
u32 height, std::span<const vk::ImageView> attachments) {
|
||||
const vk::FramebufferCreateInfo framebuffer_info = {
|
||||
.renderPass = render_pass,
|
||||
.attachmentCount = num_attachments,
|
||||
.attachmentCount = static_cast<u32>(attachments.size()),
|
||||
.pAttachments = attachments.data(),
|
||||
.width = width,
|
||||
.height = height,
|
||||
|
|
@ -710,8 +710,7 @@ Surface::Surface(TextureRuntime& runtime_, const VideoCore::SurfaceParams& param
|
|||
ASSERT_MSG(format != vk::Format::eUndefined && levels >= 1,
|
||||
"Image allocation parameters are invalid");
|
||||
|
||||
u32 num_images = 0;
|
||||
std::array<vk::Image, 3> raw_images;
|
||||
boost::container::static_vector<vk::Image, 3> raw_images;
|
||||
|
||||
vk::ImageCreateFlags flags{};
|
||||
if (texture_type == VideoCore::TextureType::CubeMap) {
|
||||
|
|
@ -724,18 +723,18 @@ Surface::Surface(TextureRuntime& runtime_, const VideoCore::SurfaceParams& param
|
|||
const bool need_format_list = is_mutable && instance->IsImageFormatListSupported();
|
||||
handles[0] = MakeHandle(instance, width, height, levels, texture_type, format, traits.usage,
|
||||
flags, traits.aspect, need_format_list, DebugName(false));
|
||||
raw_images[num_images++] = handles[0].image;
|
||||
raw_images.emplace_back(handles[0].image);
|
||||
|
||||
if (res_scale != 1) {
|
||||
handles[1] =
|
||||
MakeHandle(instance, GetScaledWidth(), GetScaledHeight(), levels, texture_type, format,
|
||||
traits.usage, flags, traits.aspect, need_format_list, DebugName(true));
|
||||
raw_images[num_images++] = handles[1].image;
|
||||
raw_images.emplace_back(handles[1].image);
|
||||
}
|
||||
|
||||
runtime->render_manager.EndRendering();
|
||||
scheduler->Record([raw_images, num_images, aspect = traits.aspect](vk::CommandBuffer cmdbuf) {
|
||||
const auto barriers = MakeInitBarriers(aspect, raw_images, num_images);
|
||||
scheduler->Record([raw_images, aspect = traits.aspect](vk::CommandBuffer cmdbuf) {
|
||||
const auto barriers = MakeInitBarriers(aspect, raw_images);
|
||||
cmdbuf.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe,
|
||||
vk::PipelineStageFlagBits::eTopOfPipe,
|
||||
vk::DependencyFlagBits::eByRegion, {}, {}, barriers);
|
||||
|
|
@ -753,8 +752,7 @@ Surface::Surface(TextureRuntime& runtime_, const VideoCore::SurfaceBase& surface
|
|||
const bool has_normal = mat && mat->Map(MapType::Normal);
|
||||
const vk::Format format = traits.native;
|
||||
|
||||
u32 num_images = 0;
|
||||
std::array<vk::Image, 2> raw_images;
|
||||
boost::container::static_vector<vk::Image, 2> raw_images;
|
||||
|
||||
vk::ImageCreateFlags flags{};
|
||||
if (texture_type == VideoCore::TextureType::CubeMap) {
|
||||
|
|
@ -764,23 +762,23 @@ Surface::Surface(TextureRuntime& runtime_, const VideoCore::SurfaceBase& surface
|
|||
const std::string debug_name = DebugName(false, true);
|
||||
handles[0] = MakeHandle(instance, mat->width, mat->height, levels, texture_type, format,
|
||||
traits.usage, flags, traits.aspect, false, debug_name);
|
||||
raw_images[num_images++] = handles[0].image;
|
||||
raw_images.emplace_back(handles[0].image);
|
||||
|
||||
if (res_scale != 1) {
|
||||
handles[1] = MakeHandle(instance, mat->width, mat->height, levels, texture_type,
|
||||
vk::Format::eR8G8B8A8Unorm, traits.usage, flags, traits.aspect,
|
||||
false, debug_name);
|
||||
raw_images[num_images++] = handles[1].image;
|
||||
raw_images.emplace_back(handles[1].image);
|
||||
}
|
||||
if (has_normal) {
|
||||
handles[2] = MakeHandle(instance, mat->width, mat->height, levels, texture_type, format,
|
||||
traits.usage, flags, traits.aspect, false, debug_name);
|
||||
raw_images[num_images++] = handles[2].image;
|
||||
raw_images.emplace_back(handles[2].image);
|
||||
}
|
||||
|
||||
runtime->render_manager.EndRendering();
|
||||
scheduler->Record([raw_images, num_images, aspect = traits.aspect](vk::CommandBuffer cmdbuf) {
|
||||
const auto barriers = MakeInitBarriers(aspect, raw_images, num_images);
|
||||
scheduler->Record([raw_images, aspect = traits.aspect](vk::CommandBuffer cmdbuf) {
|
||||
const auto barriers = MakeInitBarriers(aspect, raw_images);
|
||||
cmdbuf.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe,
|
||||
vk::PipelineStageFlagBits::eTopOfPipe,
|
||||
vk::DependencyFlagBits::eByRegion, {}, {}, barriers);
|
||||
|
|
@ -817,11 +815,10 @@ void Surface::Upload(const VideoCore::BufferTextureCopy& upload,
|
|||
|
||||
scheduler->Record([buffer = runtime->upload_buffer.Handle(), format = traits.native, params,
|
||||
staging, upload](vk::CommandBuffer cmdbuf) {
|
||||
u32 num_copies = 1;
|
||||
std::array<vk::BufferImageCopy, 2> buffer_image_copies;
|
||||
boost::container::static_vector<vk::BufferImageCopy, 2> buffer_image_copies;
|
||||
|
||||
const auto rect = upload.texture_rect;
|
||||
buffer_image_copies[0] = vk::BufferImageCopy{
|
||||
buffer_image_copies.emplace_back(vk::BufferImageCopy{
|
||||
.bufferOffset = upload.buffer_offset,
|
||||
.bufferRowLength = rect.GetWidth(),
|
||||
.bufferImageHeight = rect.GetHeight(),
|
||||
|
|
@ -833,15 +830,16 @@ void Surface::Upload(const VideoCore::BufferTextureCopy& upload,
|
|||
},
|
||||
.imageOffset = {static_cast<s32>(rect.left), static_cast<s32>(rect.bottom), 0},
|
||||
.imageExtent = {rect.GetWidth(), rect.GetHeight(), 1},
|
||||
};
|
||||
});
|
||||
|
||||
if (params.aspect & vk::ImageAspectFlagBits::eStencil) {
|
||||
buffer_image_copies[0].imageSubresource.aspectMask = vk::ImageAspectFlagBits::eDepth;
|
||||
vk::BufferImageCopy& stencil_copy = buffer_image_copies[1];
|
||||
|
||||
vk::BufferImageCopy& stencil_copy =
|
||||
buffer_image_copies.emplace_back(buffer_image_copies[0]);
|
||||
stencil_copy = buffer_image_copies[0];
|
||||
stencil_copy.bufferOffset += UnpackDepthStencil(staging, format);
|
||||
stencil_copy.imageSubresource.aspectMask = vk::ImageAspectFlagBits::eStencil;
|
||||
num_copies++;
|
||||
}
|
||||
|
||||
const vk::ImageMemoryBarrier read_barrier = {
|
||||
|
|
@ -869,7 +867,7 @@ void Surface::Upload(const VideoCore::BufferTextureCopy& upload,
|
|||
vk::DependencyFlagBits::eByRegion, {}, {}, read_barrier);
|
||||
|
||||
cmdbuf.copyBufferToImage(buffer, params.src_image, vk::ImageLayout::eTransferDstOptimal,
|
||||
num_copies, buffer_image_copies.data());
|
||||
buffer_image_copies);
|
||||
|
||||
cmdbuf.pipelineBarrier(vk::PipelineStageFlagBits::eTransfer, params.pipeline_flags,
|
||||
vk::DependencyFlagBits::eByRegion, {}, {}, write_barrier);
|
||||
|
|
@ -1077,7 +1075,7 @@ void Surface::ScaleUp(u32 new_scale) {
|
|||
runtime->render_manager.EndRendering();
|
||||
scheduler->Record(
|
||||
[raw_images = std::array{Image()}, aspect = traits.aspect](vk::CommandBuffer cmdbuf) {
|
||||
const auto barriers = MakeInitBarriers(aspect, raw_images, raw_images.size());
|
||||
const auto barriers = MakeInitBarriers(aspect, raw_images);
|
||||
cmdbuf.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe,
|
||||
vk::PipelineStageFlagBits::eTopOfPipe,
|
||||
vk::DependencyFlagBits::eByRegion, {}, {}, barriers);
|
||||
|
|
@ -1343,7 +1341,7 @@ vk::Framebuffer Surface::Framebuffer() noexcept {
|
|||
runtime->render_manager.GetRenderpass(color_format, depth_format, false);
|
||||
const auto attachments = std::array{ImageView()};
|
||||
framebuffers[index] = MakeFramebuffer(instance->GetDevice(), render_pass, GetScaledWidth(),
|
||||
GetScaledHeight(), attachments, 1);
|
||||
GetScaledHeight(), attachments);
|
||||
return framebuffers[index].get();
|
||||
}
|
||||
|
||||
|
|
@ -1473,17 +1471,16 @@ Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferPa
|
|||
image_views[index] = shadow_rendering ? surface->StorageView() : surface->FramebufferView();
|
||||
};
|
||||
|
||||
u32 num_attachments = 0;
|
||||
std::array<vk::ImageView, 2> attachments;
|
||||
boost::container::static_vector<vk::ImageView, 2> attachments;
|
||||
|
||||
if (color) {
|
||||
prepare(0, color);
|
||||
attachments[num_attachments++] = image_views[0];
|
||||
attachments.emplace_back(image_views[0]);
|
||||
}
|
||||
|
||||
if (depth) {
|
||||
prepare(1, depth);
|
||||
attachments[num_attachments++] = image_views[1];
|
||||
attachments.emplace_back(image_views[1]);
|
||||
}
|
||||
|
||||
const vk::Device device = runtime.GetInstance().GetDevice();
|
||||
|
|
@ -1491,11 +1488,10 @@ Framebuffer::Framebuffer(TextureRuntime& runtime, const VideoCore::FramebufferPa
|
|||
render_pass =
|
||||
render_manager.GetRenderpass(PixelFormat::Invalid, PixelFormat::Invalid, false);
|
||||
framebuffer = MakeFramebuffer(device, render_pass, color->GetScaledWidth(),
|
||||
color->GetScaledHeight(), {}, 0);
|
||||
color->GetScaledHeight(), {});
|
||||
} else {
|
||||
render_pass = render_manager.GetRenderpass(formats[0], formats[1], false);
|
||||
framebuffer =
|
||||
MakeFramebuffer(device, render_pass, width, height, attachments, num_attachments);
|
||||
framebuffer = MakeFramebuffer(device, render_pass, width, height, attachments);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
8
tools/reset-submodules.sh
Normal file
8
tools/reset-submodules.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
git submodule sync
|
||||
git submodule foreach --recursive git reset --hard
|
||||
git submodule update --init --recursive
|
||||
Loading…
Reference in a new issue