mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-15 13:16:43 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 51dc28500b | |||
| 2b1f163487 | |||
| 52281d16e1 | |||
| d6105c5222 | |||
| 22bd482732 | |||
| 6770330d8e | |||
| e776e337f2 | |||
| b0c04cfab4 | |||
| 69e846f7ad | |||
| 9c53463b81 | |||
| 0f749028b4 | |||
| fee2c7edeb | |||
| 657c432254 | |||
| e3725a160e | |||
| 0e2ff87fb2 | |||
| e754ed9018 | |||
| d7c1edbde2 | |||
| 5a0c7095c7 | |||
| de273aefa5 | |||
| da938123e1 | |||
| 9e2013d7f8 | |||
| 7872ae9985 | |||
| 0a690baa3a | |||
| a7cfd8b6a5 | |||
| f1e4f69fc9 | |||
| c68de909b8 | |||
| f085a85fbd | |||
| 4394321aaa | |||
| baf51950e6 | |||
| 4753abd9f4 | |||
| 99d3f588f8 |
@@ -3,8 +3,6 @@ name: Check Strings
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
check-strings:
|
||||
@@ -12,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Find Unused Strings
|
||||
run: ./tools/unused-strings.sh
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
|
||||
index eb4e69e..3155805 100644
|
||||
--- a/external/CMakeLists.txt
|
||||
+++ b/external/CMakeLists.txt
|
||||
@@ -72,7 +72,8 @@ if (SPIRV_TOOLS_USE_MIMALLOC)
|
||||
pop_variable(MI_BUILD_TESTS)
|
||||
endif()
|
||||
|
||||
-if (DEFINED SPIRV-Headers_SOURCE_DIR)
|
||||
+# NetBSD doesn't have SPIRV-Headers readily available on system
|
||||
+if (DEFINED SPIRV-Headers_SOURCE_DIR AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")
|
||||
# This allows flexible position of the SPIRV-Headers repo.
|
||||
set(SPIRV_HEADER_DIR ${SPIRV-Headers_SOURCE_DIR})
|
||||
else()
|
||||
@@ -0,0 +1,287 @@
|
||||
From 67bf3d1381b1faf59e87001d6156ba4e21cada14 Mon Sep 17 00:00:00 2001
|
||||
From: crueter <crueter@eden-emu.dev>
|
||||
Date: Mon, 29 Dec 2025 21:22:36 -0500
|
||||
Subject: [PATCH] [cmake] refactor: shared/static handling
|
||||
|
||||
This significantly redoes the way shared and static libraries are
|
||||
handled. Now, it's controlled by two options: `SPIRV_TOOLS_BUILD_STATIC`
|
||||
and `SPIRV_TOOLS_BUILD_SHARED`.
|
||||
|
||||
The default configuration (no `BUILD_SHARED_LIBS` set, options left at
|
||||
default) is to build shared ONLY if this is the master project, or
|
||||
static ONLY if this is a subproject (e.g. FetchContent, CPM.cmake). Also
|
||||
I should note that static-only (i.e. no shared) is now a supported
|
||||
target, this is done because projects including it as a submodule e.g.
|
||||
on Android or Windows may prefer this.
|
||||
|
||||
Now the shared/static handling:
|
||||
- static ON, shared OFF: Only generates `.a` libraries.
|
||||
- static ON, shared ON: Generates `.a` libraries, but also
|
||||
`libSPIRV-Tools.so`
|
||||
- static OFF, shared ON: Only generates `.so` libraries.
|
||||
|
||||
Notable TODOs:
|
||||
- SPIRV-Tools-shared.pc seems redundant--how should we handle which one
|
||||
to use in the case of distributions that distribute both types (MSYS2
|
||||
for instance)?
|
||||
* *Note: pkgconfig sucks at this and usually just leaves it up to the
|
||||
user, so the optimal solution may indeed be doing absolutely
|
||||
nothing.* CMake is unaffected :)
|
||||
- use namespaces in the CMake config files pleaaaaase
|
||||
|
||||
This is going to change things a good bit for package maintainers, but
|
||||
cest la vie. It's for the greater good, I promise.
|
||||
|
||||
Signed-off-by: crueter <crueter@eden-emu.dev>
|
||||
---
|
||||
CMakeLists.txt | 108 +++++++++++++++++++++++++-----------------
|
||||
source/CMakeLists.txt | 62 ++++++++++++------------
|
||||
2 files changed, 94 insertions(+), 76 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 4d843b4d2f..07201f690f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -14,6 +14,15 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
|
||||
+# master project detection--useful for FetchContent/submodule inclusion
|
||||
+set(master_project OFF)
|
||||
+set(subproject ON)
|
||||
+
|
||||
+if (NOT DEFINED PROJECT_NAME)
|
||||
+ set(master_project ON)
|
||||
+ set(subproject OFF)
|
||||
+endif()
|
||||
+
|
||||
project(spirv-tools)
|
||||
|
||||
# Avoid a bug in CMake 3.22.1. By default it will set -std=c++11 for
|
||||
@@ -135,46 +144,49 @@ if (DEFINED SPIRV_TOOLS_EXTRA_DEFINITIONS)
|
||||
add_definitions(${SPIRV_TOOLS_EXTRA_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
-# Library build setting definitions:
|
||||
-#
|
||||
-# * SPIRV_TOOLS_BUILD_STATIC - ON or OFF - Defaults to ON.
|
||||
-# If enabled the following targets will be created:
|
||||
-# ${SPIRV_TOOLS}-static - STATIC library.
|
||||
-# Has full public symbol visibility.
|
||||
-# ${SPIRV_TOOLS}-shared - SHARED library.
|
||||
-# Has default-hidden symbol visibility.
|
||||
-# ${SPIRV_TOOLS} - will alias to one of above, based on BUILD_SHARED_LIBS.
|
||||
-# If disabled the following targets will be created:
|
||||
-# ${SPIRV_TOOLS} - either STATIC or SHARED based on SPIRV_TOOLS_LIBRARY_TYPE.
|
||||
-# Has full public symbol visibility.
|
||||
-# ${SPIRV_TOOLS}-shared - SHARED library.
|
||||
-# Has default-hidden symbol visibility.
|
||||
-#
|
||||
-# * SPIRV_TOOLS_LIBRARY_TYPE - SHARED or STATIC.
|
||||
-# Specifies the library type used for building SPIRV-Tools libraries.
|
||||
-# Defaults to SHARED when BUILD_SHARED_LIBS=1, otherwise STATIC.
|
||||
-#
|
||||
-# * SPIRV_TOOLS_FULL_VISIBILITY - "${SPIRV_TOOLS}-static" or "${SPIRV_TOOLS}"
|
||||
-# Evaluates to the SPIRV_TOOLS target library name that has no hidden symbols.
|
||||
-# This is used by internal targets for accessing symbols that are non-public.
|
||||
-# Note this target provides no API stability guarantees.
|
||||
-#
|
||||
-# Ideally, all of these will go away - see https://github.com/KhronosGroup/SPIRV-Tools/issues/3909.
|
||||
-option(ENABLE_EXCEPTIONS_ON_MSVC "Build SPIRV-TOOLS with c++ exceptions enabled in MSVC" ON)
|
||||
-option(SPIRV_TOOLS_BUILD_STATIC "Build ${SPIRV_TOOLS}-static target. ${SPIRV_TOOLS} will alias to ${SPIRV_TOOLS}-static or ${SPIRV_TOOLS}-shared based on BUILD_SHARED_LIBS" ON)
|
||||
-if(SPIRV_TOOLS_BUILD_STATIC)
|
||||
- set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}-static)
|
||||
+# If BUILD_SHARED_LIBS is undefined, set it based on whether we are
|
||||
+# the master project or a subproject
|
||||
+if (NOT DEFINED BUILD_SHARED_LIBS)
|
||||
+ set(BUILD_SHARED_LIBS ${master_project})
|
||||
+endif()
|
||||
+
|
||||
+if (BUILD_SHARED_LIBS)
|
||||
+ set(static_default OFF)
|
||||
+else()
|
||||
+ set(static_default ON)
|
||||
+endif()
|
||||
+
|
||||
+option(SPIRV_TOOLS_BUILD_SHARED "Build ${SPIRV_TOOLS} as a shared library"
|
||||
+ ${BUILD_SHARED_LIBS})
|
||||
+option(SPIRV_TOOLS_BUILD_STATIC "Build ${SPIRV_TOOLS} as a static library"
|
||||
+ ${static_default})
|
||||
+
|
||||
+# Avoid conflict between the dll import library and
|
||||
+# the static library (thanks microsoft)
|
||||
+if(CMAKE_STATIC_LIBRARY_PREFIX STREQUAL "" AND
|
||||
+ CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL ".lib")
|
||||
+ set(SPIRV_TOOLS_STATIC_LIBNAME "${SPIRV_TOOLS}-static")
|
||||
+else()
|
||||
+ set(SPIRV_TOOLS_STATIC_LIBNAME "${SPIRV_TOOLS}")
|
||||
+endif()
|
||||
+
|
||||
+if (SPIRV_TOOLS_BUILD_STATIC)
|
||||
+ # If building a static library at all, always build other libraries as static,
|
||||
+ # and link to the static SPIRV-Tools library.
|
||||
set(SPIRV_TOOLS_LIBRARY_TYPE "STATIC")
|
||||
-else(SPIRV_TOOLS_BUILD_STATIC)
|
||||
- set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS})
|
||||
- if (NOT DEFINED SPIRV_TOOLS_LIBRARY_TYPE)
|
||||
- if(BUILD_SHARED_LIBS)
|
||||
- set(SPIRV_TOOLS_LIBRARY_TYPE "SHARED")
|
||||
- else()
|
||||
- set(SPIRV_TOOLS_LIBRARY_TYPE "STATIC")
|
||||
- endif()
|
||||
- endif()
|
||||
-endif(SPIRV_TOOLS_BUILD_STATIC)
|
||||
+ set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}-static)
|
||||
+elseif (SPIRV_TOOLS_BUILD_SHARED)
|
||||
+ # If only building a shared library, link other libraries to the
|
||||
+ # shared library. Also, other libraries should be shared
|
||||
+ set(SPIRV_TOOLS_LIBRARY_TYPE "SHARED")
|
||||
+ set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}-shared)
|
||||
+else()
|
||||
+ message(FATAL_ERROR "You must set one of "
|
||||
+ "SPIRV_TOOLS_BUILD_STATIC or SPIRV_TOOLS_BUILD_SHARED!")
|
||||
+endif()
|
||||
+
|
||||
+option(ENABLE_EXCEPTIONS_ON_MSVC
|
||||
+ "Build SPIRV-TOOLS with C++ exceptions enabled in MSVC" ON)
|
||||
|
||||
function(spvtools_default_compile_options TARGET)
|
||||
target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS})
|
||||
@@ -372,7 +384,7 @@ if (NOT "${SPIRV_SKIP_TESTS}")
|
||||
endif()
|
||||
|
||||
set(SPIRV_LIBRARIES "-lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link")
|
||||
-set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared")
|
||||
+set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools")
|
||||
|
||||
# Build pkg-config file
|
||||
# Use a first-class target so it's regenerated when relevant files are updated.
|
||||
@@ -388,7 +400,12 @@ add_custom_command(
|
||||
-DSPIRV_LIBRARIES=${SPIRV_LIBRARIES}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
|
||||
DEPENDS "CHANGES" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake")
|
||||
-add_custom_command(
|
||||
+
|
||||
+set(pc_files ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc)
|
||||
+
|
||||
+# TODO(crueter): remove?
|
||||
+if (SPIRV_TOOLS_BUILD_SHARED)
|
||||
+ add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
|
||||
@@ -400,9 +417,12 @@ add_custom_command(
|
||||
-DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
|
||||
DEPENDS "CHANGES" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake")
|
||||
-add_custom_target(spirv-tools-pkg-config
|
||||
- ALL
|
||||
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc)
|
||||
+ set(pc_files ${pc_files} ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc)
|
||||
+endif()
|
||||
+
|
||||
+add_custom_target(spirv-tools-pkg-config
|
||||
+ ALL
|
||||
+ DEPENDS ${pc_files})
|
||||
|
||||
# Install pkg-config file
|
||||
if (ENABLE_SPIRV_TOOLS_INSTALL)
|
||||
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
|
||||
index bfa1e661bc..fd3712c70c 100644
|
||||
--- a/source/CMakeLists.txt
|
||||
+++ b/source/CMakeLists.txt
|
||||
@@ -337,49 +337,44 @@ function(spirv_tools_default_target_options target)
|
||||
)
|
||||
set_property(TARGET ${target} PROPERTY FOLDER "SPIRV-Tools libraries")
|
||||
spvtools_check_symbol_exports(${target})
|
||||
- add_dependencies(${target} spirv-tools-build-version core_tables extinst_tables)
|
||||
+ add_dependencies(${target}
|
||||
+ spirv-tools-build-version core_tables extinst_tables)
|
||||
endfunction()
|
||||
|
||||
-# Always build ${SPIRV_TOOLS}-shared. This is expected distro packages, and
|
||||
-# unlike the other SPIRV_TOOLS target, defaults to hidden symbol visibility.
|
||||
-add_library(${SPIRV_TOOLS}-shared SHARED ${SPIRV_SOURCES})
|
||||
-if (SPIRV_TOOLS_USE_MIMALLOC)
|
||||
- target_link_libraries(${SPIRV_TOOLS}-shared PRIVATE mimalloc-static)
|
||||
+if (SPIRV_TOOLS_BUILD_SHARED)
|
||||
+ add_library(${SPIRV_TOOLS}-shared SHARED ${SPIRV_SOURCES})
|
||||
+ if (SPIRV_TOOLS_USE_MIMALLOC)
|
||||
+ target_link_libraries(${SPIRV_TOOLS}-shared PRIVATE mimalloc-static)
|
||||
+ endif()
|
||||
+
|
||||
+ set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES
|
||||
+ OUTPUT_NAME "${SPIRV_TOOLS}")
|
||||
+ spirv_tools_default_target_options(${SPIRV_TOOLS}-shared)
|
||||
+
|
||||
+ target_compile_definitions(${SPIRV_TOOLS}-shared
|
||||
+ PRIVATE SPIRV_TOOLS_IMPLEMENTATION
|
||||
+ PUBLIC SPIRV_TOOLS_SHAREDLIB)
|
||||
+
|
||||
+ list(APPEND SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-shared)
|
||||
endif()
|
||||
-spirv_tools_default_target_options(${SPIRV_TOOLS}-shared)
|
||||
-set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
-target_compile_definitions(${SPIRV_TOOLS}-shared
|
||||
- PRIVATE SPIRV_TOOLS_IMPLEMENTATION
|
||||
- PUBLIC SPIRV_TOOLS_SHAREDLIB
|
||||
-)
|
||||
|
||||
if(SPIRV_TOOLS_BUILD_STATIC)
|
||||
add_library(${SPIRV_TOOLS}-static STATIC ${SPIRV_SOURCES})
|
||||
if (SPIRV_TOOLS_USE_MIMALLOC AND SPIRV_TOOLS_USE_MIMALLOC_IN_STATIC_BUILD)
|
||||
target_link_libraries(${SPIRV_TOOLS}-shared PRIVATE mimalloc-static)
|
||||
endif()
|
||||
+
|
||||
spirv_tools_default_target_options(${SPIRV_TOOLS}-static)
|
||||
- # The static target does not have the '-static' suffix.
|
||||
- set_target_properties(${SPIRV_TOOLS}-static PROPERTIES OUTPUT_NAME "${SPIRV_TOOLS}")
|
||||
-
|
||||
- # Create the "${SPIRV_TOOLS}" target as an alias to either "${SPIRV_TOOLS}-static"
|
||||
- # or "${SPIRV_TOOLS}-shared" depending on the value of BUILD_SHARED_LIBS.
|
||||
- if(BUILD_SHARED_LIBS)
|
||||
- add_library(${SPIRV_TOOLS} ALIAS ${SPIRV_TOOLS}-shared)
|
||||
- else()
|
||||
- add_library(${SPIRV_TOOLS} ALIAS ${SPIRV_TOOLS}-static)
|
||||
- endif()
|
||||
+ set_target_properties(${SPIRV_TOOLS}-static PROPERTIES
|
||||
+ OUTPUT_NAME "${SPIRV_TOOLS_STATIC_LIBNAME}")
|
||||
|
||||
- set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-static ${SPIRV_TOOLS}-shared)
|
||||
-else()
|
||||
- add_library(${SPIRV_TOOLS} ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_SOURCES})
|
||||
- if (SPIRV_TOOLS_USE_MIMALLOC)
|
||||
- target_link_libraries(${SPIRV_TOOLS} PRIVATE mimalloc-static)
|
||||
- endif()
|
||||
- spirv_tools_default_target_options(${SPIRV_TOOLS})
|
||||
- set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared)
|
||||
+ list(APPEND SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-static)
|
||||
endif()
|
||||
|
||||
+# Create the "SPIRV-Tools" target as an alias to either "SPIRV-Tools-static"
|
||||
+# or "SPIRV-Tools-shared" depending on the value of SPIRV_TOOLS_BUILD_SHARED.
|
||||
+add_library(${SPIRV_TOOLS} ALIAS ${SPIRV_TOOLS_FULL_VISIBILITY})
|
||||
+
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
find_library(LIBRT rt)
|
||||
if(LIBRT)
|
||||
@@ -390,14 +385,17 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
endif()
|
||||
|
||||
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
||||
- if (SPIRV_TOOLS_USE_MIMALLOC AND (NOT SPIRV_TOOLS_BUILD_STATIC OR SPIRV_TOOLS_USE_MIMALLOC_IN_STATIC_BUILD))
|
||||
+ if (SPIRV_TOOLS_USE_MIMALLOC AND
|
||||
+ (NOT SPIRV_TOOLS_BUILD_STATIC OR SPIRV_TOOLS_USE_MIMALLOC_IN_STATIC_BUILD))
|
||||
list(APPEND SPIRV_TOOLS_TARGETS mimalloc-static)
|
||||
endif()
|
||||
install(TARGETS ${SPIRV_TOOLS_TARGETS} EXPORT ${SPIRV_TOOLS}Targets)
|
||||
export(EXPORT ${SPIRV_TOOLS}Targets FILE ${SPIRV_TOOLS}Target.cmake)
|
||||
|
||||
spvtools_config_package_dir(${SPIRV_TOOLS} PACKAGE_DIR)
|
||||
- install(EXPORT ${SPIRV_TOOLS}Targets FILE ${SPIRV_TOOLS}Target.cmake DESTINATION ${PACKAGE_DIR})
|
||||
+ install(EXPORT ${SPIRV_TOOLS}Targets
|
||||
+ FILE ${SPIRV_TOOLS}Target.cmake
|
||||
+ DESTINATION ${PACKAGE_DIR})
|
||||
|
||||
# Special config file for root library compared to other libs.
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/${SPIRV_TOOLS}Config.cmake
|
||||
@@ -130,6 +130,7 @@ if (YUZU_STATIC_BUILD)
|
||||
|
||||
# these libs do not properly provide static libs/let you do it with cmake
|
||||
set(fmt_FORCE_BUNDLED ON)
|
||||
set(SPIRV-Tools_FORCE_BUNDLED ON)
|
||||
set(SPIRV-Headers_FORCE_BUNDLED ON)
|
||||
set(zstd_FORCE_BUNDLED ON)
|
||||
endif()
|
||||
@@ -522,6 +523,7 @@ if (NOT YUZU_STATIC_ROOM)
|
||||
find_package(VulkanMemoryAllocator)
|
||||
find_package(VulkanUtilityLibraries)
|
||||
find_package(SimpleIni)
|
||||
find_package(SPIRV-Tools)
|
||||
find_package(sirit)
|
||||
find_package(gamemode)
|
||||
find_package(frozen)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(SPIRV-Tools QUIET IMPORTED_TARGET SPIRV-Tools)
|
||||
find_package_handle_standard_args(SPIRV-Tools
|
||||
REQUIRED_VARS SPIRV-Tools_LINK_LIBRARIES
|
||||
VERSION_VAR SPIRV-Tools_VERSION
|
||||
)
|
||||
|
||||
if (PLATFORM_MSYS)
|
||||
FixMsysPath(PkgConfig::SPIRV-Tools)
|
||||
endif()
|
||||
|
||||
if (SPIRV-Tools_FOUND AND NOT TARGET SPIRV-Tools::SPIRV-Tools)
|
||||
if (TARGET SPIRV-Tools)
|
||||
add_library(SPIRV-Tools::SPIRV-Tools ALIAS SPIRV-Tools)
|
||||
else()
|
||||
add_library(SPIRV-Tools::SPIRV-Tools ALIAS PkgConfig::SPIRV-Tools)
|
||||
endif()
|
||||
endif()
|
||||
@@ -35,17 +35,17 @@ set(GIT_DESC ${BUILD_VERSION})
|
||||
# Generate cpp with Git revision from template
|
||||
# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well
|
||||
|
||||
# Auto-updater metadata! Must somewhat mirror GitHub/Forgejo API endpoint
|
||||
|
||||
set(BUILD_AUTO_UPDATE_API_PATH "/latest/release.json")
|
||||
# Auto-updater metadata! Must somewhat mirror GitHub API endpoint
|
||||
if (NIGHTLY_BUILD)
|
||||
set(BUILD_AUTO_UPDATE_WEBSITE "https://git.eden-emu.dev")
|
||||
set(BUILD_AUTO_UPDATE_API "nightly.eden-emu.dev")
|
||||
set(BUILD_AUTO_UPDATE_API "git.eden-emu.dev")
|
||||
set(BUILD_AUTO_UPDATE_API_PATH "/api/v1/repos/")
|
||||
set(BUILD_AUTO_UPDATE_REPO "eden-ci/nightly")
|
||||
set(REPO_NAME "Eden Nightly")
|
||||
else()
|
||||
set(BUILD_AUTO_UPDATE_WEBSITE "https://git.eden-emu.dev")
|
||||
set(BUILD_AUTO_UPDATE_API "stable.eden-emu.dev")
|
||||
set(BUILD_AUTO_UPDATE_API "git.eden-emu.dev")
|
||||
set(BUILD_AUTO_UPDATE_API_PATH "/api/v1/repos/")
|
||||
set(BUILD_AUTO_UPDATE_REPO "eden-emu/eden")
|
||||
set(REPO_NAME "Eden")
|
||||
endif()
|
||||
|
||||
Vendored
+36
-36
@@ -239,7 +239,7 @@ Esto vetará su nombre de usuario del foro y su dirección IP.</translation>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/compatdb.ui" line="36"/>
|
||||
<source><html><head/><body><p><span style=" font-size:10pt;">Should you choose to submit a test case to the </span><a href="https://eden-emulator.github.io/game/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">eden Compatibility List</span></a><span style=" font-size:10pt;">, The following information will be collected and displayed on the site:</span></p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware Information (CPU / GPU / Operating System)</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Which version of eden you are running</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The connected eden account</li></ul></body></html></source>
|
||||
<translation><html><head/><body><p><span style=" font-size:10pt;">Si elijes entregar un caso de prueba a la </span><a href="https://eden-emulator.github.io/game/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">lista de compatibilidad de Eden</span></a><span style=" font-size:10pt;">, Se recopilará y mostrará la siguiente información en el sito:</span></p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Información del hardware (CPU / GPU / Sistema operativo)</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qué version de Eden estás usando</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">La cuenta de eden que está conectada </li></ul></body></html></translation>
|
||||
<translation><html><head/><body><p><span style=" font-size:10pt;">Si elijes entregar un caso de prueba a la </span><a href="https://eden-emulator.github.io/game/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">lista de compatibilidad de Eden</span></a><span style=" font-size:10pt;">, Se recopilará y mostrará la siguiente información en el sito:</span></p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Información del hardware (Procesador / Tarjeta gráfica / Sistema operativo)</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qué version de Eden estás usando</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">La cuenta de eden que está conectada </li></ul></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/compatdb.ui" line="77"/>
|
||||
@@ -492,14 +492,14 @@ Esto vetará su nombre de usuario del foro y su dirección IP.</translation>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="63"/>
|
||||
<source>Multicore CPU Emulation</source>
|
||||
<translation>Emulación de la CPU multinúcleo </translation>
|
||||
<translation>Emulación del procesador multinúcleo </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="64"/>
|
||||
<source>This option increases CPU emulation thread use from 1 to the maximum of 4.
|
||||
This is mainly a debug option and shouldn't be disabled.</source>
|
||||
<translation>Esta opción aumenta el uso de hilos de emulación de la CPU de 1 a un máximo de 4.
|
||||
Esta es una opción principalmente de depuración y no debería desactivarse.</translation>
|
||||
<translation>Esta opción aumenta el uso de hilos de emulación del procesador de 1 a un máximo de 4.
|
||||
Principalmente es una opción de depuración y no debería desactivarse.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="66"/>
|
||||
@@ -556,7 +556,7 @@ Desactivarlo hará que el juego se renderice lo más rápido posible según tu o
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="86"/>
|
||||
<source>Synchronizes CPU core speed with the game's maximum rendering speed to boost FPS without affecting game speed (animations, physics, etc.).
|
||||
Can help reduce stuttering at lower framerates.</source>
|
||||
<translation>Sincroniza la velocidad del núcleo de la CPU con la velocidad máxima de renderizado del juego para aumentar los fotogramas por segundo sin afectar la velocidad del juego (animaciones, físicas, etc.).
|
||||
<translation>Sincroniza la velocidad del núcleo del procesador con la velocidad máxima de renderizado del juego para aumentar los fotogramas por segundo sin afectar la velocidad del juego (animaciones, físicas, etc.).
|
||||
Puede ayudar a reducir los tirones o parpadeos en tasas de fotogramas bajas.</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -567,7 +567,7 @@ Puede ayudar a reducir los tirones o parpadeos en tasas de fotogramas bajas.</tr
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="92"/>
|
||||
<source>Change the accuracy of the emulated CPU (for debugging only).</source>
|
||||
<translation>Cambia la precisión de la CPU emulada (solo para depuración)</translation>
|
||||
<translation>Cambia la precisión del procesador emulado (solo para depuración)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="93"/>
|
||||
@@ -578,7 +578,7 @@ Puede ayudar a reducir los tirones o parpadeos en tasas de fotogramas bajas.</tr
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="95"/>
|
||||
<source>CPU Overclock</source>
|
||||
<translation>Overclock de la CPU</translation>
|
||||
<translation>Overclock del procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="96"/>
|
||||
@@ -806,7 +806,7 @@ Esta función es experimental.</translation>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="173"/>
|
||||
<source>Uses an extra CPU thread for rendering.
|
||||
This option should always remain enabled.</source>
|
||||
<translation>Usa un hilo adicional de la CPU para el renderizado.
|
||||
<translation>Usa un hilo adicional del procesador para el renderizado.
|
||||
Esta opción siempre debe permanecer activada.</translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -836,9 +836,9 @@ GPU: Use the GPU's compute shaders to decode ASTC textures (recommended).
|
||||
CPU Asynchronously: Use the CPU to decode ASTC textures on demand. EliminatesASTC decoding
|
||||
stuttering but may present artifacts.</source>
|
||||
<translation>Esta opción controla cómo deben descodificarse las texturas ASTC.
|
||||
CPU: utiliza la CPU para la descodificación.
|
||||
GPU: utiliza los sombreadores computables de la GPU para descodificar las texturas ASTC (recomendado).
|
||||
CPU asíncrona: usa la CPU para descodificar las texturas ASTC bajo demanda. Elimina los tirones causados por la descodificación ASTC, pero puede generar errores visuales.</translation>
|
||||
CPU: utiliza el procesador para la descodificación.
|
||||
GPU: utiliza los sombreadores computables de la tarjeta gráfica para descodificar las texturas ASTC (recomendado).
|
||||
CPU asíncrono: usa el procesador para descodificar las texturas ASTC bajo demanda. Elimina los tirones causados por la descodificación ASTC, pero puede generar errores visuales.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="184"/>
|
||||
@@ -1354,7 +1354,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="393"/>
|
||||
<source>CPU</source>
|
||||
<translation>CPU</translation>
|
||||
<translation>Procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="394"/>
|
||||
@@ -1364,7 +1364,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="395"/>
|
||||
<source>CPU Asynchronous</source>
|
||||
<translation>CPU asíncrona</translation>
|
||||
<translation>Procesador asíncrono</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="400"/>
|
||||
@@ -1517,7 +1517,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="460"/>
|
||||
<source>CPU Video Decoding</source>
|
||||
<translation>Decodificación de vídeo en la CPU</translation>
|
||||
<translation>Decodificación de vídeo en el procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qt_common/config/shared_translation.cpp" line="461"/>
|
||||
@@ -2367,7 +2367,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu.ui" line="17"/>
|
||||
<source>CPU</source>
|
||||
<translation>CPU</translation>
|
||||
<translation>Procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu.ui" line="28"/>
|
||||
@@ -2382,12 +2382,12 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu.ui" line="68"/>
|
||||
<source>CPU Backend</source>
|
||||
<translation>Motor de la CPU</translation>
|
||||
<translation>Motor del procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu.ui" line="95"/>
|
||||
<source>Unsafe CPU Optimization Settings</source>
|
||||
<translation>Ajustes inseguros de la optimización de la CPU</translation>
|
||||
<translation>Ajustes de optimización del procesador inseguro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu.ui" line="101"/>
|
||||
@@ -2405,12 +2405,12 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu_debug.ui" line="17"/>
|
||||
<source>CPU</source>
|
||||
<translation>CPU</translation>
|
||||
<translation>Procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu_debug.ui" line="25"/>
|
||||
<source>Toggle CPU Optimizations</source>
|
||||
<translation>Cambiar las optimizaciones de la CPU</translation>
|
||||
<translation>Cambiar las optimizaciones del procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu_debug.ui" line="31"/>
|
||||
@@ -2606,7 +2606,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_cpu_debug.ui" line="212"/>
|
||||
<source>CPU settings are available only when game is not running.</source>
|
||||
<translation>Los ajustes de la CPU solo están disponibles cuando no se esté ejecutando ningún juego.</translation>
|
||||
<translation>Los ajustes del procesador solo están disponibles cuando no se esté ejecutando ningún juego.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -2644,17 +2644,17 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="209"/>
|
||||
<source>Enable Extended Logging**</source>
|
||||
<translation>Habilitar el registro extendido**</translation>
|
||||
<translation>Habilitar registro extendido**</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="216"/>
|
||||
<source>Show Log in Console</source>
|
||||
<translation>Ver el registro en la consola</translation>
|
||||
<translation>Ver registro en consola</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="223"/>
|
||||
<source>Open Log Location</source>
|
||||
<translation>Abrir la ubicación del archivo de registro</translation>
|
||||
<translation>Abrir ubicación del archivo de registro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="235"/>
|
||||
@@ -2689,7 +2689,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="282"/>
|
||||
<source>Dump Maxwell Macros</source>
|
||||
<translation>Volcar macros Maxwell</translation>
|
||||
<translation>Volcar Macros Maxwell</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="289"/>
|
||||
@@ -2734,7 +2734,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="338"/>
|
||||
<source>Disable Macro HLE</source>
|
||||
<translation>Desactivar macro HLE</translation>
|
||||
<translation>Desactivar Macro HLE</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="348"/>
|
||||
@@ -2844,7 +2844,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="538"/>
|
||||
<source>Debug Knobs: </source>
|
||||
<translation>Interruptores de depuración:</translation>
|
||||
<translation>perillas de depuración:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="572"/>
|
||||
@@ -2864,7 +2864,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="611"/>
|
||||
<source>Flush log output on each line</source>
|
||||
<translation>Limpia el registro de salida en cada línea</translation>
|
||||
<translation>Limpia lg salida en cada linea</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="618"/>
|
||||
@@ -2879,7 +2879,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="632"/>
|
||||
<source>Censor username in logs</source>
|
||||
<translation>Censura del nombre de usuario en los archivos de registro</translation>
|
||||
<translation>Censura nombre de usario en logs</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug.ui" line="668"/>
|
||||
@@ -2921,7 +2921,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_debug_tab.cpp" line="17"/>
|
||||
<source>CPU</source>
|
||||
<translation>CPU</translation>
|
||||
<translation>Procesador</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -2951,7 +2951,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<location filename="../../src/yuzu/configuration/configure_dialog.cpp" line="71"/>
|
||||
<location filename="../../src/yuzu/configuration/configure_dialog.cpp" line="180"/>
|
||||
<source>CPU</source>
|
||||
<translation>CPU</translation>
|
||||
<translation>Procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_dialog.cpp" line="72"/>
|
||||
@@ -2978,7 +2978,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_dialog.cpp" line="76"/>
|
||||
<source>GraphicsAdvanced</source>
|
||||
<translation>GráficosAvanzados</translation>
|
||||
<translation>Gráficosavanzados</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_dialog.cpp" line="77"/>
|
||||
@@ -3063,7 +3063,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_filesystem.ui" line="65"/>
|
||||
<source>Save Data</source>
|
||||
<translation>Datos de guardado</translation>
|
||||
<translation>Datos guardados</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_filesystem.ui" line="101"/>
|
||||
@@ -3169,7 +3169,7 @@ Cuando un programa intenta abrir el applet del controlador, se cierra inmediatam
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_filesystem.cpp" line="151"/>
|
||||
<source>Set Custom Path</source>
|
||||
<translation>Configura una ruta personalizado</translation>
|
||||
<translation>Configure ruta personalizado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_filesystem.cpp" line="152"/>
|
||||
@@ -4812,7 +4812,7 @@ Los valores actuales son %1% y %2% respectivamente.</translation>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_per_game.cpp" line="79"/>
|
||||
<source>CPU</source>
|
||||
<translation>CPU</translation>
|
||||
<translation>Procesador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/configuration/configure_per_game.cpp" line="80"/>
|
||||
@@ -5814,12 +5814,12 @@ Arrastre los puntos para cambiar de posición, o haga doble clic en las celdas d
|
||||
<message>
|
||||
<location filename="../../src/yuzu/data_dialog.cpp" line="32"/>
|
||||
<source>User NAND</source>
|
||||
<translation>NAND del usuario</translation>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/data_dialog.cpp" line="33"/>
|
||||
<source>System NAND</source>
|
||||
<translation>NAND del sistema</translation>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/data_dialog.cpp" line="34"/>
|
||||
|
||||
Vendored
+614
-621
File diff suppressed because it is too large
Load Diff
Vendored
+2
-2
@@ -5819,12 +5819,12 @@ Drag points to change position, or double-click table cells to edit values.</sou
|
||||
<message>
|
||||
<location filename="../../src/yuzu/data_dialog.cpp" line="32"/>
|
||||
<source>User NAND</source>
|
||||
<translation>NAND користувача</translation>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/data_dialog.cpp" line="33"/>
|
||||
<source>System NAND</source>
|
||||
<translation>NAND системи</translation>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/yuzu/data_dialog.cpp" line="34"/>
|
||||
|
||||
Vendored
+8
@@ -192,6 +192,14 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# SPIRV Tools
|
||||
AddJsonPackage(spirv-tools)
|
||||
|
||||
if (SPIRV-Tools_ADDED)
|
||||
add_library(SPIRV-Tools::SPIRV-Tools ALIAS SPIRV-Tools-static)
|
||||
target_link_libraries(SPIRV-Tools-static PRIVATE SPIRV-Tools-opt SPIRV-Tools-link)
|
||||
endif()
|
||||
|
||||
# Catch2
|
||||
if (YUZU_TESTS OR DYNARMIC_TESTS)
|
||||
AddJsonPackage(catch2)
|
||||
|
||||
Vendored
+14
@@ -102,6 +102,20 @@
|
||||
"git_version": "1.3.18",
|
||||
"find_args": "MODULE"
|
||||
},
|
||||
"spirv-tools": {
|
||||
"package": "SPIRV-Tools",
|
||||
"repo": "KhronosGroup/SPIRV-Tools",
|
||||
"sha": "0a7e28689a",
|
||||
"hash": "eadfcceb82f4b414528d99962335e4f806101168474028f3cf7691ac40c37f323decf2a42c525e2d5bfa6f14ff132d6c5cf9b87c151490efad01f5e13ade1520",
|
||||
"git_version": "2025.4",
|
||||
"options": [
|
||||
"SPIRV_SKIP_EXECUTABLES ON"
|
||||
],
|
||||
"patches": [
|
||||
"0001-netbsd-fix.patch",
|
||||
"0002-allow-static-only.patch"
|
||||
]
|
||||
},
|
||||
"spirv-headers": {
|
||||
"package": "SPIRV-Headers",
|
||||
"repo": "KhronosGroup/SPIRV-Headers",
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 yuzu Emulator Project
|
||||
@@ -254,7 +254,7 @@ else()
|
||||
OUTPUT
|
||||
${FFmpeg_BUILD_LIBRARIES}
|
||||
COMMAND
|
||||
gmake ${FFmpeg_MAKE_ARGS}
|
||||
make ${FFmpeg_MAKE_ARGS}
|
||||
WORKING_DIRECTORY
|
||||
${FFmpeg_BUILD_DIR}
|
||||
)
|
||||
|
||||
-4
@@ -34,10 +34,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||
RENDERER_DEBUG("debug"),
|
||||
RENDERER_PATCH_OLD_QCOM_DRIVERS("patch_old_qcom_drivers"),
|
||||
RENDERER_VERTEX_INPUT_DYNAMIC_STATE("vertex_input_dynamic_state"),
|
||||
FORCE_IDENTITY_SWIZZLE("force_identity_swizzle"),
|
||||
FORCE_LDR_TO_SRGB("force_ldr_to_srgb"),
|
||||
RENDERER_PROVOKING_VERTEX("provoking_vertex"),
|
||||
RENDERER_DESCRIPTOR_INDEXING("descriptor_indexing"),
|
||||
RENDERER_SAMPLE_SHADING("sample_shading"),
|
||||
GPU_UNSWIZZLE_ENABLED("gpu_unswizzle_enabled"),
|
||||
PICTURE_IN_PICTURE("picture_in_picture"),
|
||||
|
||||
+1
-2
@@ -17,8 +17,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
||||
RENDERER_VRAM_USAGE_MODE("vram_usage_mode"),
|
||||
RENDERER_NVDEC_EMULATION("nvdec_emulation"),
|
||||
RENDERER_ASTC_DECODE_METHOD("accelerate_astc"),
|
||||
RENDERER_ASTC_RECOMPRESSION("astc_recompression"),
|
||||
RENDERER_FORMAT_REINTERPRETATION("format_reinterpretation"),
|
||||
RENDERER_ACCURACY("gpu_accuracy"),
|
||||
RENDERER_RESOLUTION("resolution_setup"),
|
||||
RENDERER_VSYNC("use_vsync"),
|
||||
@@ -26,6 +24,7 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
||||
RENDERER_ANTI_ALIASING("anti_aliasing"),
|
||||
RENDERER_SCREEN_LAYOUT("screen_layout"),
|
||||
RENDERER_ASPECT_RATIO("aspect_ratio"),
|
||||
RENDERER_OPTIMIZE_SPIRV_OUTPUT("optimize_spirv_output"),
|
||||
|
||||
RENDERER_DYNA_STATE("dyna_state"),
|
||||
DMA_ACCURACY("dma_accuracy"),
|
||||
|
||||
+9
-45
@@ -148,34 +148,6 @@ abstract class SettingsItem(
|
||||
descriptionId = R.string.vertex_input_dynamic_state_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.FORCE_IDENTITY_SWIZZLE,
|
||||
titleId = R.string.force_identity_swizzle,
|
||||
descriptionId = R.string.force_identity_swizzle_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.FORCE_LDR_TO_SRGB,
|
||||
titleId = R.string.force_ldr_to_srgb,
|
||||
descriptionId = R.string.force_ldr_to_srgb_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_DESCRIPTOR_INDEXING,
|
||||
titleId = R.string.descriptor_indexing,
|
||||
descriptionId = R.string.descriptor_indexing_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_SAMPLE_SHADING,
|
||||
titleId = R.string.sample_shading,
|
||||
descriptionId = R.string.sample_shading_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SliderSetting(
|
||||
IntSetting.RENDERER_SAMPLE_SHADING,
|
||||
@@ -363,23 +335,6 @@ abstract class SettingsItem(
|
||||
valuesId = R.array.astcDecodingMethodValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.RENDERER_ASTC_RECOMPRESSION,
|
||||
titleId = R.string.astc_recompression,
|
||||
descriptionId = R.string.astc_recompression_description,
|
||||
choicesId = R.array.astcRecompressionMethodNames,
|
||||
valuesId = R.array.astcRecompressionMethodValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.RENDERER_FORMAT_REINTERPRETATION,
|
||||
titleId = R.string.format_reinterpretation,
|
||||
choicesId = R.array.formatReinterpretationNames,
|
||||
valuesId = R.array.formatReinterpretationValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.RENDERER_VRAM_USAGE_MODE,
|
||||
@@ -688,6 +643,15 @@ abstract class SettingsItem(
|
||||
descriptionId = R.string.renderer_async_presentation_description
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.RENDERER_OPTIMIZE_SPIRV_OUTPUT,
|
||||
titleId = R.string.renderer_optimize_spirv_output,
|
||||
descriptionId = R.string.renderer_optimize_spirv_output_description,
|
||||
choicesId = R.array.optimizeSpirvOutputEntries,
|
||||
valuesId = R.array.optimizeSpirvOutputValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.DMA_ACCURACY,
|
||||
|
||||
+1
@@ -271,6 +271,7 @@ class SettingsFragmentPresenter(
|
||||
add(IntSetting.FSR_SHARPENING_SLIDER.key)
|
||||
}
|
||||
add(IntSetting.RENDERER_ANTI_ALIASING.key)
|
||||
add(IntSetting.RENDERER_OPTIMIZE_SPIRV_OUTPUT.key)
|
||||
|
||||
add(HeaderSetting(R.string.advanced))
|
||||
|
||||
|
||||
@@ -1726,8 +1726,9 @@ JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_getUpdateUrl(
|
||||
jobject obj,
|
||||
jstring version) {
|
||||
const char* version_str = env->GetStringUTFChars(version, nullptr);
|
||||
const std::string url = fmt::format("{}/{}",
|
||||
std::string{Common::g_build_auto_update_api},
|
||||
const std::string url = fmt::format("{}/{}/releases/tag/{}",
|
||||
std::string{Common::g_build_auto_update_website},
|
||||
std::string{Common::g_build_auto_update_repo},
|
||||
version_str);
|
||||
env->ReleaseStringUTFChars(version, version_str);
|
||||
return env->NewStringUTF(url.c_str());
|
||||
@@ -1759,10 +1760,11 @@ JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_getUpdateApkUrl(
|
||||
}
|
||||
|
||||
const std::string apk_filename = fmt::format("Eden-Android-{}-{}.apk", artifact_str, variant);
|
||||
|
||||
const std::string url = fmt::format("{}/{}/{}",
|
||||
std::string{Common::g_build_auto_update_api},
|
||||
version_str, apk_filename);
|
||||
const std::string url = fmt::format("{}/{}/releases/download/{}/{}",
|
||||
std::string{Common::g_build_auto_update_website},
|
||||
std::string{Common::g_build_auto_update_repo},
|
||||
version_str,
|
||||
apk_filename);
|
||||
|
||||
env->ReleaseStringUTFChars(tag, version_str);
|
||||
env->ReleaseStringUTFChars(artifact, artifact_str);
|
||||
|
||||
@@ -463,6 +463,8 @@
|
||||
<string name="fsr_sharpness">حدة FSR</string>
|
||||
<string name="fsr_sharpness_description">يحدد مدى وضوح الصورة عند استخدام التباين الديناميكي لـ FSR</string>
|
||||
<string name="renderer_anti_aliasing">طريقة مضاد التعرج</string>
|
||||
<string name="renderer_optimize_spirv_output">تحسين مخرجات SPIRV</string>
|
||||
<string name="renderer_optimize_spirv_output_description">يعمل على تحسين أداء برامج التظليل المجمعة لتحسين كفاءة وحدة معالجة الرسومات، ولكنه قد يؤدي إلى زيادة وقت التحميل وإبطاء السرعة في البداية.</string>
|
||||
|
||||
|
||||
<string name="advanced">متقدم</string>
|
||||
@@ -493,7 +495,7 @@
|
||||
<string name="enable_buffer_history">تمكين سجل التخزين المؤقت</string>
|
||||
<string name="enable_buffer_history_description">يُتيح هذا الخيار الوصول إلى حالات التخزين المؤقت السابقة. وقد يُحسّن جودة العرض وثبات الأداء في بعض الألعاب.</string>
|
||||
<string name="use_optimized_vertex_buffers">مخازن الرؤوس المُحسّنة</string>
|
||||
<string name="use_optimized_vertex_buffers_description">يتيح ربط مخزن الرؤوس المُحسّن لتحسين الأداء. يتطلب برامج تشغيل Turnip/QCOM من إصدار Mesa 26.0 أو أحدث. سيؤدي إلى تعطل النظام عند استخدام برامج تشغيل Turnip الأقدم.</string>
|
||||
<string name="use_optimized_vertex_buffers_description">يُتيح ربطًا مُحسَّنًا لمخازن الرؤوس لتحسين الأداء. يتطلب برامج تشغيل Turnip من Mesa 26.0 أو أحدث. قد يتعطل على برامج التشغيل الأقدم.</string>
|
||||
|
||||
<string name="hacks">اختراقات</string>
|
||||
|
||||
@@ -502,9 +504,7 @@
|
||||
<string name="skip_cpu_inner_invalidation">تخطي إبطال صلاحية وحدة المعالجة المركزية الداخلية</string>
|
||||
<string name="skip_cpu_inner_invalidation_description">يتخطى بعض عمليات إبطال ذاكرة التخزين المؤقتة من جانب وحدة المعالجة المركزية أثناء تحديثات الذاكرة، مما يقلل من استخدام وحدة المعالجة المركزية ويحسن أداءها. قد يتسبب ذلك في حدوث أعطال أو تعطل في بعض الألعاب.</string>
|
||||
<string name="fix_bloom_effects">إصلاح تأثيرات التوهج</string>
|
||||
<string name="fix_bloom_effects_description">يقلل من ضبابية التوهج في LA/EOW (Adreno A6XX - A7XX/ Turnip)، ويزيل التوهج في Burnout. تحذير: قد يسبب تشوهات رسومية في ألعاب أخرى.</string>
|
||||
<string name="emulate_bgr565">محاكاة BGR565</string>
|
||||
<string name="emulate_bgr565_description">يُصلح مشاكل انعكاس الألوان في الألعاب أو ظهور تشوهات غريبة أو ظلال غريبة.</string>
|
||||
<string name="fix_bloom_effects_description">يقلل من ضبابية التوهج في LA/EOW (Adreno 700)، ويزيل التوهج في Burnout. تحذير: قد يسبب ظهور خلل رسومي في ألعاب أخرى.</string>
|
||||
<string name="renderer_asynchronous_shaders">استخدم تظليل غير متزامن</string>
|
||||
<string name="renderer_asynchronous_shaders_description">يقوم بتجميع التظليل بشكل غير متزامن. قد يقلل ذلك من التقطعات ولكنه قد يؤدي أيضًا إلى حدوث أخطاء.</string>
|
||||
<string name="gpu_unswizzle_settings">إعدادات إلغاء ترتيب بيانات وحدة معالجة الرسومات</string>
|
||||
|
||||
@@ -332,6 +332,7 @@
|
||||
<string name="fsr_sharpness">تیژی FSR</string>
|
||||
<string name="fsr_sharpness_description">دیاریکردنی تیژی وێنە لە کاتی بەکارهێنانی FSR</string>
|
||||
<string name="renderer_anti_aliasing">شێوازی دژە-خاوڕۆیی</string>
|
||||
<string name="renderer_optimize_spirv_output_description">شێیدەرە کۆمپایلکراوەکان باش دەکات بۆ باشترکردنی کارایی GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">وردیی DMA</string>
|
||||
|
||||
@@ -442,6 +442,8 @@
|
||||
<string name="fsr_sharpness">Ostrost FSR</string>
|
||||
<string name="fsr_sharpness_description">Určuje jak ostře bude obraz vypadat při použití dynamického kontrastu FSR.</string>
|
||||
<string name="renderer_anti_aliasing">Metoda anti-aliasingu</string>
|
||||
<string name="renderer_optimize_spirv_output">Optimalizovat výstup SPIRV</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimalizuje kompilované shadery pro zlepšení efektivity GPU, ale mohou se objevit delší nahrávací časy a zpomalení v úvodu.</string>
|
||||
|
||||
|
||||
<string name="advanced">Pokročilé</string>
|
||||
|
||||
@@ -442,6 +442,8 @@ Wird der Handheld-Modus verwendet, verringert es die Auflösung und erhöht die
|
||||
<string name="fsr_sharpness">FSR-Schärfe</string>
|
||||
<string name="fsr_sharpness_description">Bestimmt die Schärfe bei FSR-Nutzung.</string>
|
||||
<string name="renderer_anti_aliasing">Kantenglättung</string>
|
||||
<string name="renderer_optimize_spirv_output">Optimiere SPIRV-Ausgabe</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimiert den kompilierten Shader, um die GPU-Effizienz zu verbessern.</string>
|
||||
|
||||
|
||||
<string name="advanced">Erweitert</string>
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
<string name="general_information">Información general</string>
|
||||
<string name="hardware">Hardware</string>
|
||||
<string name="supported_abis">ABIs soportadas</string>
|
||||
<string name="cpu_info">Información de la CPU</string>
|
||||
<string name="cpu_info">Información del procesador</string>
|
||||
<string name="gpu_information">Información de la GPU</string>
|
||||
<string name="vulkan_driver_version">Versión del controlador de Vulkan</string>
|
||||
<string name="error_getting_emulator_info">Error al obtener la información del emulador</string>
|
||||
@@ -416,8 +416,8 @@
|
||||
<string name="turbo_speed_limit_description">Cuando el modo turbo esté activado, la emulación se ejecutará a esta velocidad.</string>
|
||||
<string name="slow_speed_limit">Velocidad lenta</string>
|
||||
<string name="slow_speed_limit_description">Cuando el modo lento esté activado, la emulación se ejecutará a esta velocidad.</string>
|
||||
<string name="cpu_backend">Motor de la CPU</string>
|
||||
<string name="cpu_accuracy">Precisión de la CPU</string>
|
||||
<string name="cpu_backend">Motor del procesador</string>
|
||||
<string name="cpu_accuracy">Precisión del procesador</string>
|
||||
<string name="value_with_units">%1$s%2$s</string>
|
||||
|
||||
<!-- System settings strings -->
|
||||
@@ -433,7 +433,7 @@
|
||||
<string name="set_custom_rtc">Configurar RTC personalizado</string>
|
||||
|
||||
<!-- CPU -->
|
||||
<string name="fast_cpu_time">Overclock de la CPU</string>
|
||||
<string name="fast_cpu_time">Overclock del procesador</string>
|
||||
<string name="fast_cpu_time_description">Fuerza a la CPU emulada a ejecutarser a una velocidad de reloj más alta, lo cual reduce ciertos limitadores de fotogramas por segundo. Usa Boost (1700 MHz) para ejecutar a la velocidad de reloj nativa más alta de la Switch, o Fast (2000 MHz) para ejecutar a una velocidad doble de reloj.</string>
|
||||
<string name="custom_cpu_ticks">Ticks de CPU personalizados</string>
|
||||
<string name="custom_cpu_ticks_description">Establezca un valor personalizado de los ciclos de la CPU. Los valores más altos pueden aumentar el rendimiento, pero también pueden hacer que el juego se congele. Se recomienda un rango de 77–21000.</string>
|
||||
@@ -457,6 +457,8 @@
|
||||
<string name="fsr_sharpness">Nitidez FSR</string>
|
||||
<string name="fsr_sharpness_description">Ajusta la intensidad del filtro de enfoque al usar el contraste dinámico de FSR.</string>
|
||||
<string name="renderer_anti_aliasing">Método de suavizado de bordes</string>
|
||||
<string name="renderer_optimize_spirv_output">Optimizar la salida de SPIRV</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimiza los sombreadores compilados para mejorar la eficiencia de la GPU.</string>
|
||||
|
||||
|
||||
<string name="advanced">Avanzado</string>
|
||||
@@ -487,7 +489,7 @@
|
||||
<string name="enable_buffer_history">Activar el historial del búfer</string>
|
||||
<string name="enable_buffer_history_description">Permite el acceso al estado del búfer anterior. Esta opción puede mejorar la calidad de renderizado y la consistencia en el rendimiento de algunos juegos.</string>
|
||||
<string name="use_optimized_vertex_buffers">Búferes de vértices optimizados</string>
|
||||
<string name="use_optimized_vertex_buffers_description">Permite la optimización del enlace del búfer de vértices para un mejor rendimiento. Requiere controladores Mesa 26.0+ Turnip/ controladores QCOM. Causará fallos con controladores Turnip más antiguos.</string>
|
||||
<string name="use_optimized_vertex_buffers_description">Permite la vinculación optimizada del búfer de vértices para un mejor rendimiento. Requiere controladores de Mesa 26.0+ Turnip. Se producirán fallos en controladores más antiguos.</string>
|
||||
|
||||
<string name="hacks">Hacks</string>
|
||||
|
||||
@@ -496,9 +498,7 @@
|
||||
<string name="skip_cpu_inner_invalidation">Omitir invalidación interna de la CPU</string>
|
||||
<string name="skip_cpu_inner_invalidation_description">Omite ciertas invalidaciones de caché de la CPU durante las actualizaciones de memoria, lo que reduce el uso de la CPU y mejora su rendimiento. Esto puede causar fallos o bloqueos en algunos juegos.</string>
|
||||
<string name="fix_bloom_effects">Arreglar los efectos de resplandor</string>
|
||||
<string name="fix_bloom_effects_description">Reduce el efecto de resplandor en LA/EOW (Adreno A6XX - A7XX/ Turnip), elimina el resplandor en Burnout. Advertencia: puede causar artefactos gráficos en otros juegos.</string>
|
||||
<string name="emulate_bgr565">Emular BGR565</string>
|
||||
<string name="emulate_bgr565_description">Soluciona problemas con colores invertidos en juegos, artefactos o sombras extrañas.</string>
|
||||
<string name="fix_bloom_effects_description">Reduce el efecto de resplandor en LA/EOW (Adreno 700), elimina el resplandor en Burnout. Advertencia: puede causar artefactos gráficos en otros juegos.</string>
|
||||
<string name="renderer_asynchronous_shaders">Usar sombreadores asíncronos</string>
|
||||
<string name="renderer_asynchronous_shaders_description">Compila los sombreadores de forma asíncrona. Esto puede reducir los tirones, pero también puede introducir errores gráficos.</string>
|
||||
<string name="gpu_unswizzle_settings">Ajustes de desentrelazado de la GPU</string>
|
||||
@@ -536,7 +536,7 @@
|
||||
<string name="warning_resolution">Escalar la resolución a 2x o más puede causar problemas y ralentizar significativamente su dispositivo.</string>
|
||||
|
||||
<!-- Debug settings strings -->
|
||||
<string name="cpu">CPU</string>
|
||||
<string name="cpu">Procesador</string>
|
||||
<string name="use_auto_stub">Usar Auto Stub</string>
|
||||
<string name="use_auto_stub_description">Rellena automáticamente servicios y funciones ausentes. Puede mejorar la compatibilidad pero puede causar cierres inesperados.</string>
|
||||
|
||||
|
||||
@@ -125,6 +125,8 @@
|
||||
<string name="nvdec_emulation_none">هیچکدام</string>
|
||||
|
||||
<!-- Optimize Spir-V output -->
|
||||
<string name="renderer_optimize_spirv_output">بهینهسازی خروجی Spir-V</string>
|
||||
<string name="renderer_optimize_spirv_output_description">شیدر کامپایل شده را برای بهبود کارایی GPU بهینهسازی میکند.</string>
|
||||
<string name="never">هرگز</string>
|
||||
<string name="on_load">در هنگام بارگذاری</string>
|
||||
<string name="always">همیشه</string>
|
||||
|
||||
@@ -455,6 +455,7 @@
|
||||
<string name="fsr_sharpness">Netteté FSR</string>
|
||||
<string name="fsr_sharpness_description">Détermine à quel point l\'image sera affinée lors de l\'utilisation du contraste dynamique FSR.</string>
|
||||
<string name="renderer_anti_aliasing">Méthode d\'anticrénelage</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimise le shader compilé pour améliorer l\'efficacité du GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">Précision DMA</string>
|
||||
|
||||
@@ -362,6 +362,7 @@
|
||||
<string name="fsr_sharpness">חדות FSR</string>
|
||||
<string name="fsr_sharpness_description">קובע את מידת החדות בעת שימוש ב-FSR.</string>
|
||||
<string name="renderer_anti_aliasing">שיטת Anti-aliasing</string>
|
||||
<string name="renderer_optimize_spirv_output_description">משפר את השאדר המהודר כדי להגביר את יעילות ה-GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">דיוק DMA</string>
|
||||
|
||||
@@ -351,6 +351,7 @@
|
||||
<string name="fsr_sharpness">FSR élesség</string>
|
||||
<string name="fsr_sharpness_description">Meghatározza, milyen éles lesz a kép az FSR dinamikus kontraszt használata közben.</string>
|
||||
<string name="renderer_anti_aliasing">Élsimítási módszer</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimalizálja a lefordított shadert a GPU hatékonyságának javításáért.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">DMA pontosság</string>
|
||||
|
||||
@@ -383,6 +383,7 @@
|
||||
<string name="fsr_sharpness">Ketajaman FSR</string>
|
||||
<string name="fsr_sharpness_description">Menentukan seberapa tajam gambar akan terlihat saat menggunakan kontras dinamis FSR</string>
|
||||
<string name="renderer_anti_aliasing">Metode anti-aliasing</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Mengoptimalkan shader yang dikompilasi untuk meningkatkan efisiensi GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">Akurasi DMA</string>
|
||||
|
||||
@@ -390,6 +390,7 @@
|
||||
<string name="fsr_sharpness">Nitidezza FSR</string>
|
||||
<string name="fsr_sharpness_description">Determina quanto sarà nitida l\'immagine utilizzando il contrasto dinamico di FSR</string>
|
||||
<string name="renderer_anti_aliasing">Metodo di anti-aliasing</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Ottimizza lo shader compilato per migliorare l\'efficienza della GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">Precisione DMA</string>
|
||||
|
||||
@@ -349,6 +349,7 @@
|
||||
<string name="renderer_vsync">垂直同期モード</string>
|
||||
<string name="renderer_scaling_filter">ウィンドウ適応フィルター</string>
|
||||
<string name="renderer_anti_aliasing">アンチエイリアス方式</string>
|
||||
<string name="renderer_optimize_spirv_output_description">コンパイル済みシェーダーを最適化し、GPUの効率を向上させます。</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">DMA精度</string>
|
||||
|
||||
@@ -349,6 +349,7 @@
|
||||
<string name="renderer_vsync">수직동기화 모드</string>
|
||||
<string name="renderer_scaling_filter">윈도우 적응 필터</string>
|
||||
<string name="renderer_anti_aliasing">안티에일리어싱 방법</string>
|
||||
<string name="renderer_optimize_spirv_output_description">컴파일된 셰이더를 최적화하여 GPU 효율성을 향상시킵니다.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">DMA 정확도</string>
|
||||
|
||||
@@ -332,6 +332,7 @@
|
||||
<string name="fsr_sharpness">FSR-skarphet</string>
|
||||
<string name="fsr_sharpness_description">Bestemmer bildekvalitet med FSR</string>
|
||||
<string name="renderer_anti_aliasing">Anti-aliasing-metode</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimaliserer den kompilerte shaderen for å forbedre GPU-effektiviteten.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">DMA-nøyaktighet</string>
|
||||
|
||||
@@ -442,6 +442,8 @@
|
||||
<string name="fsr_sharpness">Ostrość FSR</string>
|
||||
<string name="fsr_sharpness_description">Kontroluje ostrość obrazu w FSR.</string>
|
||||
<string name="renderer_anti_aliasing">Metoda wygładzania krawędzi</string>
|
||||
<string name="renderer_optimize_spirv_output">Optymalizuj wyjście SPIRV</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optymalizuje skompilowany shader w celu poprawy wydajności GPU.</string>
|
||||
|
||||
|
||||
<string name="advanced">Zaawansowane</string>
|
||||
|
||||
@@ -433,6 +433,7 @@
|
||||
<string name="fsr_sharpness">Nitidez do FSR</string>
|
||||
<string name="fsr_sharpness_description">Determina a nitidez da imagem ao utilizar o contraste dinâmico do FSR</string>
|
||||
<string name="renderer_anti_aliasing">Método de Anti-aliasing</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Otimiza o shader compilado para melhorar a eficiência da GPU.</string>
|
||||
|
||||
|
||||
<string name="advanced">Avançado</string>
|
||||
|
||||
@@ -355,6 +355,7 @@
|
||||
<string name="fsr_sharpness">Nitidez do FSR</string>
|
||||
<string name="fsr_sharpness_description">Determina a nitidez da imagem ao usar contraste dinâmico do FSR</string>
|
||||
<string name="renderer_anti_aliasing">Método de Anti-Serrilhado</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Otimiza o shader compilado para melhorar a eficiência da GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">Precisão da DMA</string>
|
||||
|
||||
@@ -459,6 +459,8 @@
|
||||
<string name="fsr_sharpness">Резкость FSR</string>
|
||||
<string name="fsr_sharpness_description">Определяет, насколько чётким будет изображение при использовании динамического контраста FSR.</string>
|
||||
<string name="renderer_anti_aliasing">Метод сглаживания</string>
|
||||
<string name="renderer_optimize_spirv_output">Оптимизация вывода SPIRV</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Оптимизирует скомпилированный шейдер для повышения эффективности ГПУ.</string>
|
||||
|
||||
|
||||
<string name="advanced">Расширенные</string>
|
||||
@@ -489,6 +491,8 @@
|
||||
<string name="enable_buffer_history">Включить историю буфера</string>
|
||||
<string name="enable_buffer_history_description">Позволяет обращаться к предыдущим состояниям буфера. Эта опция может повысить качество рендеринга и стабильность производительности в некоторых играх.</string>
|
||||
<string name="use_optimized_vertex_buffers">Оптимизированные вершинные буферы</string>
|
||||
<string name="use_optimized_vertex_buffers_description">Активирует оптимизированную привязку вершинных буферов для улучшения производительности. Требуются Mesa Turnip драйвера версией не ниже 26.0, на более старых драйверах будут происходить сбои и краши</string>
|
||||
|
||||
<string name="hacks">Хаки</string>
|
||||
|
||||
<string name="fast_gpu_time">Быстрое время ГПУ</string>
|
||||
@@ -496,6 +500,7 @@
|
||||
<string name="skip_cpu_inner_invalidation">Пропустить внутреннюю инвалидацию ЦП</string>
|
||||
<string name="skip_cpu_inner_invalidation_description">Пропускает некоторые инвалидации кэша на стороне ЦП при обновлениях памяти, уменьшая нагрузку на процессор и повышая производительность. Может вызывать сбои в некоторых играх.</string>
|
||||
<string name="fix_bloom_effects">Исправить эффекты размытия</string>
|
||||
<string name="fix_bloom_effects_description">Частично убирает размытие в LA/EOW (Adreno 700), полностью отключает его в Burnout. Внимание: может вызывать графические артефакты в других играх.</string>
|
||||
<string name="renderer_asynchronous_shaders">Использовать асинхронные шейдеры</string>
|
||||
<string name="renderer_asynchronous_shaders_description">Компилирует шейдеры асинхронно. Это может уменьшить подтормаживания, но также может вызвать графические артефакты.</string>
|
||||
<string name="gpu_unswizzle_settings">Настройки распаковки текстур (Unswizzle)</string>
|
||||
|
||||
@@ -354,6 +354,7 @@
|
||||
<string name="fsr_sharpness">ФСР оштрина</string>
|
||||
<string name="fsr_sharpness_description">Одређује колико ће се слика наоштрен трајати док користи \"ФСР\" динамички контраст</string>
|
||||
<string name="renderer_anti_aliasing">Метода против алиасирања</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Оптимизира састављена схадер за побољшање ефикасности ГПУ-а.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">DMA тачност</string>
|
||||
|
||||
@@ -459,6 +459,8 @@
|
||||
<string name="fsr_sharpness">Різкість FSR</string>
|
||||
<string name="fsr_sharpness_description">Визначає різкість зображення при використанні FSR.</string>
|
||||
<string name="renderer_anti_aliasing">Згладжування</string>
|
||||
<string name="renderer_optimize_spirv_output">Оптимізовувати виведення SPIRV</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Оптимізує скомпільований шейдер для покращення ефективності GPU.</string>
|
||||
|
||||
|
||||
<string name="advanced">Додаткові</string>
|
||||
@@ -489,7 +491,7 @@
|
||||
<string name="enable_buffer_history">Увімкнути історію буфера</string>
|
||||
<string name="enable_buffer_history_description">Вмикає доступ до попередніх станів буфера. Цей параметр може покращити якість візуалізації та стабільну продуктивність у деяких іграх.</string>
|
||||
<string name="use_optimized_vertex_buffers">Оптимізовані буфери вершин</string>
|
||||
<string name="use_optimized_vertex_buffers_description">Застосовує оптимізований буфер вершин, щоб покращити продуктивність. Потребує драйверів Mesa 26.0+ Turnip / QCOM. На старіших драйверах Turnip виникатиме збій.</string>
|
||||
<string name="use_optimized_vertex_buffers_description">Застосовує оптимізований буфер вершин, щоб покращити продуктивність. Потребує драйверів Mesa 26.0+ Turnip. На старіших драйверах виникатиме збій.</string>
|
||||
|
||||
<string name="hacks">Обхідні рішення</string>
|
||||
|
||||
@@ -498,9 +500,7 @@
|
||||
<string name="skip_cpu_inner_invalidation">Пропустити внутрішнє інвалідування CPU</string>
|
||||
<string name="skip_cpu_inner_invalidation_description">Пропускає деякі інвалідації кешу на стороні CPU під час оновлення пам\'яті, зменшуючи навантаження на процесор і покращуючи продуктивність. Може спричинити збої в деяких іграх.</string>
|
||||
<string name="fix_bloom_effects">Виправити ефекти світіння</string>
|
||||
<string name="fix_bloom_effects_description">Зменшує розмиття світіння в LA/EOW (Adreno A6XX–A7XX / Turnip), прибирає світіння в Burnout. Увага: може спричинити графічні артефакти в інших іграх.</string>
|
||||
<string name="emulate_bgr565">Емулювати BGR565</string>
|
||||
<string name="emulate_bgr565_description">Виправляє проблеми з інвертованими кольорами в іграх або дивними артефактами чи тінями.</string>
|
||||
<string name="fix_bloom_effects_description">Зменшує розмиття світіння в LA/EOW (Adreno 700), прибирає світіння в Burnout. Увага: може спричинити графічні артефакти в інших іграх.</string>
|
||||
<string name="renderer_asynchronous_shaders">Асинхронні шейдери</string>
|
||||
<string name="renderer_asynchronous_shaders_description">Компілює шейдери асинхронно. Це може зменшити затримки, але також може спричинити графічні баги.</string>
|
||||
<string name="gpu_unswizzle_settings">Налаштування розпакування за допомогою ГП</string>
|
||||
|
||||
@@ -330,6 +330,7 @@
|
||||
<string name="fsr_sharpness">Độ sắc nét FSR</string>
|
||||
<string name="fsr_sharpness_description">Độ sắc nét khi dùng FSR</string>
|
||||
<string name="renderer_anti_aliasing">Phương pháp khử răng cưa</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Tối ưu hóa shader đã biên dịch để cải thiện hiệu suất GPU.</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">Độ chính xác DMA</string>
|
||||
|
||||
@@ -453,6 +453,8 @@
|
||||
<string name="fsr_sharpness">FSR 锐化度</string>
|
||||
<string name="fsr_sharpness_description">指定使用 FSR 时图像的锐化程度</string>
|
||||
<string name="renderer_anti_aliasing">抗锯齿方式</string>
|
||||
<string name="renderer_optimize_spirv_output">优化 SPIRV 输出</string>
|
||||
<string name="renderer_optimize_spirv_output_description">优化编译后的着色器以提高GPU效率。</string>
|
||||
|
||||
|
||||
<string name="advanced">高级</string>
|
||||
@@ -483,6 +485,8 @@
|
||||
<string name="enable_buffer_history">启用缓冲区历史</string>
|
||||
<string name="enable_buffer_history_description">启用对先前缓冲区状态的访问。此选项可在某些游戏中提升渲染质量并保持性能的一致性。</string>
|
||||
<string name="use_optimized_vertex_buffers">优化顶点缓冲区</string>
|
||||
<string name="use_optimized_vertex_buffers_description">启用经过优化的顶点缓冲区绑定以提升性能。需要 Mesa 26.0 及以上版本的 Turnip 驱动程序。在旧版驱动程序上会导致程序崩溃。</string>
|
||||
|
||||
<string name="hacks">Hacks</string>
|
||||
|
||||
<string name="fast_gpu_time">GPU 超频频率</string>
|
||||
@@ -490,6 +494,7 @@
|
||||
<string name="skip_cpu_inner_invalidation">跳过CPU内部无效化</string>
|
||||
<string name="skip_cpu_inner_invalidation_description">在内存更新期间跳过某些CPU端缓存无效化,减少CPU使用率并提高其性能。可能会导致某些游戏出现故障或崩溃。</string>
|
||||
<string name="fix_bloom_effects">修复 Bloom 效果</string>
|
||||
<string name="fix_bloom_effects_description">减少《塞尔达传说:智慧的再现》(Adreno 700)中的 bloom 模糊,并移除《Burnout》中的 bloom 效果。警告:可能会导致在其他游戏中出现画面显示问题。</string>
|
||||
<string name="renderer_asynchronous_shaders">使用异步着色器</string>
|
||||
<string name="renderer_asynchronous_shaders_description">异步编译着色器。这可能会减少卡顿,但也可能会导致图形错误。</string>
|
||||
<string name="gpu_unswizzle_settings">GPU 还原设置</string>
|
||||
|
||||
@@ -440,6 +440,7 @@
|
||||
<string name="fsr_sharpness">FSR 銳化度</string>
|
||||
<string name="fsr_sharpness_description">使用 FSR 時圖片的銳化程度</string>
|
||||
<string name="renderer_anti_aliasing">抗鋸齒</string>
|
||||
<string name="renderer_optimize_spirv_output_description">最佳化編譯後的著色器以提高GPU效率。</string>
|
||||
|
||||
|
||||
<string name="dma_accuracy">DMA 準確度</string>
|
||||
|
||||
@@ -469,6 +469,8 @@
|
||||
<string name="fsr_sharpness">FSR sharpness</string>
|
||||
<string name="fsr_sharpness_description">Determines how sharpened the image will look while using FSR\'s dynamic contrast</string>
|
||||
<string name="renderer_anti_aliasing">Anti-aliasing method</string>
|
||||
<string name="renderer_optimize_spirv_output">Optimize SPIRV output</string>
|
||||
<string name="renderer_optimize_spirv_output_description">Optimizes compiled shaders to improve GPU efficiency, but may introduce longer loading times and initial slowdowns.</string>
|
||||
|
||||
|
||||
<string name="advanced">Advanced</string>
|
||||
|
||||
@@ -693,9 +693,7 @@ void HostMemory::Map(size_t virtual_offset, size_t host_offset, size_t length,
|
||||
ASSERT(virtual_offset % PageAlignment == 0);
|
||||
ASSERT(host_offset % PageAlignment == 0);
|
||||
ASSERT(length % PageAlignment == 0);
|
||||
if (impl && virtual_base) {
|
||||
ASSERT(virtual_offset + length <= virtual_size);
|
||||
}
|
||||
ASSERT(virtual_offset + length <= virtual_size);
|
||||
ASSERT(host_offset + length <= backing_size);
|
||||
if (length == 0 || !virtual_base || !impl) {
|
||||
return;
|
||||
@@ -706,9 +704,7 @@ void HostMemory::Map(size_t virtual_offset, size_t host_offset, size_t length,
|
||||
void HostMemory::Unmap(size_t virtual_offset, size_t length, bool separate_heap) {
|
||||
ASSERT(virtual_offset % PageAlignment == 0);
|
||||
ASSERT(length % PageAlignment == 0);
|
||||
if (impl && virtual_base) {
|
||||
ASSERT(virtual_offset + length <= virtual_size);
|
||||
}
|
||||
ASSERT(virtual_offset + length <= virtual_size);
|
||||
if (length == 0 || !virtual_base || !impl) {
|
||||
return;
|
||||
}
|
||||
@@ -718,9 +714,7 @@ void HostMemory::Unmap(size_t virtual_offset, size_t length, bool separate_heap)
|
||||
void HostMemory::Protect(size_t virtual_offset, size_t length, MemoryPermission perm) {
|
||||
ASSERT(virtual_offset % PageAlignment == 0);
|
||||
ASSERT(length % PageAlignment == 0);
|
||||
if (impl && virtual_base) {
|
||||
ASSERT(virtual_offset + length <= virtual_size);
|
||||
}
|
||||
ASSERT(virtual_offset + length <= virtual_size);
|
||||
if (length == 0 || !virtual_base || !impl) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ SWITCHABLE(AstcRecompression, true);
|
||||
SWITCHABLE(AudioMode, true);
|
||||
SWITCHABLE(CpuBackend, true);
|
||||
SWITCHABLE(CpuAccuracy, true);
|
||||
SWITCHABLE(FormatReinterpretation, true);
|
||||
SWITCHABLE(FullscreenMode, true);
|
||||
SWITCHABLE(GpuAccuracy, true);
|
||||
SWITCHABLE(GpuLogLevel, true);
|
||||
|
||||
+5
-63
@@ -69,7 +69,6 @@ SWITCHABLE(AstcRecompression, true);
|
||||
SWITCHABLE(AudioMode, true);
|
||||
SWITCHABLE(CpuBackend, true);
|
||||
SWITCHABLE(CpuAccuracy, true);
|
||||
SWITCHABLE(FormatReinterpretation, true);
|
||||
SWITCHABLE(FullscreenMode, true);
|
||||
SWITCHABLE(GpuAccuracy, true);
|
||||
SWITCHABLE(Language, true);
|
||||
@@ -389,6 +388,10 @@ struct Values {
|
||||
true,
|
||||
true};
|
||||
|
||||
SwitchableSetting<SpirvOptimizeMode, true> optimize_spirv_output{linkage,
|
||||
SpirvOptimizeMode::Never,
|
||||
"optimize_spirv_output",
|
||||
Category::Renderer};
|
||||
SwitchableSetting<bool> use_asynchronous_gpu_emulation{
|
||||
linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
|
||||
// *nix platforms may have issues with the borderless windowed fullscreen mode.
|
||||
@@ -470,11 +473,7 @@ struct Values {
|
||||
"astc_recompression",
|
||||
Category::RendererAdvanced};
|
||||
|
||||
SwitchableSetting<FormatReinterpretation, true> format_reinterpretation{
|
||||
linkage,
|
||||
FormatReinterpretation::Disabled,
|
||||
"format_reinterpretation",
|
||||
Category::RendererAdvanced};
|
||||
|
||||
SwitchableSetting<bool> sync_memory_operations{linkage,
|
||||
false,
|
||||
"sync_memory_operations",
|
||||
@@ -483,9 +482,6 @@ struct Values {
|
||||
true,
|
||||
true};
|
||||
|
||||
SwitchableSetting<bool> force_identity_swizzle{linkage, false, "force_identity_swizzle",
|
||||
Category::RendererAdvanced};
|
||||
|
||||
SwitchableSetting<bool> renderer_force_max_clock{linkage, false, "force_max_clock",
|
||||
Category::RendererAdvanced};
|
||||
|
||||
@@ -616,60 +612,6 @@ struct Values {
|
||||
#endif
|
||||
"vertex_input_dynamic_state", Category::RendererExtensions};
|
||||
|
||||
#ifdef ANDROID
|
||||
// Shader Float Controls (Android only) - Eden Veil / Extensions
|
||||
// Force enable VK_KHR_shader_float_controls even if driver has known issues
|
||||
// Allows fine-tuning float behavior to match Switch/Maxwell or optimize performance
|
||||
SwitchableSetting<bool> shader_float_controls_force_enable{linkage,
|
||||
false,
|
||||
"shader_float_controls_force_enable",
|
||||
Category::RendererExtensions,
|
||||
Specialization::Paired};
|
||||
|
||||
// Individual float behavior controls (visible only when force_enable is true)
|
||||
// Multiple can be active simultaneously EXCEPT FTZ and DenormPreserve (mutually exclusive)
|
||||
//
|
||||
// Recommended configurations:
|
||||
// Switch-native: FTZ=ON, RTE=ON, SignedZero=ON (matches Maxwell behavior)
|
||||
// Performance: FTZ=ON only (fastest)
|
||||
// Accuracy: DenormPreserve=ON, RTE=ON, SignedZero=ON (slowest, highest precision)
|
||||
SwitchableSetting<bool> shader_float_ftz{linkage,
|
||||
false,
|
||||
"shader_float_ftz",
|
||||
Category::RendererExtensions,
|
||||
Specialization::Default,
|
||||
true,
|
||||
false,
|
||||
&shader_float_controls_force_enable};
|
||||
|
||||
SwitchableSetting<bool> shader_float_denorm_preserve{linkage,
|
||||
false,
|
||||
"shader_float_denorm_preserve",
|
||||
Category::RendererExtensions,
|
||||
Specialization::Default,
|
||||
true,
|
||||
false,
|
||||
&shader_float_controls_force_enable};
|
||||
|
||||
SwitchableSetting<bool> shader_float_rte{linkage,
|
||||
false,
|
||||
"shader_float_rte",
|
||||
Category::RendererExtensions,
|
||||
Specialization::Default,
|
||||
true,
|
||||
false,
|
||||
&shader_float_controls_force_enable};
|
||||
|
||||
SwitchableSetting<bool> shader_float_signed_zero_inf_nan{linkage,
|
||||
false,
|
||||
"shader_float_signed_zero_inf_nan",
|
||||
Category::RendererExtensions,
|
||||
Specialization::Default,
|
||||
true,
|
||||
false,
|
||||
&shader_float_controls_force_enable};
|
||||
#endif
|
||||
|
||||
Setting<bool> renderer_debug{linkage, false, "debug", Category::RendererDebug};
|
||||
Setting<bool> renderer_shader_feedback{linkage, false, "shader_feedback",
|
||||
Category::RendererDebug};
|
||||
|
||||
@@ -158,17 +158,6 @@ ENUM(ExtendedDynamicState, Disabled, EDS1, EDS2, EDS3);
|
||||
ENUM(GpuLogLevel, Off, Errors, Standard, Verbose, All)
|
||||
ENUM(GameListMode, TreeView, GridView);
|
||||
ENUM(SpeedMode, Standard, Turbo, Slow);
|
||||
ENUM(FormatReinterpretation, Disabled, R32UintToR32Sfloat, R32SintToR32Uint, R32SfloatToR32Sint)
|
||||
|
||||
// Shader Float Controls behavior modes
|
||||
// These control how floating-point denormals and special values are handled in shaders
|
||||
ENUM(ShaderFloatBehavior,
|
||||
DriverDefault, // Let driver choose (safest, may not match Switch behavior)
|
||||
SwitchNative, // Emulate Switch/Maxwell behavior (FTZ + RTE + SignedZero)
|
||||
FlushToZero, // FTZ only - flush denorms to zero (fastest, some precision loss)
|
||||
PreserveDenorms, // Preserve denorms (slowest, highest precision)
|
||||
RoundToEven, // RTE rounding mode (IEEE 754 compliant)
|
||||
SignedZeroInfNan); // Preserve signed zero, inf, nan (accuracy for edge cases)
|
||||
|
||||
template <typename Type>
|
||||
inline std::string_view CanonicalizeEnum(Type id) {
|
||||
|
||||
@@ -396,24 +396,6 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size,
|
||||
const bool is_buffer_b{BufferDescriptorB().size() > buffer_index &&
|
||||
BufferDescriptorB()[buffer_index].Size()};
|
||||
const std::size_t buffer_size{GetWriteBufferSize(buffer_index)};
|
||||
|
||||
// Defensive check: if client didn't provide output buffer, log detailed error but don't crash
|
||||
if (buffer_size == 0) {
|
||||
LOG_ERROR(Core,
|
||||
"WriteBuffer called but client provided NO output buffer! "
|
||||
"Requested size: 0x{:X}, buffer_index: {}, is_buffer_b: {}, "
|
||||
"BufferB count: {}, BufferC count: {}",
|
||||
size, buffer_index, is_buffer_b, BufferDescriptorB().size(),
|
||||
BufferDescriptorC().size());
|
||||
|
||||
// Log command context for debugging
|
||||
LOG_ERROR(Core, "IPC Command: 0x{:X}, Type: {}", GetCommand(),
|
||||
static_cast<u32>(GetCommandType()));
|
||||
|
||||
// Return 0 instead of crashing - let service handle error
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (size > buffer_size) {
|
||||
LOG_CRITICAL(Core, "size ({:016X}) is greater than buffer_size ({:016X})", size,
|
||||
buffer_size);
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <fmt/format.h>
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/fs_types.h"
|
||||
@@ -26,10 +25,7 @@ std::vector<std::filesystem::path> GetModFolder(const std::string& root) {
|
||||
"romfslite"};
|
||||
|
||||
if (std::ranges::find(valid_names, name) != valid_names.end()) {
|
||||
const auto parent = entry.path().parent_path();
|
||||
if (std::ranges::find(paths, parent) == paths.end()) {
|
||||
paths.emplace_back(parent);
|
||||
}
|
||||
paths.emplace_back(entry.path().parent_path());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -80,24 +80,55 @@ std::optional<std::string> UpdateChecker::GetResponse(std::string url, std::stri
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease() {
|
||||
std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease(bool include_prereleases) {
|
||||
#ifdef YUZU_BUNDLED_OPENSSL
|
||||
const auto update_check_url = fmt::format("https://{}", Common::g_build_auto_update_api);
|
||||
#else
|
||||
const auto update_check_url = std::string{Common::g_build_auto_update_api};
|
||||
#endif
|
||||
|
||||
auto update_check_path = std::string{Common::g_build_auto_update_api_path};
|
||||
auto update_check_path = fmt::format("{}{}", std::string{Common::g_build_auto_update_api_path},
|
||||
std::string{Common::g_build_auto_update_repo});
|
||||
try {
|
||||
const auto response = UpdateChecker::GetResponse(update_check_url, update_check_path);
|
||||
if (include_prereleases) { // This can return either a prerelease or a stable release,
|
||||
// whichever is more recent.
|
||||
const auto update_check_tags_path = update_check_path + "/tags";
|
||||
const auto update_check_releases_path = update_check_path + "/releases";
|
||||
|
||||
if (!response)
|
||||
return {};
|
||||
const auto tags_response = UpdateChecker::GetResponse(update_check_url, update_check_tags_path);
|
||||
const auto releases_response = UpdateChecker::GetResponse(update_check_url, update_check_releases_path);
|
||||
|
||||
const std::string latest_tag = nlohmann::json::parse(response.value()).at("tag_name");
|
||||
const std::string latest_name = nlohmann::json::parse(response.value()).at("name");
|
||||
if (!tags_response || !releases_response)
|
||||
return {};
|
||||
|
||||
const std::string latest_tag
|
||||
= nlohmann::json::parse(tags_response.value()).at(0).at("name");
|
||||
const std::string latest_name =
|
||||
nlohmann::json::parse(releases_response.value()).at(0).at("name");
|
||||
|
||||
const bool latest_tag_has_release = releases_response.value().find(
|
||||
fmt::format("\"{}\"", latest_tag))
|
||||
!= std::string::npos;
|
||||
|
||||
// If there is a newer tag, but that tag has no associated release, don't prompt the
|
||||
// user to update.
|
||||
if (!latest_tag_has_release)
|
||||
return {};
|
||||
|
||||
return Update{latest_tag, latest_name};
|
||||
} else { // This is a stable release, only check for other stable releases.
|
||||
update_check_path += "/releases/latest";
|
||||
const auto response = UpdateChecker::GetResponse(update_check_url, update_check_path);
|
||||
|
||||
if (!response)
|
||||
return {};
|
||||
|
||||
const std::string latest_tag = nlohmann::json::parse(response.value()).at("tag_name");
|
||||
const std::string latest_name = nlohmann::json::parse(response.value()).at("name");
|
||||
|
||||
return Update{latest_tag, latest_name};
|
||||
}
|
||||
|
||||
return Update{latest_tag, latest_name};
|
||||
} catch (nlohmann::detail::out_of_range&) {
|
||||
LOG_ERROR(Frontend,
|
||||
"Parsing JSON response from {}{} failed during update check: "
|
||||
@@ -116,8 +147,12 @@ std::optional<UpdateChecker::Update> UpdateChecker::GetLatestRelease() {
|
||||
}
|
||||
|
||||
std::optional<UpdateChecker::Update> UpdateChecker::GetUpdate() {
|
||||
const bool is_prerelease = ((strstr(Common::g_build_version, "pre-alpha") != NULL) ||
|
||||
(strstr(Common::g_build_version, "alpha") != NULL) ||
|
||||
(strstr(Common::g_build_version, "beta") != NULL) ||
|
||||
(strstr(Common::g_build_version, "rc") != NULL));
|
||||
const std::optional<UpdateChecker::Update> latest_release_tag =
|
||||
UpdateChecker::GetLatestRelease();
|
||||
UpdateChecker::GetLatestRelease(is_prerelease);
|
||||
|
||||
if (!latest_release_tag)
|
||||
goto empty;
|
||||
|
||||
@@ -18,6 +18,6 @@ typedef struct {
|
||||
} Update;
|
||||
|
||||
std::optional<std::string> GetResponse(std::string url, std::string path);
|
||||
std::optional<Update> GetLatestRelease();
|
||||
std::optional<Update> GetLatestRelease(bool include_prereleases);
|
||||
std::optional<Update> GetUpdate();
|
||||
} // namespace UpdateChecker
|
||||
|
||||
@@ -162,21 +162,13 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent) {
|
||||
tr("Stretches the renderer to fit the specified aspect ratio.\nMost games only support "
|
||||
"16:9, so modifications are required to get other ratios.\nAlso controls the "
|
||||
"aspect ratio of captured screenshots."));
|
||||
INSERT(Settings,
|
||||
format_reinterpretation,
|
||||
tr("Format Reinterpretation:"),
|
||||
tr("Reinterprets certain texture formats for accuracy rendering.\nMay cause "
|
||||
"graphical issues in some games."));
|
||||
INSERT(Settings,
|
||||
force_identity_swizzle,
|
||||
tr("Force Identity Swizzle"),
|
||||
tr("Forces identity component swizzle for storage and input attachment images. "
|
||||
"Required by Vulkan spec. Disable only for debugging driver issues."));
|
||||
INSERT(Settings,
|
||||
use_disk_shader_cache,
|
||||
tr("Use persistent pipeline cache"),
|
||||
INSERT(Settings, use_disk_shader_cache, tr("Use persistent pipeline cache"),
|
||||
tr("Allows saving shaders to storage for faster loading on following game "
|
||||
"boots.\nDisabling it is only intended for debugging."));
|
||||
INSERT(Settings, optimize_spirv_output, tr("Optimize SPIRV output"),
|
||||
tr("Runs an additional optimization pass over generated SPIRV shaders.\n"
|
||||
"Will increase time required for shader compilation.\nMay slightly improve "
|
||||
"performance.\nThis feature is experimental."));
|
||||
INSERT(Settings, use_asynchronous_gpu_emulation, tr("Use asynchronous GPU emulation"),
|
||||
tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled."));
|
||||
INSERT(Settings, nvdec_emulation, tr("NVDEC emulation:"),
|
||||
@@ -692,13 +684,6 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent) {
|
||||
PAIR(GameListMode, TreeView, tr("Tree View")),
|
||||
PAIR(GameListMode, GridView, tr("Grid View")),
|
||||
}});
|
||||
translations->insert({Settings::EnumMetadata<Settings::FormatReinterpretation>::Index(),
|
||||
{
|
||||
PAIR(FormatReinterpretation, Disabled, tr("Disabled")),
|
||||
PAIR(FormatReinterpretation, R32UintToR32Sfloat, tr("R32 Uint to R32 Float")),
|
||||
PAIR(FormatReinterpretation, R32SintToR32Uint, tr("R32 Sint to R32 Uint")),
|
||||
PAIR(FormatReinterpretation, R32SfloatToR32Sint, tr("R32 Float to R32 Sint")),
|
||||
}});
|
||||
|
||||
#undef PAIR
|
||||
#undef CTX_PAIR
|
||||
|
||||
@@ -55,17 +55,6 @@ static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map
|
||||
{Settings::ScalingFilter::Mmpx, QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "MMPX"))},
|
||||
};
|
||||
|
||||
static const std::map<Settings::FormatReinterpretation, QString> format_reinterpretation_texts_map = {
|
||||
{Settings::FormatReinterpretation::Disabled,
|
||||
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "Disabled"))},
|
||||
{Settings::FormatReinterpretation::R32UintToR32Sfloat,
|
||||
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "R32 Uint to R32 Float"))},
|
||||
{Settings::FormatReinterpretation::R32SintToR32Uint,
|
||||
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "R32 Sint to R32 Uint"))},
|
||||
{Settings::FormatReinterpretation::R32SfloatToR32Sint,
|
||||
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "R32 Float to R32 Sint"))},
|
||||
};
|
||||
|
||||
static const std::map<Settings::ConsoleMode, QString> use_docked_mode_texts_map = {
|
||||
{Settings::ConsoleMode::Docked, QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "Docked"))},
|
||||
{Settings::ConsoleMode::Handheld, QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "Handheld"))},
|
||||
|
||||
@@ -101,10 +101,8 @@ QStringList GetModFolders(const QString& root, const QString& fallbackName) {
|
||||
} else {
|
||||
// Rename the existing mod folder.
|
||||
const auto new_path = std_path.parent_path() / name.toStdString();
|
||||
if (new_path != std_path) {
|
||||
fs::remove_all(new_path);
|
||||
fs::rename(std_path, new_path);
|
||||
}
|
||||
fs::remove_all(new_path);
|
||||
fs::rename(std_path, new_path);
|
||||
std_path = new_path;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ add_library(shader_recompiler STATIC
|
||||
|
||||
)
|
||||
|
||||
target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit::sirit)
|
||||
target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit::sirit SPIRV-Tools::SPIRV-Tools)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(shader_recompiler PRIVATE
|
||||
|
||||
@@ -382,14 +382,13 @@ void EmitContext::SetupExtensions() {
|
||||
if (info.uses_int64 && profile.support_int64) {
|
||||
header += "#extension GL_ARB_gpu_shader_int64 : enable\n";
|
||||
}
|
||||
if (info.uses_int64_bit_atomics && profile.support_gl_shader_atomic_int64) {
|
||||
if (info.uses_int64_bit_atomics) {
|
||||
header += "#extension GL_NV_shader_atomic_int64 : enable\n";
|
||||
}
|
||||
if (info.uses_atomic_f32_add && profile.support_gl_shader_atomic_float) {
|
||||
if (info.uses_atomic_f32_add) {
|
||||
header += "#extension GL_NV_shader_atomic_float : enable\n";
|
||||
}
|
||||
if ((info.uses_atomic_f16x2_add || info.uses_atomic_f16x2_min || info.uses_atomic_f16x2_max) &&
|
||||
profile.support_gl_shader_atomic_fp16_vector) {
|
||||
if (info.uses_atomic_f16x2_add || info.uses_atomic_f16x2_min || info.uses_atomic_f16x2_max) {
|
||||
header += "#extension GL_NV_shader_atomic_fp16_vector : enable\n";
|
||||
}
|
||||
if (info.uses_fp16) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <spirv-tools/optimizer.hpp>
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "shader_recompiler/backend/spirv/emit_spirv.h"
|
||||
@@ -21,7 +22,15 @@ namespace Shader::Backend::SPIRV {
|
||||
namespace {
|
||||
template <class Func>
|
||||
struct FuncTraits {};
|
||||
thread_local std::unique_ptr<spvtools::Optimizer> thread_optimizer;
|
||||
|
||||
spvtools::Optimizer& GetThreadOptimizer() {
|
||||
if (!thread_optimizer) {
|
||||
thread_optimizer = std::make_unique<spvtools::Optimizer>(SPV_ENV_VULKAN_1_3);
|
||||
thread_optimizer->RegisterPerformancePasses();
|
||||
}
|
||||
return *thread_optimizer;
|
||||
}
|
||||
template <class ReturnType_, class... Args>
|
||||
struct FuncTraits<ReturnType_ (*)(Args...)> {
|
||||
using ReturnType = ReturnType_;
|
||||
@@ -332,35 +341,19 @@ void DefineEntryPoint(const IR::Program& program, EmitContext& ctx, Id main) {
|
||||
void SetupDenormControl(const Profile& profile, const IR::Program& program, EmitContext& ctx,
|
||||
Id main_func) {
|
||||
const Info& info{program.info};
|
||||
|
||||
// User-forced behavior overrides (Android Eden Veil/Extensions)
|
||||
// When force flags are active, they take precedence over shader-declared behavior
|
||||
const bool force_flush = profile.force_fp32_denorm_flush;
|
||||
const bool force_preserve = profile.force_fp32_denorm_preserve;
|
||||
|
||||
if (force_flush && force_preserve) {
|
||||
LOG_WARNING(Shader_SPIRV, "Both FTZ and Preserve forced simultaneously - FTZ takes precedence");
|
||||
}
|
||||
|
||||
if (info.uses_fp32_denorms_flush && info.uses_fp32_denorms_preserve) {
|
||||
LOG_DEBUG(Shader_SPIRV, "Fp32 denorm flush and preserve on the same shader");
|
||||
} else if (force_flush || info.uses_fp32_denorms_flush) {
|
||||
} else if (info.uses_fp32_denorms_flush) {
|
||||
if (profile.support_fp32_denorm_flush) {
|
||||
ctx.AddCapability(spv::Capability::DenormFlushToZero);
|
||||
ctx.AddExecutionMode(main_func, spv::ExecutionMode::DenormFlushToZero, 32U);
|
||||
if (force_flush) {
|
||||
LOG_DEBUG(Shader_SPIRV, "Fp32 DenormFlushToZero FORCED by user setting");
|
||||
}
|
||||
} else {
|
||||
// Drivers will most likely flush denorms by default, no need to warn
|
||||
}
|
||||
} else if (force_preserve || info.uses_fp32_denorms_preserve) {
|
||||
} else if (info.uses_fp32_denorms_preserve) {
|
||||
if (profile.support_fp32_denorm_preserve) {
|
||||
ctx.AddCapability(spv::Capability::DenormPreserve);
|
||||
ctx.AddExecutionMode(main_func, spv::ExecutionMode::DenormPreserve, 32U);
|
||||
if (force_preserve) {
|
||||
LOG_DEBUG(Shader_SPIRV, "Fp32 DenormPreserve FORCED by user setting");
|
||||
}
|
||||
} else {
|
||||
LOG_DEBUG(Shader_SPIRV, "Fp32 denorm preserve used in shader without host support");
|
||||
}
|
||||
@@ -393,24 +386,13 @@ void SetupSignedNanCapabilities(const Profile& profile, const IR::Program& progr
|
||||
if (profile.has_broken_fp16_float_controls && program.info.uses_fp16) {
|
||||
return;
|
||||
}
|
||||
|
||||
// User-forced behavior (Android Eden Veil/Extensions)
|
||||
const bool force_signed_zero_inf_nan = profile.force_fp32_signed_zero_inf_nan;
|
||||
|
||||
if (program.info.uses_fp16 && profile.support_fp16_signed_zero_nan_preserve) {
|
||||
ctx.AddCapability(spv::Capability::SignedZeroInfNanPreserve);
|
||||
ctx.AddExecutionMode(main_func, spv::ExecutionMode::SignedZeroInfNanPreserve, 16U);
|
||||
}
|
||||
if (force_signed_zero_inf_nan || profile.support_fp32_signed_zero_nan_preserve) {
|
||||
if (profile.support_fp32_signed_zero_nan_preserve) {
|
||||
ctx.AddCapability(spv::Capability::SignedZeroInfNanPreserve);
|
||||
ctx.AddExecutionMode(main_func, spv::ExecutionMode::SignedZeroInfNanPreserve, 32U);
|
||||
if (force_signed_zero_inf_nan) {
|
||||
LOG_DEBUG(Shader_SPIRV, "Fp32 SignedZeroInfNanPreserve FORCED by user setting");
|
||||
}
|
||||
} else if (force_signed_zero_inf_nan) {
|
||||
LOG_WARNING(Shader_SPIRV, "SignedZeroInfNanPreserve forced but driver doesn't support it");
|
||||
}
|
||||
if (profile.support_fp32_signed_zero_nan_preserve) {
|
||||
ctx.AddCapability(spv::Capability::SignedZeroInfNanPreserve);
|
||||
ctx.AddExecutionMode(main_func, spv::ExecutionMode::SignedZeroInfNanPreserve, 32U);
|
||||
}
|
||||
if (program.info.uses_fp64 && profile.support_fp64_signed_zero_nan_preserve) {
|
||||
ctx.AddCapability(spv::Capability::SignedZeroInfNanPreserve);
|
||||
@@ -519,7 +501,8 @@ void PatchPhiNodes(IR::Program& program, EmitContext& ctx) {
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program, Bindings& bindings) {
|
||||
std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
||||
IR::Program& program, Bindings& bindings, bool optimize) {
|
||||
EmitContext ctx{profile, runtime_info, program, bindings};
|
||||
const Id main{DefineMain(ctx, program)};
|
||||
DefineEntryPoint(program, ctx, main);
|
||||
@@ -531,7 +514,29 @@ std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in
|
||||
SetupCapabilities(profile, program.info, ctx);
|
||||
SetupTransformFeedbackCapabilities(ctx, main);
|
||||
PatchPhiNodes(program, ctx);
|
||||
return ctx.Assemble();
|
||||
|
||||
if (!optimize) {
|
||||
return ctx.Assemble();
|
||||
} else {
|
||||
std::vector<u32> spirv = ctx.Assemble();
|
||||
|
||||
// Use thread-local optimizer instead of creating a new one
|
||||
auto& spv_opt = GetThreadOptimizer();
|
||||
spv_opt.SetMessageConsumer([](spv_message_level_t, const char*, const spv_position_t&, const char* m) {
|
||||
LOG_ERROR(HW_GPU, "spirv-opt: {}", m);
|
||||
});
|
||||
|
||||
spvtools::OptimizerOptions opt_options;
|
||||
opt_options.set_run_validator(false);
|
||||
|
||||
std::vector<u32> result;
|
||||
if (!spv_opt.Run(spirv.data(), spirv.size(), &result, opt_options)) {
|
||||
LOG_ERROR(HW_GPU,
|
||||
"Failed to optimize SPIRV shader output, continuing without optimization");
|
||||
result = std::move(spirv);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Id EmitPhi(EmitContext& ctx, IR::Inst* inst) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
@@ -33,10 +33,13 @@ constexpr u32 RESCALING_LAYOUT_WORDS_OFFSET = offsetof(RescalingLayout, rescalin
|
||||
constexpr u32 RESCALING_LAYOUT_DOWN_FACTOR_OFFSET = offsetof(RescalingLayout, down_factor);
|
||||
constexpr u32 RENDERAREA_LAYOUT_OFFSET = offsetof(RenderAreaLayout, render_area);
|
||||
|
||||
[[nodiscard]] std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program, Bindings& bindings);
|
||||
[[nodiscard]] inline std::vector<u32> EmitSPIRV(const Profile& profile, IR::Program& program) {
|
||||
[[nodiscard]] std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
||||
IR::Program& program, Bindings& bindings, bool optimize);
|
||||
|
||||
[[nodiscard]] inline std::vector<u32> EmitSPIRV(const Profile& profile, IR::Program& program,
|
||||
bool optimize) {
|
||||
Bindings binding;
|
||||
return EmitSPIRV(profile, {}, program, binding);
|
||||
return EmitSPIRV(profile, {}, program, binding, optimize);
|
||||
}
|
||||
|
||||
} // namespace Shader::Backend::SPIRV
|
||||
|
||||
@@ -332,23 +332,13 @@ void AddOffsetToCoordinates(EmitContext& ctx, const IR::TextureInstInfo& info, I
|
||||
return;
|
||||
}
|
||||
|
||||
// Mobile GPUs: 1D textures emulated as 2D with height=1
|
||||
const bool emulate_1d = ctx.profile.needs_1d_texture_emulation;
|
||||
|
||||
Id result_type{};
|
||||
switch (info.type) {
|
||||
case TextureType::Buffer:
|
||||
case TextureType::Color1D: {
|
||||
result_type = ctx.U32[1];
|
||||
break;
|
||||
case TextureType::Color1D:
|
||||
if (emulate_1d) {
|
||||
// Treat as 2D: offset needs Y component
|
||||
offset = ctx.OpCompositeConstruct(ctx.U32[2], offset, ctx.u32_zero_value);
|
||||
result_type = ctx.U32[2];
|
||||
} else {
|
||||
result_type = ctx.U32[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TextureType::ColorArray1D:
|
||||
offset = ctx.OpCompositeConstruct(ctx.U32[2], offset, ctx.u32_zero_value);
|
||||
[[fallthrough]];
|
||||
@@ -372,40 +362,6 @@ void AddOffsetToCoordinates(EmitContext& ctx, const IR::TextureInstInfo& info, I
|
||||
}
|
||||
coords = ctx.OpIAdd(result_type, coords, offset);
|
||||
}
|
||||
|
||||
// Helper: Convert 1D coordinates to 2D when emulating 1D textures on mobile GPUs
|
||||
[[nodiscard]] Id AdjustCoordinatesForEmulation(EmitContext& ctx, const IR::TextureInstInfo& info,
|
||||
Id coords) {
|
||||
if (!ctx.profile.needs_1d_texture_emulation) {
|
||||
return coords;
|
||||
}
|
||||
|
||||
switch (info.type) {
|
||||
case TextureType::Color1D: {
|
||||
// Convert scalar → vec2(x, 0.0)
|
||||
return ctx.OpCompositeConstruct(ctx.F32[2], coords, ctx.f32_zero_value);
|
||||
}
|
||||
case TextureType::ColorArray1D: {
|
||||
// Convert vec2(x, layer) → vec3(x, 0.0, layer)
|
||||
// ColorArray1D coords are always vec2 in IR
|
||||
const Id x = ctx.OpCompositeExtract(ctx.F32[1], coords, 0);
|
||||
const Id layer = ctx.OpCompositeExtract(ctx.F32[1], coords, 1);
|
||||
return ctx.OpCompositeConstruct(ctx.F32[3], x, ctx.f32_zero_value, layer);
|
||||
}
|
||||
case TextureType::Color2D:
|
||||
case TextureType::ColorArray2D:
|
||||
case TextureType::Color3D:
|
||||
case TextureType::ColorCube:
|
||||
case TextureType::ColorArrayCube:
|
||||
case TextureType::Buffer:
|
||||
case TextureType::Color2DRect:
|
||||
// No adjustment needed for non-1D textures
|
||||
return coords;
|
||||
}
|
||||
|
||||
return coords; // Unreachable, but silences -Werror=return-type
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
Id EmitBindlessImageSampleImplicitLod(EmitContext&) {
|
||||
@@ -507,7 +463,6 @@ Id EmitBoundImageWrite(EmitContext&) {
|
||||
Id EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords,
|
||||
Id bias_lc, const IR::Value& offset) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
if (ctx.stage == Stage::Fragment) {
|
||||
const ImageOperands operands(ctx, info.has_bias != 0, false, info.has_lod_clamp != 0,
|
||||
bias_lc, offset);
|
||||
@@ -529,7 +484,6 @@ Id EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value&
|
||||
Id EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords,
|
||||
Id lod, const IR::Value& offset) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const ImageOperands operands(ctx, false, true, false, lod, offset);
|
||||
|
||||
Id result = Emit(&EmitContext::OpImageSparseSampleExplicitLod,
|
||||
@@ -546,7 +500,6 @@ Id EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value&
|
||||
Id EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index,
|
||||
Id coords, Id dref, Id bias_lc, const IR::Value& offset) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
if (ctx.stage == Stage::Fragment) {
|
||||
const ImageOperands operands(ctx, info.has_bias != 0, false, info.has_lod_clamp != 0,
|
||||
bias_lc, offset);
|
||||
@@ -568,7 +521,6 @@ Id EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Va
|
||||
Id EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index,
|
||||
Id coords, Id dref, Id lod, const IR::Value& offset) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const ImageOperands operands(ctx, false, true, false, lod, offset);
|
||||
return Emit(&EmitContext::OpImageSparseSampleDrefExplicitLod,
|
||||
&EmitContext::OpImageSampleDrefExplicitLod, ctx, inst, ctx.F32[1],
|
||||
@@ -578,7 +530,6 @@ Id EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Va
|
||||
Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords,
|
||||
const IR::Value& offset, const IR::Value& offset2) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const ImageOperands operands(ctx, offset, offset2);
|
||||
if (ctx.profile.need_gather_subpixel_offset) {
|
||||
coords = ImageGatherSubpixelOffset(ctx, info, TextureImage(ctx, info, index), coords);
|
||||
@@ -591,7 +542,6 @@ Id EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id
|
||||
Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords,
|
||||
const IR::Value& offset, const IR::Value& offset2, Id dref) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const ImageOperands operands(ctx, offset, offset2);
|
||||
if (ctx.profile.need_gather_subpixel_offset) {
|
||||
coords = ImageGatherSubpixelOffset(ctx, info, TextureImage(ctx, info, index), coords);
|
||||
@@ -604,7 +554,6 @@ Id EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index,
|
||||
Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id offset,
|
||||
Id lod, Id ms) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
AddOffsetToCoordinates(ctx, info, coords, offset);
|
||||
if (info.type == TextureType::Buffer) {
|
||||
lod = Id{};
|
||||
@@ -631,20 +580,9 @@ Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& i
|
||||
return uses_lod ? ctx.OpImageQuerySizeLod(type, image, lod)
|
||||
: ctx.OpImageQuerySize(type, image);
|
||||
}};
|
||||
|
||||
// Mobile GPUs: 1D textures emulated as 2D, query returns vec2 instead of scalar
|
||||
const bool emulate_1d = ctx.profile.needs_1d_texture_emulation;
|
||||
|
||||
switch (info.type) {
|
||||
case TextureType::Color1D:
|
||||
if (emulate_1d) {
|
||||
// Query as 2D, extract only X component for 1D size
|
||||
const Id size_2d = query(ctx.U32[2]);
|
||||
const Id width = ctx.OpCompositeExtract(ctx.U32[1], size_2d, 0);
|
||||
return ctx.OpCompositeConstruct(ctx.U32[4], width, zero, zero, mips());
|
||||
} else {
|
||||
return ctx.OpCompositeConstruct(ctx.U32[4], query(ctx.U32[1]), zero, zero, mips());
|
||||
}
|
||||
return ctx.OpCompositeConstruct(ctx.U32[4], query(ctx.U32[1]), zero, zero, mips());
|
||||
case TextureType::ColorArray1D:
|
||||
case TextureType::Color2D:
|
||||
case TextureType::ColorCube:
|
||||
@@ -662,7 +600,6 @@ Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& i
|
||||
|
||||
Id EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const Id zero{ctx.f32_zero_value};
|
||||
const Id sampler{Texture(ctx, info, index)};
|
||||
return ctx.OpCompositeConstruct(ctx.F32[4], ctx.OpImageQueryLod(ctx.F32[2], sampler, coords),
|
||||
@@ -672,7 +609,6 @@ Id EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, I
|
||||
Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords,
|
||||
Id derivatives, const IR::Value& offset, Id lod_clamp) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const auto operands = info.num_derivatives == 3
|
||||
? ImageOperands(ctx, info.has_lod_clamp != 0, derivatives,
|
||||
ctx.Def(offset), {}, lod_clamp)
|
||||
@@ -685,7 +621,6 @@ Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, I
|
||||
|
||||
Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
if (info.image_format == ImageFormat::Typeless && !ctx.profile.support_typeless_image_loads) {
|
||||
LOG_WARNING(Shader_SPIRV, "Typeless image read not supported by host");
|
||||
return ctx.ConstantNull(ctx.U32[4]);
|
||||
@@ -702,7 +637,6 @@ Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id co
|
||||
|
||||
void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords, Id color) {
|
||||
const auto info{inst->Flags<IR::TextureInstInfo>()};
|
||||
coords = AdjustCoordinatesForEmulation(ctx, info, coords);
|
||||
const auto [image, is_integer] = Image(ctx, index, info);
|
||||
if (!is_integer) {
|
||||
color = ctx.OpBitcast(ctx.F32[4], color);
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
||||
@@ -33,24 +33,11 @@ Id ImageType(EmitContext& ctx, const TextureDescriptor& desc) {
|
||||
const Id type{ctx.F32[1]};
|
||||
const bool depth{desc.is_depth};
|
||||
const bool ms{desc.is_multisample};
|
||||
|
||||
// Mobile GPUs lack Sampled1D SPIR-V capability - emulate 1D as 2D with array layer
|
||||
const bool emulate_1d = ctx.profile.needs_1d_texture_emulation;
|
||||
|
||||
// Debug log for 1D emulation
|
||||
if (desc.type == TextureType::Color1D || desc.type == TextureType::ColorArray1D) {
|
||||
LOG_WARNING(Shader_SPIRV, "ImageType(texture): Creating {} texture, emulate_1d={}",
|
||||
desc.type == TextureType::Color1D ? "Color1D" : "ColorArray1D",
|
||||
emulate_1d);
|
||||
}
|
||||
|
||||
switch (desc.type) {
|
||||
case TextureType::Color1D:
|
||||
return emulate_1d ? ctx.TypeImage(type, spv::Dim::Dim2D, depth, false, false, 1, format)
|
||||
: ctx.TypeImage(type, spv::Dim::Dim1D, depth, false, false, 1, format);
|
||||
return ctx.TypeImage(type, spv::Dim::Dim1D, depth, false, false, 1, format);
|
||||
case TextureType::ColorArray1D:
|
||||
return emulate_1d ? ctx.TypeImage(type, spv::Dim::Dim2D, depth, true, false, 1, format)
|
||||
: ctx.TypeImage(type, spv::Dim::Dim1D, depth, true, false, 1, format);
|
||||
return ctx.TypeImage(type, spv::Dim::Dim1D, depth, true, false, 1, format);
|
||||
case TextureType::Color2D:
|
||||
case TextureType::Color2DRect:
|
||||
return ctx.TypeImage(type, spv::Dim::Dim2D, depth, false, ms, 1, format);
|
||||
@@ -92,22 +79,11 @@ spv::ImageFormat GetImageFormat(ImageFormat format) {
|
||||
|
||||
Id ImageType(EmitContext& ctx, const ImageDescriptor& desc, Id sampled_type) {
|
||||
const spv::ImageFormat format{GetImageFormat(desc.format)};
|
||||
const bool emulate_1d = ctx.profile.needs_1d_texture_emulation;
|
||||
|
||||
// Debug log for 1D emulation
|
||||
if (desc.type == TextureType::Color1D || desc.type == TextureType::ColorArray1D) {
|
||||
LOG_WARNING(Shader_SPIRV, "ImageType: Creating {} image, emulate_1d={}",
|
||||
desc.type == TextureType::Color1D ? "Color1D" : "ColorArray1D",
|
||||
emulate_1d);
|
||||
}
|
||||
|
||||
switch (desc.type) {
|
||||
case TextureType::Color1D:
|
||||
return emulate_1d ? ctx.TypeImage(sampled_type, spv::Dim::Dim2D, false, false, false, 2, format)
|
||||
: ctx.TypeImage(sampled_type, spv::Dim::Dim1D, false, false, false, 2, format);
|
||||
return ctx.TypeImage(sampled_type, spv::Dim::Dim1D, false, false, false, 2, format);
|
||||
case TextureType::ColorArray1D:
|
||||
return emulate_1d ? ctx.TypeImage(sampled_type, spv::Dim::Dim2D, false, true, false, 2, format)
|
||||
: ctx.TypeImage(sampled_type, spv::Dim::Dim1D, false, true, false, 2, format);
|
||||
return ctx.TypeImage(sampled_type, spv::Dim::Dim1D, false, true, false, 2, format);
|
||||
case TextureType::Color2D:
|
||||
return ctx.TypeImage(sampled_type, spv::Dim::Dim2D, false, false, false, 2, format);
|
||||
case TextureType::ColorArray2D:
|
||||
@@ -1468,8 +1444,6 @@ void EmitContext::DefineInputs(const IR::Program& program) {
|
||||
subgroup_mask_le = DefineInput(*this, U32[4], false, spv::BuiltIn::SubgroupLeMaskKHR);
|
||||
subgroup_mask_gt = DefineInput(*this, U32[4], false, spv::BuiltIn::SubgroupGtMaskKHR);
|
||||
subgroup_mask_ge = DefineInput(*this, U32[4], false, spv::BuiltIn::SubgroupGeMaskKHR);
|
||||
|
||||
// Vulkan spec: Fragment shader Input variables with integer/float type must have Flat decoration
|
||||
if (stage == Stage::Fragment) {
|
||||
Decorate(subgroup_mask_eq, spv::Decoration::Flat);
|
||||
Decorate(subgroup_mask_lt, spv::Decoration::Flat);
|
||||
|
||||
@@ -979,7 +979,7 @@ private:
|
||||
Environment& env;
|
||||
IR::AbstractSyntaxList& syntax_list;
|
||||
bool uses_demote_to_helper{};
|
||||
const Flow::Block dummy_flow_block{};
|
||||
const Flow::Block dummy_flow_block;
|
||||
};
|
||||
} // Anonymous namespace
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -296,14 +293,6 @@ std::optional<LowAddrInfo> TrackLowAddress(IR::Inst* inst) {
|
||||
}
|
||||
// This address is expected to either be a PackUint2x32, a IAdd64, or a CompositeConstructU32x2
|
||||
IR::Inst* addr_inst{addr.InstRecursive()};
|
||||
// Unwrap Identity ops introduced by lowerings (e.g., PackUint2x32 -> Identity)
|
||||
while (addr_inst->GetOpcode() == IR::Opcode::Identity) {
|
||||
const IR::Value id_arg{addr_inst->Arg(0)};
|
||||
if (id_arg.IsImmediate()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
addr_inst = id_arg.InstRecursive();
|
||||
}
|
||||
s32 imm_offset{0};
|
||||
if (addr_inst->GetOpcode() == IR::Opcode::IAdd64) {
|
||||
// If it's an IAdd64, get the immediate offset it is applying and grab the address
|
||||
@@ -319,14 +308,6 @@ std::optional<LowAddrInfo> TrackLowAddress(IR::Inst* inst) {
|
||||
return std::nullopt;
|
||||
}
|
||||
addr_inst = iadd_addr.InstRecursive();
|
||||
// Unwrap Identity again if present after folding IAdd64
|
||||
while (addr_inst->GetOpcode() == IR::Opcode::Identity) {
|
||||
const IR::Value id_arg{addr_inst->Arg(0)};
|
||||
if (id_arg.IsImmediate()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
addr_inst = id_arg.InstRecursive();
|
||||
}
|
||||
}
|
||||
// With IAdd64 handled, now PackUint2x32 is expected
|
||||
if (addr_inst->GetOpcode() == IR::Opcode::PackUint2x32) {
|
||||
@@ -336,14 +317,6 @@ std::optional<LowAddrInfo> TrackLowAddress(IR::Inst* inst) {
|
||||
return std::nullopt;
|
||||
}
|
||||
addr_inst = vector.InstRecursive();
|
||||
// Unwrap Identity that may replace PackUint2x32
|
||||
while (addr_inst->GetOpcode() == IR::Opcode::Identity) {
|
||||
const IR::Value id_arg{addr_inst->Arg(0)};
|
||||
if (id_arg.IsImmediate()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
addr_inst = id_arg.InstRecursive();
|
||||
}
|
||||
}
|
||||
// The vector is expected to be a CompositeConstructU32x2
|
||||
if (addr_inst->GetOpcode() != IR::Opcode::CompositeConstructU32x2) {
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -28,14 +25,6 @@ struct Profile {
|
||||
bool support_fp16_signed_zero_nan_preserve{};
|
||||
bool support_fp32_signed_zero_nan_preserve{};
|
||||
bool support_fp64_signed_zero_nan_preserve{};
|
||||
|
||||
// User-forced float behavior overrides (Android Eden Veil/Extensions)
|
||||
// When shader_float_controls_force_enable is true, these override shader-declared behavior
|
||||
bool force_fp32_denorm_flush{}; // Force FTZ for all FP32 ops
|
||||
bool force_fp32_denorm_preserve{}; // Force denorm preservation for all FP32 ops
|
||||
bool force_fp32_rte_rounding{}; // Force Round-To-Even for all FP32 ops
|
||||
bool force_fp32_signed_zero_inf_nan{}; // Force signed zero/inf/nan preservation
|
||||
|
||||
bool support_explicit_workgroup_layout{};
|
||||
bool support_vote{};
|
||||
bool support_viewport_index_layer_non_geometry{};
|
||||
@@ -49,9 +38,6 @@ struct Profile {
|
||||
bool support_gl_nv_gpu_shader_5{};
|
||||
bool support_gl_amd_gpu_shader_half_float{};
|
||||
bool support_gl_texture_shadow_lod{};
|
||||
bool support_gl_shader_atomic_float{};
|
||||
bool support_gl_shader_atomic_fp16_vector{};
|
||||
bool support_gl_shader_atomic_int64{};
|
||||
bool support_gl_warp_intrinsics{};
|
||||
bool support_gl_variable_aoffi{};
|
||||
bool support_gl_sparse_textures{};
|
||||
@@ -95,8 +81,6 @@ struct Profile {
|
||||
bool ignore_nan_fp_comparisons{};
|
||||
/// Some drivers have broken support for OpVectorExtractDynamic on subgroup mask inputs
|
||||
bool has_broken_spirv_subgroup_mask_vector_extract_dynamic{};
|
||||
/// Mobile GPUs lack Sampled1D capability - need to emulate 1D textures as 2D with height=1
|
||||
bool needs_1d_texture_emulation{};
|
||||
|
||||
u32 gl_max_compute_smem_size{};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ enum class TexturePixelFormat {
|
||||
ASTC_2D_8X6_SRGB,
|
||||
ASTC_2D_6X5_UNORM,
|
||||
ASTC_2D_6X5_SRGB,
|
||||
|
||||
E5B9G9R9_FLOAT,
|
||||
D32_FLOAT,
|
||||
D16_UNORM,
|
||||
X8_D24_UNORM,
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -45,7 +42,7 @@ constexpr std::array VIEW_CLASS_32_BITS{
|
||||
PixelFormat::A2B10G10R10_UNORM, PixelFormat::R16G16_UINT, PixelFormat::R32_UINT,
|
||||
PixelFormat::R16G16_SINT, PixelFormat::R32_SINT, PixelFormat::A8B8G8R8_UNORM,
|
||||
PixelFormat::R16G16_UNORM, PixelFormat::A8B8G8R8_SNORM, PixelFormat::R16G16_SNORM,
|
||||
PixelFormat::A8B8G8R8_SRGB, PixelFormat::B8G8R8A8_UNORM,
|
||||
PixelFormat::A8B8G8R8_SRGB, PixelFormat::E5B9G9R9_FLOAT, PixelFormat::B8G8R8A8_UNORM,
|
||||
PixelFormat::B8G8R8A8_SRGB, PixelFormat::A8B8G8R8_UINT, PixelFormat::A8B8G8R8_SINT,
|
||||
PixelFormat::A2B10G10R10_UINT,
|
||||
};
|
||||
@@ -55,7 +52,7 @@ constexpr std::array VIEW_CLASS_32_BITS_NO_BGR{
|
||||
PixelFormat::A2B10G10R10_UNORM, PixelFormat::R16G16_UINT, PixelFormat::R32_UINT,
|
||||
PixelFormat::R16G16_SINT, PixelFormat::R32_SINT, PixelFormat::A8B8G8R8_UNORM,
|
||||
PixelFormat::R16G16_UNORM, PixelFormat::A8B8G8R8_SNORM, PixelFormat::R16G16_SNORM,
|
||||
PixelFormat::A8B8G8R8_SRGB, PixelFormat::A8B8G8R8_UINT,
|
||||
PixelFormat::A8B8G8R8_SRGB, PixelFormat::E5B9G9R9_FLOAT, PixelFormat::A8B8G8R8_UINT,
|
||||
PixelFormat::A8B8G8R8_SINT, PixelFormat::A2B10G10R10_UINT,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#version 450
|
||||
|
||||
// VK_QCOM_render_pass_shader_resolve fragment shader
|
||||
// Resolves MSAA attachment to single-sample within render pass
|
||||
// Requires VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM in subpass flags
|
||||
|
||||
// Use combined image sampler for MSAA texture instead of input attachment
|
||||
// This allows us to sample MSAA textures from previous rendering
|
||||
layout(set = 0, binding = 0) uniform sampler2DMS msaa_texture;
|
||||
|
||||
layout(location = 0) out vec4 color_output;
|
||||
|
||||
layout(push_constant) uniform PushConstants {
|
||||
vec2 tex_scale;
|
||||
vec2 tex_offset;
|
||||
} push_constants;
|
||||
|
||||
// Custom MSAA resolve using box filter (simple average)
|
||||
// Assumes 4x MSAA (can be extended with push constant for dynamic sample count)
|
||||
void main() {
|
||||
ivec2 coord = ivec2(gl_FragCoord.xy);
|
||||
ivec2 tex_size = textureSize(msaa_texture);
|
||||
|
||||
// Clamp coordinates to texture bounds
|
||||
coord = clamp(coord, ivec2(0), tex_size - ivec2(1));
|
||||
|
||||
vec4 accumulated_color = vec4(0.0);
|
||||
int sample_count = 4; // Adreno typically uses 4x MSAA max
|
||||
|
||||
// Box filter: simple average of all MSAA samples
|
||||
for (int i = 0; i < sample_count; i++) {
|
||||
accumulated_color += texelFetch(msaa_texture, coord, i);
|
||||
}
|
||||
|
||||
color_output = accumulated_color / float(sample_count);
|
||||
}
|
||||
@@ -225,9 +225,6 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) {
|
||||
has_amd_shader_half_float = GLAD_GL_AMD_gpu_shader_half_float;
|
||||
has_sparse_texture_2 = GLAD_GL_ARB_sparse_texture2;
|
||||
has_draw_texture = GLAD_GL_NV_draw_texture;
|
||||
has_shader_atomic_float = GLAD_GL_NV_shader_atomic_float;
|
||||
has_shader_atomic_fp16_vector = GLAD_GL_NV_shader_atomic_fp16_vector;
|
||||
has_shader_atomic_int64 = GLAD_GL_NV_shader_atomic_int64;
|
||||
warp_size_potentially_larger_than_guest = !is_nvidia && !is_intel;
|
||||
need_fastmath_off = is_nvidia;
|
||||
can_report_memory = GLAD_GL_NVX_gpu_memory_info;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
@@ -151,18 +151,6 @@ public:
|
||||
return has_draw_texture;
|
||||
}
|
||||
|
||||
bool HasShaderAtomicFloat() const {
|
||||
return has_shader_atomic_float;
|
||||
}
|
||||
|
||||
bool HasShaderAtomicFp16Vector() const {
|
||||
return has_shader_atomic_fp16_vector;
|
||||
}
|
||||
|
||||
bool HasShaderAtomicInt64() const {
|
||||
return has_shader_atomic_int64;
|
||||
}
|
||||
|
||||
bool IsWarpSizePotentiallyLargerThanGuest() const {
|
||||
return warp_size_potentially_larger_than_guest;
|
||||
}
|
||||
@@ -240,9 +228,6 @@ private:
|
||||
bool has_amd_shader_half_float{};
|
||||
bool has_sparse_texture_2{};
|
||||
bool has_draw_texture{};
|
||||
bool has_shader_atomic_float{};
|
||||
bool has_shader_atomic_fp16_vector{};
|
||||
bool has_shader_atomic_int64{};
|
||||
bool warp_size_potentially_larger_than_guest{};
|
||||
bool need_fastmath_off{};
|
||||
bool has_cbuf_ftou_bug{};
|
||||
|
||||
@@ -181,6 +181,7 @@ ShaderCache::ShaderCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
|
||||
state_tracker{state_tracker_}, shader_notify{shader_notify_},
|
||||
use_asynchronous_shaders{device.UseAsynchronousShaders()},
|
||||
strict_context_required{device.StrictContextRequired()},
|
||||
optimize_spirv_output{Settings::values.optimize_spirv_output.GetValue() != Settings::SpirvOptimizeMode::Never},
|
||||
profile{
|
||||
.supported_spirv = 0x00010000,
|
||||
|
||||
@@ -214,9 +215,6 @@ ShaderCache::ShaderCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
|
||||
.support_gl_nv_gpu_shader_5 = device.HasNvGpuShader5(),
|
||||
.support_gl_amd_gpu_shader_half_float = device.HasAmdShaderHalfFloat(),
|
||||
.support_gl_texture_shadow_lod = device.HasTextureShadowLod(),
|
||||
.support_gl_shader_atomic_float = device.HasShaderAtomicFloat(),
|
||||
.support_gl_shader_atomic_fp16_vector = device.HasShaderAtomicFp16Vector(),
|
||||
.support_gl_shader_atomic_int64 = device.HasShaderAtomicInt64(),
|
||||
.support_gl_warp_intrinsics = false,
|
||||
.support_gl_variable_aoffi = device.HasVariableAoffi(),
|
||||
.support_gl_sparse_textures = device.HasSparseTexture2(),
|
||||
@@ -350,6 +348,10 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
|
||||
if (!use_asynchronous_shaders) {
|
||||
workers.reset();
|
||||
}
|
||||
|
||||
if (Settings::values.optimize_spirv_output.GetValue() != Settings::SpirvOptimizeMode::Always) {
|
||||
this->optimize_spirv_output = false;
|
||||
}
|
||||
}
|
||||
|
||||
GraphicsPipeline* ShaderCache::CurrentGraphicsPipeline() {
|
||||
@@ -535,7 +537,7 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::CreateGraphicsPipeline(
|
||||
break;
|
||||
case Settings::RendererBackend::OpenGL_SPIRV:
|
||||
ConvertLegacyToGeneric(program, runtime_info);
|
||||
sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding);
|
||||
sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding, this->optimize_spirv_output);
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
@@ -596,7 +598,7 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline(
|
||||
code = EmitGLASM(profile, info, program);
|
||||
break;
|
||||
case Settings::RendererBackend::OpenGL_SPIRV:
|
||||
code_spirv = EmitSPIRV(profile, program);
|
||||
code_spirv = EmitSPIRV(profile, program, this->optimize_spirv_output);
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
|
||||
@@ -76,6 +76,7 @@ private:
|
||||
VideoCore::ShaderNotify& shader_notify;
|
||||
const bool use_asynchronous_shaders;
|
||||
const bool strict_context_required;
|
||||
bool optimize_spirv_output{};
|
||||
|
||||
GraphicsPipelineKey graphics_key{};
|
||||
GraphicsPipeline* current_pipeline{};
|
||||
|
||||
@@ -100,10 +100,6 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CanDownloadMSAA() const noexcept {
|
||||
return true;
|
||||
}
|
||||
|
||||
void CopyImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies);
|
||||
|
||||
void CopyImageMSAA(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies);
|
||||
|
||||
@@ -195,10 +195,7 @@ struct FixedPipelineState {
|
||||
|
||||
union {
|
||||
u32 raw1;
|
||||
// EDS1 - Bit 0
|
||||
BitField<0, 1, u32> extended_dynamic_state;
|
||||
|
||||
// EDS2 - Bits 1-3
|
||||
BitField<1, 1, u32> extended_dynamic_state_2;
|
||||
BitField<2, 1, u32> extended_dynamic_state_2_logic_op;
|
||||
BitField<3, 1, u32> extended_dynamic_state_3_blend;
|
||||
@@ -212,32 +209,9 @@ struct FixedPipelineState {
|
||||
BitField<14, 1, u32> tessellation_clockwise;
|
||||
BitField<15, 5, u32> patch_control_points_minus_one;
|
||||
|
||||
// Topology and MSAA - Bits 24-31
|
||||
BitField<24, 4, Maxwell::PrimitiveTopology> topology;
|
||||
BitField<28, 4, Tegra::Texture::MsaaMode> msaa_mode;
|
||||
};
|
||||
|
||||
union {
|
||||
u32 raw1_eds3_extended;
|
||||
// EDS3 Additional Features - Bits 0-15
|
||||
BitField<0, 1, u32> extended_dynamic_state_3_depth_clamp;
|
||||
BitField<1, 1, u32> extended_dynamic_state_3_logic_op_enable;
|
||||
BitField<2, 1, u32> extended_dynamic_state_3_tessellation_domain_origin;
|
||||
BitField<3, 1, u32> extended_dynamic_state_3_polygon_mode;
|
||||
BitField<4, 1, u32> extended_dynamic_state_3_rasterization_samples;
|
||||
BitField<5, 1, u32> extended_dynamic_state_3_sample_mask;
|
||||
BitField<6, 1, u32> extended_dynamic_state_3_alpha_to_coverage_enable;
|
||||
BitField<7, 1, u32> extended_dynamic_state_3_alpha_to_one_enable;
|
||||
BitField<8, 1, u32> extended_dynamic_state_3_depth_clip_enable;
|
||||
BitField<9, 1, u32> extended_dynamic_state_3_depth_clip_negative_one_to_one;
|
||||
BitField<10, 1, u32> extended_dynamic_state_3_line_rasterization_mode;
|
||||
BitField<11, 1, u32> extended_dynamic_state_3_line_stipple_enable;
|
||||
BitField<12, 1, u32> extended_dynamic_state_3_provoking_vertex_mode;
|
||||
BitField<13, 1, u32> extended_dynamic_state_3_conservative_rasterization_mode;
|
||||
BitField<14, 1, u32> extended_dynamic_state_3_sample_locations_enable;
|
||||
BitField<15, 1, u32> extended_dynamic_state_3_rasterization_stream;
|
||||
};
|
||||
|
||||
union {
|
||||
u32 raw2;
|
||||
BitField<1, 3, u32> alpha_test_func;
|
||||
@@ -252,15 +226,12 @@ struct FixedPipelineState {
|
||||
BitField<16, 1, u32> alpha_to_one_enabled;
|
||||
BitField<17, 3, Tegra::Engines::Maxwell3D::EngineHint> app_stage;
|
||||
};
|
||||
std::array<u8, Maxwell::NumRenderTargets> color_formats;
|
||||
|
||||
u32 alpha_test_ref;
|
||||
u32 point_size;
|
||||
|
||||
std::array<u8, Maxwell::NumRenderTargets> color_formats;
|
||||
std::array<u16, Maxwell::NumViewports> viewport_swizzles;
|
||||
|
||||
u32 pad_align_u64;
|
||||
|
||||
union {
|
||||
u64 attribute_types; // Used with VK_EXT_vertex_input_dynamic_state
|
||||
u64 enabled_divisors;
|
||||
|
||||
@@ -27,13 +27,8 @@ public:
|
||||
DescriptorLayoutBuilder(const Device& device_) : device{&device_} {}
|
||||
|
||||
bool CanUsePushDescriptor() const noexcept {
|
||||
if (!device->IsKhrPushDescriptorSupported()) {
|
||||
return false;
|
||||
}
|
||||
if (num_descriptors > device->MaxPushDescriptors()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return device->IsKhrPushDescriptorSupported() &&
|
||||
num_descriptors <= device->MaxPushDescriptors();
|
||||
}
|
||||
|
||||
// TODO(crueter): utilize layout binding flags
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "common/assert.h"
|
||||
#include <ranges>
|
||||
#include "video_core/vulkan_common/vulkan.h"
|
||||
#include <vulkan/vulkan_core.h>
|
||||
#include "video_core/renderer_vulkan/present/util.h"
|
||||
|
||||
namespace Vulkan {
|
||||
|
||||
@@ -848,38 +848,13 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
|
||||
.pAttachments = cb_attachments.data(),
|
||||
.blendConstants = {}
|
||||
};
|
||||
// Base Vulkan Dynamic States - Always active (independent of EDS)
|
||||
// Granular fallback: Each state added only if device supports it (protection against broken drivers)
|
||||
static_vector<VkDynamicState, 34> dynamic_states;
|
||||
if (device.SupportsDynamicViewport()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_VIEWPORT);
|
||||
}
|
||||
if (device.SupportsDynamicScissor()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_SCISSOR);
|
||||
}
|
||||
if (device.SupportsDynamicLineWidth()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_LINE_WIDTH);
|
||||
}
|
||||
if (device.SupportsDynamicDepthBias()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_DEPTH_BIAS);
|
||||
}
|
||||
if (device.SupportsDynamicBlendConstants()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_BLEND_CONSTANTS);
|
||||
}
|
||||
if (device.SupportsDynamicDepthBounds()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_DEPTH_BOUNDS);
|
||||
}
|
||||
if (device.SupportsDynamicStencilCompareMask()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK);
|
||||
}
|
||||
if (device.SupportsDynamicStencilWriteMask()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK);
|
||||
}
|
||||
if (device.SupportsDynamicStencilReference()) {
|
||||
dynamic_states.push_back(VK_DYNAMIC_STATE_STENCIL_REFERENCE);
|
||||
}
|
||||
|
||||
// EDS1 - Extended Dynamic State
|
||||
static_vector<VkDynamicState, 34> dynamic_states{
|
||||
VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR,
|
||||
VK_DYNAMIC_STATE_DEPTH_BIAS, VK_DYNAMIC_STATE_BLEND_CONSTANTS,
|
||||
VK_DYNAMIC_STATE_DEPTH_BOUNDS, VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK,
|
||||
VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, VK_DYNAMIC_STATE_STENCIL_REFERENCE,
|
||||
VK_DYNAMIC_STATE_LINE_WIDTH,
|
||||
};
|
||||
if (key.state.extended_dynamic_state) {
|
||||
static constexpr std::array extended{
|
||||
VK_DYNAMIC_STATE_CULL_MODE_EXT,
|
||||
|
||||
@@ -369,6 +369,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
|
||||
texture_cache{texture_cache_}, shader_notify{shader_notify_},
|
||||
use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()},
|
||||
use_vulkan_pipeline_cache{Settings::values.use_vulkan_driver_pipeline_cache.GetValue()},
|
||||
optimize_spirv_output{Settings::values.optimize_spirv_output.GetValue() != Settings::SpirvOptimizeMode::Never},
|
||||
workers(device.HasBrokenParallelShaderCompiling() ? 1ULL : GetTotalPipelineWorkers(),
|
||||
"VkPipelineBuilder"),
|
||||
serialization_thread(1, "VkPipelineSerialization") {
|
||||
@@ -397,17 +398,6 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
|
||||
float_control.shaderSignedZeroInfNanPreserveFloat32 != VK_FALSE,
|
||||
.support_fp64_signed_zero_nan_preserve =
|
||||
float_control.shaderSignedZeroInfNanPreserveFloat64 != VK_FALSE,
|
||||
|
||||
// Switch/Maxwell native float behavior - ONLY for Turnip Mesa (Stock Qualcomm broken)
|
||||
// Stock Adreno drivers have broken float controls disabled in vulkan_device.cpp
|
||||
.force_fp32_denorm_flush = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY &&
|
||||
device.IsKhrShaderFloatControlsSupported(), // false on Stock, true on Turnip
|
||||
.force_fp32_denorm_preserve = false, // FTZ dominates
|
||||
.force_fp32_rte_rounding = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY &&
|
||||
device.IsKhrShaderFloatControlsSupported(), // false on Stock, true on Turnip
|
||||
.force_fp32_signed_zero_inf_nan = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY &&
|
||||
device.IsKhrShaderFloatControlsSupported(), // false on Stock, true on Turnip
|
||||
|
||||
.support_explicit_workgroup_layout = device.IsKhrWorkgroupMemoryExplicitLayoutSupported(),
|
||||
.support_vote = device.IsSubgroupFeatureSupported(VK_SUBGROUP_FEATURE_VOTE_BIT),
|
||||
.support_viewport_index_layer_non_geometry =
|
||||
@@ -438,17 +428,10 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
|
||||
.has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY,
|
||||
.has_broken_unsigned_image_offsets = false,
|
||||
.has_broken_signed_operations = false,
|
||||
.has_broken_fp16_float_controls = driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY,
|
||||
.has_broken_fp16_float_controls = driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY,
|
||||
.ignore_nan_fp_comparisons = false,
|
||||
.has_broken_spirv_subgroup_mask_vector_extract_dynamic =
|
||||
driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY,
|
||||
.needs_1d_texture_emulation =
|
||||
driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_MESA_TURNIP ||
|
||||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_BROADCOM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_IMAGINATION_PROPRIETARY,
|
||||
.has_broken_robust =
|
||||
device.IsNvidia() && device.GetNvidiaArch() <= NvidiaArchitecture::Arch_Pascal,
|
||||
.min_ssbo_alignment = device.GetStorageBufferAlignment(),
|
||||
@@ -686,6 +669,10 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading
|
||||
if (state.statistics) {
|
||||
state.statistics->Report();
|
||||
}
|
||||
|
||||
if (Settings::values.optimize_spirv_output.GetValue() != Settings::SpirvOptimizeMode::Always) {
|
||||
this->optimize_spirv_output = false;
|
||||
}
|
||||
}
|
||||
|
||||
GraphicsPipeline* PipelineCache::CurrentGraphicsPipelineSlowPath() {
|
||||
@@ -790,7 +777,7 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
|
||||
|
||||
const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage, device)};
|
||||
ConvertLegacyToGeneric(program, runtime_info);
|
||||
const std::vector<u32> code{EmitSPIRV(profile, runtime_info, program, binding)};
|
||||
const std::vector<u32> code{EmitSPIRV(profile, runtime_info, program, binding, this->optimize_spirv_output)};
|
||||
device.SaveShader(code);
|
||||
modules[stage_index] = BuildShader(device, code);
|
||||
|
||||
@@ -908,7 +895,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
|
||||
max_shared_memory / 1024);
|
||||
program.shared_memory_size = max_shared_memory;
|
||||
}
|
||||
const std::vector<u32> code{EmitSPIRV(profile, program)};
|
||||
const std::vector<u32> code{EmitSPIRV(profile, program, this->optimize_spirv_output)};
|
||||
device.SaveShader(code);
|
||||
vk::ShaderModule spv_module{BuildShader(device, code)};
|
||||
|
||||
|
||||
@@ -116,10 +116,6 @@ public:
|
||||
void LoadDiskResources(u64 title_id, std::stop_token stop_loading,
|
||||
const VideoCore::DiskResourceLoadCallback& callback);
|
||||
|
||||
[[nodiscard]] const DynamicFeatures& GetDynamicFeatures() const noexcept {
|
||||
return dynamic_features;
|
||||
}
|
||||
|
||||
private:
|
||||
[[nodiscard]] GraphicsPipeline* CurrentGraphicsPipelineSlowPath();
|
||||
|
||||
@@ -157,6 +153,7 @@ private:
|
||||
VideoCore::ShaderNotify& shader_notify;
|
||||
bool use_asynchronous_shaders{};
|
||||
bool use_vulkan_pipeline_cache{};
|
||||
bool optimize_spirv_output{};
|
||||
|
||||
GraphicsPipelineCacheKey graphics_key{};
|
||||
GraphicsPipeline* current_pipeline{};
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include <boost/container/static_vector.hpp>
|
||||
|
||||
#include "common/logging.h"
|
||||
#include "video_core/renderer_vulkan/maxwell_to_vk.h"
|
||||
#include "video_core/renderer_vulkan/vk_render_pass_cache.h"
|
||||
#include "video_core/surface.h"
|
||||
@@ -20,23 +19,6 @@ namespace {
|
||||
using VideoCore::Surface::PixelFormat;
|
||||
using VideoCore::Surface::SurfaceType;
|
||||
|
||||
// Check if the driver uses tile-based deferred rendering (TBDR) architecture
|
||||
// These GPUs benefit from optimized load/store operations to keep data on-chip
|
||||
//
|
||||
// TBDR GPUs supported in Eden:
|
||||
// - Qualcomm Adreno (Snapdragon): Most Android flagship/midrange devices
|
||||
// - ARM Mali: Android devices (Samsung Exynos, MediaTek, etc.)
|
||||
// - Imagination PowerVR: Older iOS devices, some Android tablets
|
||||
// - Samsung Xclipse: Galaxy S22+ (AMD RDNA2-based, but uses TBDR mode)
|
||||
// - Broadcom VideoCore: Raspberry Pi
|
||||
[[nodiscard]] constexpr bool IsTBDRGPU(VkDriverId driver_id) {
|
||||
return driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_IMAGINATION_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_SAMSUNG_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_BROADCOM_PROPRIETARY;
|
||||
}
|
||||
|
||||
constexpr SurfaceType GetSurfaceType(PixelFormat format) {
|
||||
switch (format) {
|
||||
// Depth formats
|
||||
@@ -62,57 +44,23 @@ using VideoCore::Surface::SurfaceType;
|
||||
}
|
||||
|
||||
VkAttachmentDescription AttachmentDescription(const Device& device, PixelFormat format,
|
||||
VkSampleCountFlagBits samples,
|
||||
bool tbdr_will_clear,
|
||||
bool tbdr_discard_after,
|
||||
bool tbdr_read_only = false) {
|
||||
VkSampleCountFlagBits samples) {
|
||||
using MaxwellToVK::SurfaceFormat;
|
||||
|
||||
const SurfaceType surface_type = GetSurfaceType(format);
|
||||
const bool has_stencil = surface_type == SurfaceType::DepthStencil ||
|
||||
surface_type == SurfaceType::Stencil;
|
||||
|
||||
// TBDR optimization: Apply hints only on tile-based GPUs
|
||||
// Desktop GPUs (NVIDIA/AMD/Intel) ignore these hints and use standard behavior
|
||||
const bool is_tbdr = IsTBDRGPU(device.GetDriverID());
|
||||
|
||||
// On TBDR: Use DONT_CARE if clear is guaranteed (avoids loading from main memory)
|
||||
// On Desktop: Always LOAD to preserve existing content (safer default)
|
||||
VkAttachmentLoadOp load_op = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||
if (is_tbdr && tbdr_will_clear) {
|
||||
load_op = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||
}
|
||||
|
||||
// On TBDR: Use DONT_CARE if content won't be read (avoids storing to main memory)
|
||||
// On Desktop: Always STORE (safer default)
|
||||
// VK_QCOM_render_pass_store_ops: Use NONE_QCOM for read-only attachments (preserves outside render area)
|
||||
VkAttachmentStoreOp store_op = VK_ATTACHMENT_STORE_OP_STORE;
|
||||
if (is_tbdr && tbdr_discard_after) {
|
||||
store_op = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||
} else if (is_tbdr && tbdr_read_only && device.IsQcomRenderPassStoreOpsSupported()) {
|
||||
store_op = static_cast<VkAttachmentStoreOp>(1000301000); // VK_ATTACHMENT_STORE_OP_NONE_QCOM
|
||||
}
|
||||
|
||||
// Stencil operations follow same logic
|
||||
VkAttachmentLoadOp stencil_load_op = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||
VkAttachmentStoreOp stencil_store_op = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||
if (has_stencil && tbdr_read_only && device.IsQcomRenderPassStoreOpsSupported()) {
|
||||
stencil_store_op = static_cast<VkAttachmentStoreOp>(1000301000); // VK_ATTACHMENT_STORE_OP_NONE_QCOM
|
||||
} else if (has_stencil) {
|
||||
stencil_load_op = (is_tbdr && tbdr_will_clear) ? VK_ATTACHMENT_LOAD_OP_DONT_CARE
|
||||
: VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||
stencil_store_op = (is_tbdr && tbdr_discard_after) ? VK_ATTACHMENT_STORE_OP_DONT_CARE
|
||||
: VK_ATTACHMENT_STORE_OP_STORE;
|
||||
}
|
||||
|
||||
return {
|
||||
.flags = {},
|
||||
.format = SurfaceFormat(device, FormatType::Optimal, true, format).format,
|
||||
.samples = samples,
|
||||
.loadOp = load_op,
|
||||
.storeOp = store_op,
|
||||
.stencilLoadOp = stencil_load_op,
|
||||
.stencilStoreOp = stencil_store_op,
|
||||
.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
|
||||
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
|
||||
.stencilLoadOp = has_stencil ? VK_ATTACHMENT_LOAD_OP_LOAD
|
||||
: VK_ATTACHMENT_LOAD_OP_DONT_CARE,
|
||||
.stencilStoreOp = has_stencil ? VK_ATTACHMENT_STORE_OP_STORE
|
||||
: VK_ATTACHMENT_STORE_OP_DONT_CARE,
|
||||
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
.finalLayout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
};
|
||||
@@ -127,13 +75,6 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) {
|
||||
if (!is_new) {
|
||||
return *pair->second;
|
||||
}
|
||||
|
||||
const bool is_tbdr = IsTBDRGPU(device->GetDriverID());
|
||||
if (is_tbdr && (key.tbdr_will_clear || key.tbdr_discard_after)) {
|
||||
LOG_DEBUG(Render_Vulkan, "Creating TBDR-optimized render pass (driver={}, clear={}, discard={})",
|
||||
static_cast<u32>(device->GetDriverID()), key.tbdr_will_clear, key.tbdr_discard_after);
|
||||
}
|
||||
|
||||
boost::container::static_vector<VkAttachmentDescription, 9> descriptions;
|
||||
std::array<VkAttachmentReference, 8> references{};
|
||||
u32 num_attachments{};
|
||||
@@ -146,8 +87,7 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) {
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
};
|
||||
if (is_valid) {
|
||||
descriptions.push_back(AttachmentDescription(*device, format, key.samples,
|
||||
key.tbdr_will_clear, key.tbdr_discard_after));
|
||||
descriptions.push_back(AttachmentDescription(*device, format, key.samples));
|
||||
num_attachments = static_cast<u32>(index + 1);
|
||||
++num_colors;
|
||||
}
|
||||
@@ -159,19 +99,10 @@ VkRenderPass RenderPassCache::Get(const RenderPassKey& key) {
|
||||
.attachment = num_colors,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
};
|
||||
descriptions.push_back(AttachmentDescription(*device, key.depth_format, key.samples,
|
||||
key.tbdr_will_clear, key.tbdr_discard_after, key.tbdr_read_only));
|
||||
descriptions.push_back(AttachmentDescription(*device, key.depth_format, key.samples));
|
||||
}
|
||||
VkSubpassDescriptionFlags subpass_flags = 0;
|
||||
if (key.qcom_shader_resolve) {
|
||||
// VK_QCOM_render_pass_shader_resolve: enables custom shader resolve in fragment shader
|
||||
// This flag allows using a programmable fragment shader for MSAA resolve instead of
|
||||
// fixed-function hardware resolve, enabling better quality and HDR format support
|
||||
subpass_flags |= 0x00000004; // VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM
|
||||
}
|
||||
|
||||
const VkSubpassDescription subpass{
|
||||
.flags = subpass_flags,
|
||||
.flags = 0,
|
||||
.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
.inputAttachmentCount = 0,
|
||||
.pInputAttachments = nullptr,
|
||||
|
||||
@@ -20,15 +20,6 @@ struct RenderPassKey {
|
||||
std::array<VideoCore::Surface::PixelFormat, 8> color_formats;
|
||||
VideoCore::Surface::PixelFormat depth_format;
|
||||
VkSampleCountFlagBits samples;
|
||||
|
||||
// TBDR optimization hints - only affect tile-based GPUs (Qualcomm, ARM, Imagination)
|
||||
// These flags indicate the expected usage pattern to optimize load/store operations
|
||||
bool tbdr_will_clear{false}; // Attachment will be cleared with vkCmdClearAttachments
|
||||
bool tbdr_discard_after{false}; // Attachment won't be read after render pass
|
||||
bool tbdr_read_only{false}; // Attachment is read-only (input attachment, depth test without writes)
|
||||
|
||||
// VK_QCOM_render_pass_shader_resolve support
|
||||
bool qcom_shader_resolve{false}; // Use shader resolve instead of fixed-function (last subpass)
|
||||
};
|
||||
|
||||
} // namespace Vulkan
|
||||
@@ -39,8 +30,6 @@ struct hash<Vulkan::RenderPassKey> {
|
||||
[[nodiscard]] size_t operator()(const Vulkan::RenderPassKey& key) const noexcept {
|
||||
size_t value = static_cast<size_t>(key.depth_format) << 48;
|
||||
value ^= static_cast<size_t>(key.samples) << 52;
|
||||
value ^= (static_cast<size_t>(key.tbdr_will_clear) << 56);
|
||||
value ^= (static_cast<size_t>(key.tbdr_discard_after) << 57);
|
||||
for (size_t i = 0; i < key.color_formats.size(); ++i) {
|
||||
value ^= static_cast<size_t>(key.color_formats[i]) << (i * 6);
|
||||
}
|
||||
|
||||
@@ -153,10 +153,6 @@ void Swapchain::Create(
|
||||
|
||||
resource_ticks.clear();
|
||||
resource_ticks.resize(image_count);
|
||||
|
||||
// Initialize incremental-present probe flags for this swapchain.
|
||||
incremental_present_usable = device.IsKhrIncrementalPresentSupported();
|
||||
incremental_present_probed = false;
|
||||
}
|
||||
|
||||
bool Swapchain::AcquireNextImage() {
|
||||
@@ -217,13 +213,7 @@ bool Swapchain::AcquireNextImage() {
|
||||
|
||||
void Swapchain::Present(VkSemaphore render_semaphore) {
|
||||
const auto present_queue{device.GetPresentQueue()};
|
||||
// If the device advertises VK_KHR_incremental_present, we attempt a one-time probe
|
||||
// on the first present to validate the driver/compositor accepts present-region info.
|
||||
VkPresentRegionsKHR present_regions{};
|
||||
VkPresentRegionKHR region{};
|
||||
VkRectLayerKHR layer{};
|
||||
|
||||
VkPresentInfoKHR present_info{
|
||||
const VkPresentInfoKHR present_info{
|
||||
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
|
||||
.pNext = nullptr,
|
||||
.waitSemaphoreCount = render_semaphore ? 1U : 0U,
|
||||
@@ -233,20 +223,6 @@ void Swapchain::Present(VkSemaphore render_semaphore) {
|
||||
.pImageIndices = &image_index,
|
||||
.pResults = nullptr,
|
||||
};
|
||||
|
||||
if (incremental_present_usable && !incremental_present_probed) {
|
||||
// Build a minimal present-region describing a single 1x1 dirty rect at (0,0).
|
||||
layer.offset = {0, 0};
|
||||
layer.extent = {1, 1};
|
||||
region.rectangleCount = 1;
|
||||
region.pRectangles = &layer;
|
||||
present_regions.sType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR;
|
||||
present_regions.pNext = nullptr;
|
||||
present_regions.swapchainCount = 1;
|
||||
present_regions.pRegions = ®ion;
|
||||
|
||||
present_info.pNext = &present_regions;
|
||||
}
|
||||
std::scoped_lock lock{scheduler.submit_mutex};
|
||||
switch (const VkResult result = present_queue.Present(present_info)) {
|
||||
case VK_SUCCESS:
|
||||
@@ -262,18 +238,8 @@ void Swapchain::Present(VkSemaphore render_semaphore) {
|
||||
break;
|
||||
default:
|
||||
LOG_CRITICAL(Render_Vulkan, "Failed to present with error {}", string_VkResult(result));
|
||||
// If the first present with incremental-present pNext failed, disable future use.
|
||||
if (incremental_present_usable && !incremental_present_probed) {
|
||||
incremental_present_usable = false;
|
||||
LOG_WARNING(Render_Vulkan, "Disabling VK_KHR_incremental_present for this swapchain due to present failure: {}", string_VkResult(result));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (incremental_present_usable && !incremental_present_probed) {
|
||||
// Mark probe as completed if we reached here (success or handled failure above).
|
||||
incremental_present_probed = true;
|
||||
LOG_INFO(Render_Vulkan, "VK_KHR_incremental_present probe completed: usable={}", incremental_present_usable);
|
||||
}
|
||||
++frame_index;
|
||||
if (frame_index >= image_count) {
|
||||
frame_index = 0;
|
||||
|
||||
@@ -147,8 +147,6 @@ private:
|
||||
|
||||
bool is_outdated{};
|
||||
bool is_suboptimal{};
|
||||
bool incremental_present_usable{};
|
||||
bool incremental_present_probed{};
|
||||
};
|
||||
|
||||
} // namespace Vulkan
|
||||
|
||||
@@ -69,20 +69,10 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] VkImageType ConvertImageType(const ImageType type, const Device& device) {
|
||||
[[nodiscard]] VkImageType ConvertImageType(const ImageType type) {
|
||||
switch (type) {
|
||||
case ImageType::e1D:
|
||||
// Mobile Vulkan (Adreno, Mali, PowerVR, IMG) lacks Sampled1D SPIR-V capability
|
||||
// Emulate as 2D texture with height=1 on mobile, use native 1D on desktop
|
||||
{
|
||||
const auto driver_id = device.GetDriverID();
|
||||
const bool is_mobile = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_MESA_TURNIP ||
|
||||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_BROADCOM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_IMAGINATION_PROPRIETARY;
|
||||
return is_mobile ? VK_IMAGE_TYPE_2D : VK_IMAGE_TYPE_1D;
|
||||
}
|
||||
return VK_IMAGE_TYPE_1D;
|
||||
case ImageType::e2D:
|
||||
case ImageType::Linear:
|
||||
return VK_IMAGE_TYPE_2D;
|
||||
@@ -154,7 +144,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = flags,
|
||||
.imageType = ConvertImageType(info.type, device),
|
||||
.imageType = ConvertImageType(info.type),
|
||||
.format = format_info.format,
|
||||
.extent{
|
||||
.width = info.size.width >> samples_x,
|
||||
@@ -173,40 +163,6 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
|
||||
};
|
||||
}
|
||||
|
||||
/// Emergency fallback: degrade MSAA to non-MSAA for HDR formats when no resolve support exists
|
||||
[[nodiscard]] ImageInfo AdjustMSAAForHDRFormats(const Device& device, ImageInfo info) {
|
||||
if (info.num_samples <= 1) {
|
||||
return info;
|
||||
}
|
||||
|
||||
const auto vk_format = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal,
|
||||
false, info.format).format;
|
||||
const bool is_hdr_format = vk_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32;
|
||||
|
||||
if (!is_hdr_format) {
|
||||
return info;
|
||||
}
|
||||
|
||||
// Qualcomm: VK_QCOM_render_pass_shader_resolve handles HDR+MSAA
|
||||
if (device.GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY) {
|
||||
if (device.IsQcomRenderPassShaderResolveSupported()) {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
// Other vendors: shaderStorageImageMultisample handles HDR+MSAA
|
||||
if (device.IsStorageImageMultisampleSupported()) {
|
||||
return info;
|
||||
}
|
||||
|
||||
// No suitable resolve method - degrade to non-MSAA
|
||||
LOG_WARNING(Render_Vulkan, "HDR format {} with MSAA not supported, degrading to 1x samples",
|
||||
vk_format);
|
||||
info.num_samples = 1;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
[[nodiscard]] vk::Image MakeImage(const Device& device, const MemoryAllocator& allocator,
|
||||
const ImageInfo& info, std::span<const VkFormat> view_formats) {
|
||||
if (info.type == ImageType::Buffer) {
|
||||
@@ -343,17 +299,10 @@ void SanitizeDepthStencilSwizzle(std::array<SwizzleSource, 4>& swizzle,
|
||||
SwizzleSource::Zero);
|
||||
}
|
||||
|
||||
[[nodiscard]] VkImageViewType ImageViewType(Shader::TextureType type, const Device& device) {
|
||||
const auto driver_id = device.GetDriverID();
|
||||
const bool is_mobile = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_MESA_TURNIP ||
|
||||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_BROADCOM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_IMAGINATION_PROPRIETARY;
|
||||
[[nodiscard]] VkImageViewType ImageViewType(Shader::TextureType type) {
|
||||
switch (type) {
|
||||
case Shader::TextureType::Color1D:
|
||||
// Emulate 1D as 2D with height=1 on mobile (no Sampled1D capability)
|
||||
return is_mobile ? VK_IMAGE_VIEW_TYPE_2D : VK_IMAGE_VIEW_TYPE_1D;
|
||||
return VK_IMAGE_VIEW_TYPE_1D;
|
||||
case Shader::TextureType::Color2D:
|
||||
case Shader::TextureType::Color2DRect:
|
||||
return VK_IMAGE_VIEW_TYPE_2D;
|
||||
@@ -362,8 +311,7 @@ void SanitizeDepthStencilSwizzle(std::array<SwizzleSource, 4>& swizzle,
|
||||
case Shader::TextureType::Color3D:
|
||||
return VK_IMAGE_VIEW_TYPE_3D;
|
||||
case Shader::TextureType::ColorArray1D:
|
||||
// Emulate 1D array as 2D array with height=1 on mobile
|
||||
return is_mobile ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_1D_ARRAY;
|
||||
return VK_IMAGE_VIEW_TYPE_1D_ARRAY;
|
||||
case Shader::TextureType::ColorArray2D:
|
||||
return VK_IMAGE_VIEW_TYPE_2D_ARRAY;
|
||||
case Shader::TextureType::ColorArrayCube:
|
||||
@@ -376,18 +324,10 @@ void SanitizeDepthStencilSwizzle(std::array<SwizzleSource, 4>& swizzle,
|
||||
return VK_IMAGE_VIEW_TYPE_2D;
|
||||
}
|
||||
|
||||
[[nodiscard]] VkImageViewType ImageViewType(VideoCommon::ImageViewType type, const Device& device) {
|
||||
const auto driver_id = device.GetDriverID();
|
||||
const bool is_mobile = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_MESA_TURNIP ||
|
||||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_BROADCOM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_IMAGINATION_PROPRIETARY;
|
||||
|
||||
[[nodiscard]] VkImageViewType ImageViewType(VideoCommon::ImageViewType type) {
|
||||
switch (type) {
|
||||
case VideoCommon::ImageViewType::e1D:
|
||||
// Emulate 1D as 2D with height=1 on mobile (no Sampled1D capability)
|
||||
return is_mobile ? VK_IMAGE_VIEW_TYPE_2D : VK_IMAGE_VIEW_TYPE_1D;
|
||||
return VK_IMAGE_VIEW_TYPE_1D;
|
||||
case VideoCommon::ImageViewType::e2D:
|
||||
case VideoCommon::ImageViewType::Rect:
|
||||
return VK_IMAGE_VIEW_TYPE_2D;
|
||||
@@ -396,8 +336,7 @@ void SanitizeDepthStencilSwizzle(std::array<SwizzleSource, 4>& swizzle,
|
||||
case VideoCommon::ImageViewType::e3D:
|
||||
return VK_IMAGE_VIEW_TYPE_3D;
|
||||
case VideoCommon::ImageViewType::e1DArray:
|
||||
// Emulate 1D array as 2D array with height=1 on mobile
|
||||
return is_mobile ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_1D_ARRAY;
|
||||
return VK_IMAGE_VIEW_TYPE_1D_ARRAY;
|
||||
case VideoCommon::ImageViewType::e2DArray:
|
||||
return VK_IMAGE_VIEW_TYPE_2D_ARRAY;
|
||||
case VideoCommon::ImageViewType::CubeArray:
|
||||
@@ -945,9 +884,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
|
||||
astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool,
|
||||
compute_pass_descriptor_queue, memory_allocator);
|
||||
}
|
||||
|
||||
// MSAA copy support via compute shader (only for non-Qualcomm with shaderStorageImageMultisample)
|
||||
// Qualcomm uses VK_QCOM_render_pass_shader_resolve (fragment shader in render pass)
|
||||
if (device.IsStorageImageMultisampleSupported()) {
|
||||
msaa_copy_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, compute_pass_descriptor_queue);
|
||||
}
|
||||
@@ -1462,6 +1398,7 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im
|
||||
case PixelFormat::ASTC_2D_8X6_SRGB:
|
||||
case PixelFormat::ASTC_2D_6X5_UNORM:
|
||||
case PixelFormat::ASTC_2D_6X5_SRGB:
|
||||
case PixelFormat::E5B9G9R9_FLOAT:
|
||||
case PixelFormat::D32_FLOAT:
|
||||
case PixelFormat::D16_UNORM:
|
||||
case PixelFormat::X8_D24_UNORM:
|
||||
@@ -1625,23 +1562,6 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src,
|
||||
void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src,
|
||||
std::span<const VideoCommon::ImageCopy> copies) {
|
||||
const bool msaa_to_non_msaa = src.info.num_samples > 1 && dst.info.num_samples == 1;
|
||||
|
||||
// Use VK_QCOM_render_pass_shader_resolve for HDR formats on Qualcomm
|
||||
// This is more efficient than compute shader (stays on-chip in TBDR)
|
||||
const bool is_hdr_format = src.info.format == PixelFormat::B10G11R11_FLOAT ||
|
||||
dst.info.format == PixelFormat::B10G11R11_FLOAT;
|
||||
const bool use_qcom_resolve = msaa_to_non_msaa &&
|
||||
device.IsQcomRenderPassShaderResolveSupported() &&
|
||||
is_hdr_format &&
|
||||
copies.size() == 1; // QCOM resolve works best with single full copy
|
||||
|
||||
if (use_qcom_resolve) {
|
||||
// Create temporary framebuffer with resolve target
|
||||
// TODO Camille: Implement QCOM shader resolve path with proper framebuffer setup
|
||||
// For now, fall through to standard path
|
||||
LOG_DEBUG(Render_Vulkan, "QCOM shader resolve opportunity detected but not yet implemented");
|
||||
}
|
||||
|
||||
if (msaa_copy_pass) {
|
||||
return msaa_copy_pass->CopyImage(dst, src, copies, msaa_to_non_msaa);
|
||||
}
|
||||
@@ -1669,20 +1589,10 @@ void TextureCacheRuntime::TickFrame() {}
|
||||
Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu_addr_,
|
||||
VAddr cpu_addr_)
|
||||
: VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), scheduler{&runtime_.scheduler},
|
||||
runtime{&runtime_} {
|
||||
// Adjust MSAA for HDR formats if driver doesn't support shaderStorageImageMultisample
|
||||
// This prevents texture corruption by degrading to non-MSAA when msaa_copy_pass would fail
|
||||
const ImageInfo adjusted_info = AdjustMSAAForHDRFormats(runtime_.device, info_);
|
||||
|
||||
// Update our stored info with adjusted values (may have num_samples=1 now)
|
||||
info = adjusted_info;
|
||||
|
||||
// Create image with adjusted info
|
||||
original_image = MakeImage(runtime_.device, runtime_.memory_allocator, adjusted_info,
|
||||
runtime->ViewFormats(adjusted_info.format));
|
||||
aspect_mask = ImageAspectMask(adjusted_info.format);
|
||||
|
||||
if (IsPixelFormatASTC(adjusted_info.format) && !runtime->device.IsOptimalAstcSupported()) {
|
||||
runtime{&runtime_}, original_image(MakeImage(runtime_.device, runtime_.memory_allocator, info,
|
||||
runtime->ViewFormats(info.format))),
|
||||
aspect_mask(ImageAspectMask(info.format)) {
|
||||
if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) {
|
||||
switch (Settings::values.accelerate_astc.GetValue()) {
|
||||
case Settings::AstcDecodeMode::Gpu:
|
||||
if (Settings::values.astc_recompression.GetValue() ==
|
||||
@@ -2236,82 +2146,29 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||
const VkImageUsageFlags requested_view_usage = ImageUsageFlags(format_info, format);
|
||||
const VkImageUsageFlags image_usage = image.UsageFlags();
|
||||
const VkImageUsageFlags clamped_view_usage = requested_view_usage & image_usage;
|
||||
VkFormat view_format = format_info.format;
|
||||
|
||||
// Format reinterpretation for games with incorrect format usage
|
||||
// Only apply to sampled images (not render targets)
|
||||
// NOTE: Storage images use separate views created via StorageView()/MakeView(),
|
||||
// so reinterpretation here only affects sampled texture reads, not storage writes
|
||||
const auto reinterpretation_mode = Settings::values.format_reinterpretation.GetValue();
|
||||
if (reinterpretation_mode != Settings::FormatReinterpretation::Disabled &&
|
||||
!info.IsRenderTarget() &&
|
||||
(ImageUsageFlags(format_info, format) & VK_IMAGE_USAGE_SAMPLED_BIT)) {
|
||||
|
||||
switch (reinterpretation_mode) {
|
||||
case Settings::FormatReinterpretation::R32UintToR32Sfloat:
|
||||
if (view_format == VK_FORMAT_R32_UINT) {
|
||||
view_format = VK_FORMAT_R32_SFLOAT;
|
||||
LOG_DEBUG(Render_Vulkan, "Reinterpreting R32_UINT -> R32_SFLOAT for sampled image");
|
||||
}
|
||||
break;
|
||||
case Settings::FormatReinterpretation::R32SintToR32Uint:
|
||||
if (view_format == VK_FORMAT_R32_SINT) {
|
||||
view_format = VK_FORMAT_R32_UINT;
|
||||
LOG_DEBUG(Render_Vulkan, "Reinterpreting R32_SINT -> R32_UINT for sampled image");
|
||||
}
|
||||
break;
|
||||
case Settings::FormatReinterpretation::R32SfloatToR32Sint:
|
||||
if (view_format == VK_FORMAT_R32_SFLOAT) {
|
||||
view_format = VK_FORMAT_R32_SINT;
|
||||
LOG_DEBUG(Render_Vulkan, "Reinterpreting R32_SFLOAT -> R32_SINT for sampled image");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Image view format {} has different usage flags than image format {}", format,
|
||||
image.info.format);
|
||||
}
|
||||
const VkImageViewUsageCreateInfo image_view_usage{
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.usage = clamped_view_usage,
|
||||
};
|
||||
|
||||
// Vulkan spec: STORAGE_IMAGE and INPUT_ATTACHMENT descriptors MUST use identity swizzle
|
||||
// Using non-identity swizzle causes validation error and undefined behavior
|
||||
// IMPORTANT: Only force identity swizzle for render targets OR input attachments.
|
||||
// For sampled textures (even if they have storage capability), use the shader-specified
|
||||
// swizzle to avoid breaking UE4 lighting and other games. The actual storage writes happen
|
||||
// through StorageView() which uses MakeView() with hardcoded identity swizzle, so that
|
||||
// path is already spec-compliant.
|
||||
const bool is_input_attachment =
|
||||
(image_view_usage.usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) != 0;
|
||||
const bool requires_identity_swizzle = Settings::values.force_identity_swizzle.GetValue() &&
|
||||
(info.IsRenderTarget() || is_input_attachment);
|
||||
|
||||
const VkImageViewCreateInfo create_info{
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||
.pNext = &image_view_usage,
|
||||
.flags = 0,
|
||||
.image = image.Handle(),
|
||||
.viewType = VkImageViewType{},
|
||||
.format = view_format,
|
||||
.format = format_info.format,
|
||||
.components{
|
||||
.r = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[0]),
|
||||
.g = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[1]),
|
||||
.b = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[2]),
|
||||
.a = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[3]),
|
||||
.r = ComponentSwizzle(swizzle[0]),
|
||||
.g = ComponentSwizzle(swizzle[1]),
|
||||
.b = ComponentSwizzle(swizzle[2]),
|
||||
.a = ComponentSwizzle(swizzle[3]),
|
||||
},
|
||||
.subresourceRange = MakeSubresourceRange(aspect_mask, info.range),
|
||||
};
|
||||
const auto create = [&](TextureType tex_type, std::optional<u32> num_layers) {
|
||||
VkImageViewCreateInfo ci{create_info};
|
||||
ci.viewType = ImageViewType(tex_type, *device);
|
||||
ci.viewType = ImageViewType(tex_type);
|
||||
if (num_layers) {
|
||||
ci.subresourceRange.layerCount = *num_layers;
|
||||
}
|
||||
@@ -2444,7 +2301,7 @@ vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.image = image_handle,
|
||||
.viewType = ImageViewType(type, *device),
|
||||
.viewType = ImageViewType(type),
|
||||
.format = vk_format,
|
||||
.components{
|
||||
.r = VK_COMPONENT_SWIZZLE_IDENTITY,
|
||||
@@ -2465,26 +2322,11 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
|
||||
has_format_undefined && runtime.device.IsCustomBorderColorsSupported();
|
||||
const auto color = tsc.BorderColor();
|
||||
|
||||
bool arbitrary_borders = true; //TODO: cam help
|
||||
|
||||
// VK_EXT_custom_border_color has two features:
|
||||
// - customBorderColors: Enables VK_BORDER_COLOR_*_CUSTOM_EXT, requires format OR customBorderColorWithoutFormat
|
||||
// - customBorderColorWithoutFormat: Allows VK_FORMAT_UNDEFINED (format-agnostic custom borders)
|
||||
//
|
||||
// Configuration logic:
|
||||
// 1. If BOTH features available: Use VK_BORDER_COLOR_FLOAT_CUSTOM_EXT + VK_FORMAT_UNDEFINED (optimal)
|
||||
// 2. If only customBorderColors: Use VK_BORDER_COLOR_FLOAT_CUSTOM_EXT + specific format (spec compliant)
|
||||
// 3. If only customBorderColorWithoutFormat: Shouldn't happen per spec, but handle as case 2
|
||||
// 4. If neither: Use standard border colors (fallback)
|
||||
const bool has_custom_colors = device.HasCustomBorderColorFeature();
|
||||
const bool has_without_format = device.HasCustomBorderColorWithoutFormatFeature();
|
||||
const bool use_custom_border = arbitrary_borders && has_custom_colors;
|
||||
|
||||
const VkSamplerCustomBorderColorCreateInfoEXT border_ci{
|
||||
.sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT,
|
||||
.pNext = nullptr,
|
||||
.customBorderColor = std::bit_cast<VkClearColorValue>(color),
|
||||
.format = has_without_format ? VK_FORMAT_UNDEFINED : VK_FORMAT_R8G8B8A8_UNORM,
|
||||
.format = VK_FORMAT_UNDEFINED,
|
||||
};
|
||||
const void* pnext = nullptr;
|
||||
if (has_custom_border_colors) {
|
||||
@@ -2613,26 +2455,6 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime,
|
||||
}
|
||||
renderpass_key.samples = samples;
|
||||
|
||||
// Enable VK_QCOM_render_pass_shader_resolve for HDR+MSAA on Qualcomm
|
||||
// This performs MSAA resolve using fragment shader IN the render pass (on-chip)
|
||||
// Benefits: ~70% bandwidth reduction, better performance on TBDR architectures
|
||||
// Requirements: pResolveAttachments configured + explicit shader execution
|
||||
if (samples > VK_SAMPLE_COUNT_1_BIT && runtime.device.IsQcomRenderPassShaderResolveSupported()) {
|
||||
// Check if any color attachment is HDR format that benefits from shader resolve
|
||||
bool has_hdr_attachment = false;
|
||||
for (size_t index = 0; index < NUM_RT && !has_hdr_attachment; ++index) {
|
||||
const auto format = renderpass_key.color_formats[index];
|
||||
// B10G11R11_FLOAT benefits most: compute shader limited, fixed-function slower
|
||||
if (format == PixelFormat::B10G11R11_FLOAT) {
|
||||
has_hdr_attachment = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_hdr_attachment) {
|
||||
renderpass_key.qcom_shader_resolve = true;
|
||||
}
|
||||
}
|
||||
|
||||
renderpass = runtime.render_pass_cache.Get(renderpass_key);
|
||||
render_area.width = (std::min)(render_area.width, width);
|
||||
render_area.height = (std::min)(render_area.height, height);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
@@ -90,10 +90,6 @@ public:
|
||||
return msaa_copy_pass.operator bool();
|
||||
}
|
||||
|
||||
bool CanDownloadMSAA() const noexcept {
|
||||
return msaa_copy_pass.operator bool();
|
||||
}
|
||||
|
||||
void AccelerateImageUpload(Image&, const StagingBufferRef&,
|
||||
std::span<const VideoCommon::SwizzleParameters>,
|
||||
u32 z_start, u32 z_count);
|
||||
|
||||
@@ -277,19 +277,7 @@ std::optional<u64> GenericEnvironment::TryFindSize() {
|
||||
Tegra::Texture::TICEntry GenericEnvironment::ReadTextureInfo(GPUVAddr tic_addr, u32 tic_limit,
|
||||
bool via_header_index, u32 raw) {
|
||||
const auto handle{Tegra::Texture::TexturePair(raw, via_header_index)};
|
||||
|
||||
// Some games (especially on updates) use invalid texture handles beyond tic_limit
|
||||
// Clamp to limit instead of asserting to prevent crashes
|
||||
if (handle.first > tic_limit) {
|
||||
LOG_WARNING(HW_GPU, "Texture handle {} exceeds TIC limit {}, clamping to limit",
|
||||
handle.first, tic_limit);
|
||||
const u32 clamped_handle = std::min(handle.first, tic_limit);
|
||||
const GPUVAddr descriptor_addr{tic_addr + clamped_handle * sizeof(Tegra::Texture::TICEntry)};
|
||||
Tegra::Texture::TICEntry entry;
|
||||
gpu_memory->ReadBlock(descriptor_addr, &entry, sizeof(entry));
|
||||
return entry;
|
||||
}
|
||||
|
||||
ASSERT(handle.first <= tic_limit);
|
||||
const GPUVAddr descriptor_addr{tic_addr + handle.first * sizeof(Tegra::Texture::TICEntry)};
|
||||
Tegra::Texture::TICEntry entry;
|
||||
gpu_memory->ReadBlock(descriptor_addr, &entry, sizeof(entry));
|
||||
|
||||
@@ -138,7 +138,7 @@ PixelFormat PixelFormatFromTextureInfo(TextureFormat format, ComponentType red,
|
||||
case Hash(TextureFormat::R32, SINT):
|
||||
return PixelFormat::R32_SINT;
|
||||
case Hash(TextureFormat::E5B9G9R9, FLOAT):
|
||||
return PixelFormat::B10G11R11_FLOAT;
|
||||
return PixelFormat::E5B9G9R9_FLOAT;
|
||||
case Hash(TextureFormat::Z32, FLOAT):
|
||||
return PixelFormat::D32_FLOAT;
|
||||
case Hash(TextureFormat::Z32, FLOAT, UINT, UINT, UINT, LINEAR):
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -208,7 +205,8 @@ struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::str
|
||||
return "ASTC_2D_6X5_UNORM";
|
||||
case PixelFormat::ASTC_2D_6X5_SRGB:
|
||||
return "ASTC_2D_6X5_SRGB";
|
||||
|
||||
case PixelFormat::E5B9G9R9_FLOAT:
|
||||
return "E5B9G9R9_FLOAT";
|
||||
case PixelFormat::D32_FLOAT:
|
||||
return "D32_FLOAT";
|
||||
case PixelFormat::D16_UNORM:
|
||||
@@ -225,9 +223,9 @@ struct fmt::formatter<VideoCore::Surface::PixelFormat> : fmt::formatter<fmt::str
|
||||
return "D32_FLOAT_S8_UINT";
|
||||
case PixelFormat::MaxDepthStencilFormat:
|
||||
case PixelFormat::Invalid:
|
||||
default:
|
||||
return "Invalid";
|
||||
}
|
||||
return "Invalid";
|
||||
}();
|
||||
return formatter<string_view>::format(name, ctx);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
@@ -131,6 +131,10 @@ bool ImageBase::IsSafeDownload() const noexcept {
|
||||
if (True(flags & ImageFlagBits::CpuModified)) {
|
||||
return false;
|
||||
}
|
||||
if (info.num_samples > 1) {
|
||||
LOG_WARNING(HW_GPU, "MSAA image downloads are not implemented");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -690,14 +690,10 @@ void TextureCache<P>::WriteMemory(DAddr cpu_addr, size_t size) {
|
||||
template <class P>
|
||||
void TextureCache<P>::DownloadMemory(DAddr cpu_addr, size_t size) {
|
||||
boost::container::small_vector<ImageId, 16> images;
|
||||
ForEachImageInRegion(cpu_addr, size, [this, &images](ImageId image_id, ImageBase& image) {
|
||||
ForEachImageInRegion(cpu_addr, size, [&images](ImageId image_id, ImageBase& image) {
|
||||
if (!image.IsSafeDownload()) {
|
||||
return;
|
||||
}
|
||||
if (!HasMsaaDownloadSupport(image.info)) {
|
||||
LOG_WARNING(HW_GPU, "MSAA image downloads are not implemented");
|
||||
return;
|
||||
}
|
||||
image.flags &= ~ImageFlagBits::GpuModified;
|
||||
images.push_back(image_id);
|
||||
});
|
||||
@@ -1075,17 +1071,6 @@ ImageId TextureCache<P>::DmaImageId(const Tegra::DMA::ImageOperand& operand, boo
|
||||
return NULL_IMAGE_ID;
|
||||
}
|
||||
auto& image = slot_images[dst_id];
|
||||
if (image.info.num_samples > 1) {
|
||||
if (is_upload) {
|
||||
if (!HasMsaaUploadSupport(image.info)) {
|
||||
return NULL_IMAGE_ID;
|
||||
}
|
||||
} else {
|
||||
if (!HasMsaaDownloadSupport(image.info)) {
|
||||
return NULL_IMAGE_ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (False(image.flags & ImageFlagBits::GpuModified)) {
|
||||
// No need to waste time on an image that's synced with guest
|
||||
return NULL_IMAGE_ID;
|
||||
@@ -1217,7 +1202,7 @@ void TextureCache<P>::RefreshContents(Image& image, ImageId image_id) {
|
||||
|
||||
TrackImage(image, image_id);
|
||||
|
||||
if (!HasMsaaUploadSupport(image.info)) {
|
||||
if (image.info.num_samples > 1 && !runtime.CanUploadMSAA()) {
|
||||
LOG_WARNING(HW_GPU, "MSAA image uploads are not implemented");
|
||||
runtime.TransitionImageLayout(image);
|
||||
return;
|
||||
@@ -1449,16 +1434,6 @@ u64 TextureCache<P>::GetScaledImageSizeBytes(const ImageBase& image) {
|
||||
return fitted_size;
|
||||
}
|
||||
|
||||
template <class P>
|
||||
bool TextureCache<P>::HasMsaaUploadSupport(const ImageInfo& info) const noexcept {
|
||||
return info.num_samples <= 1 || runtime.CanUploadMSAA();
|
||||
}
|
||||
|
||||
template <class P>
|
||||
bool TextureCache<P>::HasMsaaDownloadSupport(const ImageInfo& info) const noexcept {
|
||||
return info.num_samples <= 1 || runtime.CanDownloadMSAA();
|
||||
}
|
||||
|
||||
template <class P>
|
||||
void TextureCache<P>::QueueAsyncDecode(Image& image, ImageId image_id) {
|
||||
UNIMPLEMENTED_IF(False(image.flags & ImageFlagBits::Converted));
|
||||
@@ -1819,31 +1794,7 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
||||
for (const ImageId overlap_id : join_ignore_textures) {
|
||||
Image& overlap = slot_images[overlap_id];
|
||||
if (True(overlap.flags & ImageFlagBits::GpuModified)) {
|
||||
// Merge GPU-modified contents from the overlapping image into the newly
|
||||
// created image to preserve guest-visible data. Compute shrink/scale
|
||||
// copies and dispatch a GPU-side copy. This mirrors the behavior used
|
||||
// for overlaps handled in join_copies_to_do above.
|
||||
new_image.flags |= ImageFlagBits::GpuModified;
|
||||
const auto& resolution = Settings::values.resolution_info;
|
||||
const auto base_opt = new_image.TryFindBase(overlap.gpu_addr);
|
||||
if (base_opt) {
|
||||
const SubresourceBase base = base_opt.value();
|
||||
const u32 up_scale = can_rescale ? resolution.up_scale : 1;
|
||||
const u32 down_shift = can_rescale ? resolution.down_shift : 0;
|
||||
auto copies = MakeShrinkImageCopies(new_info, overlap.info, base, up_scale, down_shift);
|
||||
if (overlap.info.num_samples != new_image.info.num_samples) {
|
||||
runtime.CopyImageMSAA(new_image, overlap, FixSmallVectorADL(copies));
|
||||
} else {
|
||||
runtime.CopyImage(new_image, overlap, FixSmallVectorADL(copies));
|
||||
}
|
||||
new_image.modification_tick = overlap.modification_tick;
|
||||
} else {
|
||||
// If we cannot determine a base mapping, fallback to preserving the
|
||||
// overlap (avoid deleting GPU-modified data) and log the event so
|
||||
// it can be investigated, we're trying to pinpoint the issue of texture flickering.
|
||||
LOG_WARNING(HW_GPU, "Could not map overlap gpu_addr {:#x} into new image; preserving overlap", u64(overlap.gpu_addr));
|
||||
continue;
|
||||
}
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
if (True(overlap.flags & ImageFlagBits::Tracked)) {
|
||||
UntrackImage(overlap, overlap_id);
|
||||
@@ -1903,10 +1854,6 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
||||
for (const auto& copy_object : join_copies_to_do) {
|
||||
Image& overlap = slot_images[copy_object.id];
|
||||
if (copy_object.is_alias) {
|
||||
if (!HasMsaaDownloadSupport(overlap.info)) {
|
||||
LOG_WARNING(HW_GPU, "MSAA image downloads are not implemented");
|
||||
continue;
|
||||
}
|
||||
if (!overlap.IsSafeDownload()) {
|
||||
continue;
|
||||
}
|
||||
@@ -2905,13 +2852,8 @@ void TextureCache<P>::BindRenderTarget(ImageViewId* old_id, ImageViewId new_id)
|
||||
if (new_id) {
|
||||
const ImageViewBase& old_view = slot_image_views[new_id];
|
||||
if (True(old_view.flags & ImageViewFlagBits::PreemtiveDownload)) {
|
||||
const ImageBase& image = slot_images[old_view.image_id];
|
||||
if (!HasMsaaDownloadSupport(image.info)) {
|
||||
LOG_WARNING(HW_GPU, "MSAA image downloads are not implemented");
|
||||
} else {
|
||||
const PendingDownload new_download{true, 0, old_view.image_id};
|
||||
uncommitted_downloads.emplace_back(new_download);
|
||||
}
|
||||
const PendingDownload new_download{true, 0, old_view.image_id};
|
||||
uncommitted_downloads.emplace_back(new_download);
|
||||
}
|
||||
}
|
||||
*old_id = new_id;
|
||||
|
||||
@@ -439,8 +439,6 @@ private:
|
||||
bool ScaleUp(Image& image);
|
||||
bool ScaleDown(Image& image);
|
||||
u64 GetScaledImageSizeBytes(const ImageBase& image);
|
||||
[[nodiscard]] bool HasMsaaUploadSupport(const ImageInfo& info) const noexcept;
|
||||
[[nodiscard]] bool HasMsaaDownloadSupport(const ImageInfo& info) const noexcept;
|
||||
|
||||
void QueueAsyncDecode(Image& image, ImageId image_id);
|
||||
void TickAsyncDecode();
|
||||
|
||||
@@ -22,32 +22,12 @@
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#ifndef VK_KHR_MAINTENANCE_1_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_maintenance1"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_2_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_2_EXTENSION_NAME "VK_KHR_maintenance2"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_3_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_3_EXTENSION_NAME "VK_KHR_maintenance3"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_4_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_4_EXTENSION_NAME "VK_KHR_maintenance4"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_5_EXTENSION_NAME "VK_KHR_maintenance5"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_6_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_6_EXTENSION_NAME "VK_KHR_maintenance6"
|
||||
#endif
|
||||
// Define maintenance 7-8 extension names (not yet in official Vulkan headers)
|
||||
#ifndef VK_KHR_MAINTENANCE_7_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_7_EXTENSION_NAME "VK_KHR_maintenance7"
|
||||
#define VK_KHR_MAINTENANCE_7_EXTENSION_NAME "VK_KHR_maintenance7"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_8_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_8_EXTENSION_NAME "VK_KHR_maintenance8"
|
||||
#endif
|
||||
#ifndef VK_KHR_MAINTENANCE_9_EXTENSION_NAME
|
||||
# define VK_KHR_MAINTENANCE_9_EXTENSION_NAME "VK_KHR_maintenance9"
|
||||
#define VK_KHR_MAINTENANCE_8_EXTENSION_NAME "VK_KHR_maintenance8"
|
||||
#endif
|
||||
|
||||
// Sanitize macros
|
||||
|
||||
@@ -95,25 +95,6 @@ constexpr std::array VK_FORMAT_A4B4G4R4_UNORM_PACK16{
|
||||
VK_FORMAT_UNDEFINED,
|
||||
};
|
||||
|
||||
// B10G11R11_UFLOAT (R11G11B10F) - PRIMARY HDR format for Nintendo Switch
|
||||
// Nintendo Switch hardware validation: FULL support (COLOR_ATTACHMENT + STORAGE_IMAGE + BLEND)
|
||||
// Reference: vp_gpuinfo_nintendo_switch_v2_495_0_0_0 - All required feature bits present
|
||||
//
|
||||
// Fallback strategy: Degrade to LDR instead of expensive HDR emulation
|
||||
// - RGBA8 UNORM/SRGB: Universal support, 32-bit (same size as B10G11R11), acceptable quality
|
||||
// - RGB10A2: Better precision if available, still 32-bit
|
||||
// - RGBA16F: Last resort only if RGB8 variants fail (should never happen)
|
||||
constexpr std::array B10G11R11_UFLOAT_PACK32{
|
||||
#ifdef ANDROID
|
||||
VK_FORMAT_A8B8G8R8_SRGB_PACK32, // sRGB variant (for gamma-correct fallback)
|
||||
#else
|
||||
VK_FORMAT_A8B8G8R8_UNORM_PACK32, // Primary fallback: RGBA8 LDR (32-bit, universal)
|
||||
VK_FORMAT_A2B10G10R10_UNORM_PACK32, // Better precision: RGB10A2 (32-bit, common)
|
||||
#endif
|
||||
VK_FORMAT_R16G16B16A16_SFLOAT, // Emergency fallback: RGBA16F (64-bit, should never reach)
|
||||
VK_FORMAT_UNDEFINED,
|
||||
};
|
||||
|
||||
} // namespace Alternatives
|
||||
|
||||
template <typename T>
|
||||
@@ -146,9 +127,6 @@ constexpr const VkFormat* GetFormatAlternatives(VkFormat format) {
|
||||
return Alternatives::VK_FORMAT_R32G32B32_SFLOAT.data();
|
||||
case VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT:
|
||||
return Alternatives::VK_FORMAT_A4B4G4R4_UNORM_PACK16.data();
|
||||
case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
|
||||
return Alternatives::B10G11R11_UFLOAT_PACK32.data();
|
||||
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
@@ -236,6 +214,7 @@ ankerl::unordered_dense::map<VkFormat, VkFormatProperties> GetFormatProperties(v
|
||||
VK_FORMAT_D24_UNORM_S8_UINT,
|
||||
VK_FORMAT_D32_SFLOAT,
|
||||
VK_FORMAT_D32_SFLOAT_S8_UINT,
|
||||
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
|
||||
VK_FORMAT_R16G16B16A16_SFLOAT,
|
||||
VK_FORMAT_R16G16B16A16_SINT,
|
||||
VK_FORMAT_R16G16B16A16_SNORM,
|
||||
@@ -456,7 +435,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
const bool is_mvk = driver_id == VK_DRIVER_ID_MOLTENVK;
|
||||
const bool is_qualcomm = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
|
||||
const bool is_turnip = driver_id == VK_DRIVER_ID_MESA_TURNIP;
|
||||
const bool is_arm = driver_id == VK_DRIVER_ID_ARM_PROPRIETARY;
|
||||
|
||||
if (!is_suitable)
|
||||
LOG_WARNING(Render_Vulkan, "Unsuitable driver - continuing anyways");
|
||||
@@ -493,9 +471,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
is_warp_potentially_bigger = !extensions.subgroup_size_control ||
|
||||
properties.subgroup_size_control.maxSubgroupSize > GuestWarpSize;
|
||||
|
||||
//const bool is_virtual = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU;
|
||||
//const bool is_non_gpu = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_OTHER ||
|
||||
// properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU;
|
||||
is_integrated = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
|
||||
is_virtual = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU;
|
||||
is_non_gpu = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_OTHER ||
|
||||
properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU;
|
||||
|
||||
supports_d24_depth =
|
||||
IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT,
|
||||
@@ -506,62 +485,17 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
CollectPhysicalMemoryInfo();
|
||||
CollectToolingInfo();
|
||||
|
||||
// Driver-specific handling for VK_EXT_custom_border_color
|
||||
// On some Qualcomm/Turnip/ARM drivers the extension may be partially implemented.
|
||||
// Disable completely if no feature bits are reported to avoid crashes/undefined behavior.
|
||||
if (is_qualcomm || is_turnip || is_arm) {
|
||||
const bool has_any_custom_border_color =
|
||||
features.custom_border_color.customBorderColors ||
|
||||
features.custom_border_color.customBorderColorWithoutFormat;
|
||||
if (!has_any_custom_border_color) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Disabling VK_EXT_custom_border_color on '{}' — no usable features reported",
|
||||
properties.driver.driverName);
|
||||
RemoveExtensionFeature(extensions.custom_border_color, features.custom_border_color,
|
||||
VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME);
|
||||
} else {
|
||||
LOG_INFO(Render_Vulkan,
|
||||
"VK_EXT_custom_border_color enabled on '{}' (partial support detected)",
|
||||
properties.driver.driverName);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_qualcomm) {
|
||||
// Qualcomm Adreno GPUs doesn't handle scaled vertex attributes; keep emulation enabled
|
||||
must_emulate_scaled_formats = true;
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Qualcomm drivers require scaled vertex format emulation; forcing fallback");
|
||||
|
||||
// Log Qualcomm-specific optimizations
|
||||
if (extensions.render_pass_store_ops) {
|
||||
LOG_INFO(Render_Vulkan, "VK_QCOM_render_pass_store_ops: Enabled");
|
||||
}
|
||||
if (extensions.tile_properties) {
|
||||
LOG_INFO(Render_Vulkan, "VK_QCOM_tile_properties: Enabled");
|
||||
}
|
||||
if (extensions.render_pass_shader_resolve) {
|
||||
LOG_INFO(Render_Vulkan, "VK_QCOM_render_pass_shader_resolve: Enabled");
|
||||
}
|
||||
if (extensions.render_pass_transform) {
|
||||
LOG_INFO(Render_Vulkan, "VK_QCOM_render_pass_transform: Enabled");
|
||||
}
|
||||
if (extensions.rotated_copy_commands) {
|
||||
LOG_INFO(Render_Vulkan, "VK_QCOM_rotated_copy_commands: Enabled");
|
||||
}
|
||||
if (extensions.image_processing) {
|
||||
LOG_INFO(Render_Vulkan, "VK_QCOM_image_processing: Enabled");
|
||||
}
|
||||
|
||||
// Shader Float Controls: Completely broken on Stock Qualcomm
|
||||
// The extension causes rendering issues regardless of FP16/FP32 mode
|
||||
// Turnip Mesa: Works correctly, keep enabled
|
||||
if (!is_turnip) {
|
||||
LOG_WARNING(Render_Vulkan, "Disabling Shader Float Controls for Stock Qualcomm (broken implementation)");
|
||||
extensions.shader_float_controls = false; // Just a feature not an extension
|
||||
}
|
||||
|
||||
// Int64 atomics - genuinely broken, always disable
|
||||
RemoveExtensionFeature(extensions.shader_atomic_int64, features.shader_atomic_int64, VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME);
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Disabling shader float controls and 64-bit integer features on Qualcomm proprietary drivers");
|
||||
RemoveExtension(extensions.shader_float_controls, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME);
|
||||
RemoveExtensionFeature(extensions.shader_atomic_int64, features.shader_atomic_int64,
|
||||
VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME);
|
||||
features.shader_atomic_int64.shaderBufferInt64Atomics = false;
|
||||
features.shader_atomic_int64.shaderSharedInt64Atomics = false;
|
||||
features.features.shaderInt64 = false;
|
||||
@@ -761,22 +695,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
RemoveExtensionFeature(extensions.vertex_input_dynamic_state, features.vertex_input_dynamic_state, VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
// Intel iGPU/MoltenVK blacklist moved to GetSuitability() for proper ordering
|
||||
|
||||
#ifdef ANDROID
|
||||
// Stock Qualcomm and ARM Mali drivers don't report VK_FORMAT_*_SSCALED/USCALED formats
|
||||
// Turnip implements them in software, so only force emulation for stock drivers
|
||||
if ((is_qualcomm && !is_turnip) || is_arm) {
|
||||
must_emulate_scaled_formats = true;
|
||||
LOG_INFO(Render_Vulkan, "Mobile GPU detected: forcing scaled format emulation (hardware limitation)");
|
||||
} else {
|
||||
must_emulate_scaled_formats = false;
|
||||
}
|
||||
#else
|
||||
// Desktop GPUs support scaled formats natively
|
||||
must_emulate_scaled_formats = false;
|
||||
#endif
|
||||
|
||||
logical = vk::Device::Create(physical, queue_cis, ExtensionListForVulkan(loaded_extensions), first_next, dld);
|
||||
|
||||
graphics_queue = logical.GetQueue(graphics_family);
|
||||
@@ -790,12 +708,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
||||
if (extensions.memory_budget) {
|
||||
flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT;
|
||||
}
|
||||
const bool is_integrated = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
|
||||
const VmaAllocatorCreateInfo allocator_info{
|
||||
.flags = flags,
|
||||
.physicalDevice = physical,
|
||||
.device = *logical,
|
||||
.preferredLargeHeapBlockSize = (is_integrated ? 64u : 256u) * 1024u * 1024u,
|
||||
.preferredLargeHeapBlockSize = is_integrated
|
||||
? (64u * 1024u * 1024u)
|
||||
: (256u * 1024u * 1024u),
|
||||
.pAllocationCallbacks = nullptr,
|
||||
.pDeviceMemoryCallbacks = nullptr,
|
||||
.pHeapSizeLimit = nullptr,
|
||||
@@ -819,32 +738,15 @@ Device::~Device() {
|
||||
VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage,
|
||||
FormatType format_type) const {
|
||||
if (IsFormatSupported(wanted_format, wanted_usage, format_type)) {
|
||||
// Critical: Even if format is "supported", check for STORAGE + HDR + no MSAA support
|
||||
// Driver may report STORAGE_IMAGE_BIT but shaderStorageImageMultisample=false means
|
||||
// it will fail at runtime when used with MSAA (CopyImageMSAA silently fails)
|
||||
const bool requests_storage = (wanted_usage & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0;
|
||||
const bool is_hdr_format = wanted_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32;
|
||||
|
||||
// If driver doesn't support shader storage image with MSAA, and we're requesting storage
|
||||
// for an HDR format (which will likely be used with MSAA), force fallback
|
||||
if (requests_storage && is_hdr_format && !features.features.shaderStorageImageMultisample) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Format {} reports STORAGE_IMAGE_BIT but driver doesn't support "
|
||||
"shaderStorageImageMultisample. Forcing fallback for MSAA compatibility.",
|
||||
wanted_format);
|
||||
// Continue to alternatives search below
|
||||
} else {
|
||||
return wanted_format;
|
||||
}
|
||||
return wanted_format;
|
||||
}
|
||||
// The wanted format is not supported by hardware, search for alternatives
|
||||
const VkFormat* alternatives = GetFormatAlternatives(wanted_format);
|
||||
if (alternatives == nullptr) {
|
||||
LOG_ERROR(Render_Vulkan,
|
||||
"Format={} (0x{:X}) with usage={} and type={} has no defined alternatives and host "
|
||||
"hardware does not support it. Driver: {} Device: {}",
|
||||
wanted_format, static_cast<u32>(wanted_format), wanted_usage, format_type,
|
||||
GetDriverName(), properties.properties.deviceName);
|
||||
"Format={} with usage={} and type={} has no defined alternatives and host "
|
||||
"hardware does not support it",
|
||||
wanted_format, wanted_usage, format_type);
|
||||
return wanted_format;
|
||||
}
|
||||
|
||||
@@ -853,17 +755,9 @@ VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags
|
||||
if (!IsFormatSupported(alternative, wanted_usage, format_type)) {
|
||||
continue;
|
||||
}
|
||||
// Special logging for HDR formats (common across multiple engines) on problematic drivers
|
||||
if (wanted_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"B10G11R11_UFLOAT_PACK32 (R11G11B10F HDR format) not fully supported. "
|
||||
"Falling back to {} on {}",
|
||||
alternative, properties.properties.deviceName);
|
||||
} else {
|
||||
LOG_DEBUG(Render_Vulkan,
|
||||
LOG_DEBUG(Render_Vulkan,
|
||||
"Emulating format={} with alternative format={} with usage={} and type={}",
|
||||
wanted_format, alternative, wanted_usage, format_type);
|
||||
}
|
||||
return alternative;
|
||||
}
|
||||
|
||||
@@ -1226,6 +1120,8 @@ bool Device::GetSuitability(bool requires_swapchain) {
|
||||
|
||||
// VK_EXT_extended_dynamic_state2 below this will appear drivers that need workarounds.
|
||||
|
||||
// VK_EXT_extended_dynamic_state3 below this will appear drivers that need workarounds.
|
||||
|
||||
// Samsung: Broken extendedDynamicState3ColorBlendEquation
|
||||
// Disable blend equation dynamic state, force static pipeline state
|
||||
if (extensions.extended_dynamic_state3 &&
|
||||
@@ -1250,8 +1146,6 @@ bool Device::GetSuitability(bool requires_swapchain) {
|
||||
|
||||
if (u32(Settings::values.dyna_state.GetValue()) == 0) {
|
||||
LOG_INFO(Render_Vulkan, "Extended Dynamic State disabled by user setting, clearing all EDS features");
|
||||
features.custom_border_color.customBorderColors = false;
|
||||
features.custom_border_color.customBorderColorWithoutFormat = false;
|
||||
features.extended_dynamic_state.extendedDynamicState = false;
|
||||
features.extended_dynamic_state2.extendedDynamicState2 = false;
|
||||
features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false;
|
||||
@@ -1377,43 +1271,6 @@ void Device::RemoveUnsuitableExtensions() {
|
||||
features.robust_image_access,
|
||||
VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_shader_float16_int8
|
||||
const bool float16_int8_requested = extensions.shader_float16_int8;
|
||||
const bool float16_int8_usable =
|
||||
features.shader_float16_int8.shaderFloat16 || features.shader_float16_int8.shaderInt8;
|
||||
if (float16_int8_requested && !float16_int8_usable) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Disabling VK_KHR_shader_float16_int8 — no shaderFloat16/shaderInt8 features reported");
|
||||
}
|
||||
extensions.shader_float16_int8 = float16_int8_requested && float16_int8_usable;
|
||||
RemoveExtensionFeatureIfUnsuitable(float16_int8_usable, features.shader_float16_int8,
|
||||
VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_shader_atomic_float
|
||||
const bool atomic_float_requested = extensions.shader_atomic_float;
|
||||
const auto& atomic_float_features = features.shader_atomic_float;
|
||||
const bool supports_buffer_f32 = atomic_float_features.shaderBufferFloat32Atomics ||
|
||||
atomic_float_features.shaderBufferFloat32AtomicAdd;
|
||||
const bool supports_shared_f32 = atomic_float_features.shaderSharedFloat32Atomics ||
|
||||
atomic_float_features.shaderSharedFloat32AtomicAdd;
|
||||
const bool supports_image_f32 = atomic_float_features.shaderImageFloat32Atomics ||
|
||||
atomic_float_features.shaderImageFloat32AtomicAdd;
|
||||
const bool supports_sparse_f32 = atomic_float_features.sparseImageFloat32Atomics ||
|
||||
atomic_float_features.sparseImageFloat32AtomicAdd;
|
||||
const bool supports_buffer_f64 = atomic_float_features.shaderBufferFloat64Atomics ||
|
||||
atomic_float_features.shaderBufferFloat64AtomicAdd;
|
||||
const bool supports_shared_f64 = atomic_float_features.shaderSharedFloat64Atomics ||
|
||||
atomic_float_features.shaderSharedFloat64AtomicAdd;
|
||||
const bool atomic_float_usable = supports_buffer_f32 || supports_shared_f32 || supports_image_f32 ||
|
||||
supports_sparse_f32 || supports_buffer_f64 || supports_shared_f64;
|
||||
if (atomic_float_requested && !atomic_float_usable) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Disabling VK_EXT_shader_atomic_float — no usable atomic float feature bits reported");
|
||||
}
|
||||
extensions.shader_atomic_float = atomic_float_requested && atomic_float_usable;
|
||||
RemoveExtensionFeatureIfUnsuitable(atomic_float_usable, features.shader_atomic_float,
|
||||
VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_shader_atomic_int64
|
||||
extensions.shader_atomic_int64 = features.shader_atomic_int64.shaderBufferInt64Atomics &&
|
||||
features.shader_atomic_int64.shaderSharedInt64Atomics;
|
||||
@@ -1443,34 +1300,12 @@ void Device::RemoveUnsuitableExtensions() {
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.transform_feedback, features.transform_feedback,
|
||||
VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_robustness2
|
||||
extensions.robustness_2 =
|
||||
features.robustness2.robustBufferAccess2 && features.robustness2.robustImageAccess2;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.robustness_2, features.robustness2,
|
||||
VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_image_robustness
|
||||
extensions.image_robustness = features.image_robustness.robustImageAccess;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.image_robustness, features.image_robustness,
|
||||
VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_swapchain_maintenance1
|
||||
extensions.swapchain_maintenance1 = loaded_extensions.contains(VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME);
|
||||
RemoveExtensionIfUnsuitable(extensions.swapchain_maintenance1, VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_vertex_input_dynamic_state
|
||||
if (Settings::values.vertex_input_dynamic_state.GetValue()) {
|
||||
extensions.vertex_input_dynamic_state =
|
||||
features.vertex_input_dynamic_state.vertexInputDynamicState;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.vertex_input_dynamic_state,
|
||||
features.vertex_input_dynamic_state,
|
||||
VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
|
||||
} else {
|
||||
RemoveExtensionFeature(extensions.vertex_input_dynamic_state,
|
||||
features.vertex_input_dynamic_state,
|
||||
VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
|
||||
LOG_INFO(Render_Vulkan, "Vertex Input Dynamic State disabled by user setting");
|
||||
}
|
||||
extensions.vertex_input_dynamic_state =
|
||||
features.vertex_input_dynamic_state.vertexInputDynamicState;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.vertex_input_dynamic_state,
|
||||
features.vertex_input_dynamic_state,
|
||||
VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_pipeline_executable_properties
|
||||
if (Settings::values.renderer_shader_feedback.GetValue()) {
|
||||
@@ -1496,6 +1331,18 @@ void Device::RemoveUnsuitableExtensions() {
|
||||
features.workgroup_memory_explicit_layout,
|
||||
VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_maintenance1
|
||||
extensions.maintenance1 = loaded_extensions.contains(VK_KHR_MAINTENANCE_1_EXTENSION_NAME);
|
||||
RemoveExtensionIfUnsuitable(extensions.maintenance1, VK_KHR_MAINTENANCE_1_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_maintenance2
|
||||
extensions.maintenance2 = loaded_extensions.contains(VK_KHR_MAINTENANCE_2_EXTENSION_NAME);
|
||||
RemoveExtensionIfUnsuitable(extensions.maintenance2, VK_KHR_MAINTENANCE_2_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_maintenance3
|
||||
extensions.maintenance3 = loaded_extensions.contains(VK_KHR_MAINTENANCE_3_EXTENSION_NAME);
|
||||
RemoveExtensionIfUnsuitable(extensions.maintenance3, VK_KHR_MAINTENANCE_3_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_maintenance4
|
||||
extensions.maintenance4 = features.maintenance4.maintenance4;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.maintenance4, features.maintenance4,
|
||||
@@ -1510,6 +1357,14 @@ void Device::RemoveUnsuitableExtensions() {
|
||||
extensions.maintenance6 = features.maintenance6.maintenance6;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.maintenance6, features.maintenance6,
|
||||
VK_KHR_MAINTENANCE_6_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_maintenance7
|
||||
extensions.maintenance7 = loaded_extensions.contains(VK_KHR_MAINTENANCE_7_EXTENSION_NAME);
|
||||
RemoveExtensionIfUnsuitable(extensions.maintenance7, VK_KHR_MAINTENANCE_7_EXTENSION_NAME);
|
||||
|
||||
// VK_KHR_maintenance8
|
||||
extensions.maintenance8 = loaded_extensions.contains(VK_KHR_MAINTENANCE_8_EXTENSION_NAME);
|
||||
RemoveExtensionIfUnsuitable(extensions.maintenance8, VK_KHR_MAINTENANCE_8_EXTENSION_NAME);
|
||||
}
|
||||
|
||||
void Device::SetupFamilies(VkSurfaceKHR surface) {
|
||||
@@ -1570,8 +1425,8 @@ void Device::CollectPhysicalMemoryInfo() {
|
||||
// Calculate limits using memory budget
|
||||
VkPhysicalDeviceMemoryBudgetPropertiesEXT budget{};
|
||||
budget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
|
||||
const bool is_integrated = properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
|
||||
const auto mem_info = physical.GetMemoryProperties(extensions.memory_budget ? &budget : nullptr);
|
||||
const auto mem_info =
|
||||
physical.GetMemoryProperties(extensions.memory_budget ? &budget : nullptr);
|
||||
const auto& mem_properties = mem_info.memoryProperties;
|
||||
const size_t num_properties = mem_properties.memoryHeapCount;
|
||||
device_access_memory = 0;
|
||||
|
||||
@@ -54,11 +54,9 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||
FEATURE(EXT, ExtendedDynamicState, EXTENDED_DYNAMIC_STATE, extended_dynamic_state) \
|
||||
FEATURE(EXT, ExtendedDynamicState2, EXTENDED_DYNAMIC_STATE_2, extended_dynamic_state2) \
|
||||
FEATURE(EXT, ExtendedDynamicState3, EXTENDED_DYNAMIC_STATE_3, extended_dynamic_state3) \
|
||||
FEATURE(EXT, ShaderAtomicFloat, SHADER_ATOMIC_FLOAT, shader_atomic_float) \
|
||||
FEATURE(EXT, 4444Formats, 4444_FORMATS, format_a4b4g4r4) \
|
||||
FEATURE(EXT, IndexTypeUint8, INDEX_TYPE_UINT8, index_type_uint8) \
|
||||
FEATURE(EXT, LineRasterization, LINE_RASTERIZATION, line_rasterization) \
|
||||
FEATURE(EXT, ImageRobustness, IMAGE_ROBUSTNESS, image_robustness) \
|
||||
FEATURE(EXT, PrimitiveTopologyListRestart, PRIMITIVE_TOPOLOGY_LIST_RESTART, \
|
||||
primitive_topology_list_restart) \
|
||||
FEATURE(EXT, ProvokingVertex, PROVOKING_VERTEX, provoking_vertex) \
|
||||
@@ -70,9 +68,7 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||
FEATURE(KHR, PipelineExecutableProperties, PIPELINE_EXECUTABLE_PROPERTIES, \
|
||||
pipeline_executable_properties) \
|
||||
FEATURE(KHR, WorkgroupMemoryExplicitLayout, WORKGROUP_MEMORY_EXPLICIT_LAYOUT, \
|
||||
workgroup_memory_explicit_layout) \
|
||||
FEATURE(QCOM, ImageProcessing, IMAGE_PROCESSING, image_processing_qcom) \
|
||||
FEATURE(QCOM, TileProperties, TILE_PROPERTIES, tile_properties_qcom)
|
||||
workgroup_memory_explicit_layout)
|
||||
|
||||
|
||||
// Define miscellaneous extensions which may be used by the implementation here.
|
||||
@@ -94,23 +90,20 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||
EXTENSION(KHR, SHADER_FLOAT_CONTROLS, shader_float_controls) \
|
||||
EXTENSION(KHR, SPIRV_1_4, spirv_1_4) \
|
||||
EXTENSION(KHR, SWAPCHAIN, swapchain) \
|
||||
EXTENSION(KHR, INCREMENTAL_PRESENT, incremental_present) \
|
||||
EXTENSION(KHR, SWAPCHAIN_MUTABLE_FORMAT, swapchain_mutable_format) \
|
||||
EXTENSION(EXT, SWAPCHAIN_MAINTENANCE_1, swapchain_maintenance1) \
|
||||
EXTENSION(KHR, IMAGE_FORMAT_LIST, image_format_list) \
|
||||
EXTENSION(KHR, MAINTENANCE_1, maintenance1) \
|
||||
EXTENSION(KHR, MAINTENANCE_2, maintenance2) \
|
||||
EXTENSION(KHR, MAINTENANCE_3, maintenance3) \
|
||||
EXTENSION(KHR, MAINTENANCE_7, maintenance7) \
|
||||
EXTENSION(KHR, MAINTENANCE_8, maintenance8) \
|
||||
EXTENSION(NV, DEVICE_DIAGNOSTICS_CONFIG, device_diagnostics_config) \
|
||||
EXTENSION(NV, GEOMETRY_SHADER_PASSTHROUGH, geometry_shader_passthrough) \
|
||||
EXTENSION(NV, VIEWPORT_ARRAY2, viewport_array2) \
|
||||
EXTENSION(NV, VIEWPORT_SWIZZLE, viewport_swizzle) \
|
||||
EXTENSION(EXT, FILTER_CUBIC, filter_cubic) \
|
||||
EXTENSION(IMG, FILTER_CUBIC, filter_cubic_img) \
|
||||
EXTENSION(QCOM, FILTER_CUBIC_WEIGHTS, filter_cubic_weights) \
|
||||
EXTENSION(QCOM, RENDER_PASS_SHADER_RESOLVE, render_pass_shader_resolve) \
|
||||
EXTENSION(QCOM, RENDER_PASS_STORE_OPS, render_pass_store_ops) \
|
||||
EXTENSION(QCOM, RENDER_PASS_TRANSFORM, render_pass_transform) \
|
||||
EXTENSION(QCOM, ROTATED_COPY_COMMANDS, rotated_copy_commands) \
|
||||
EXTENSION(QCOM, IMAGE_PROCESSING, image_processing) \
|
||||
EXTENSION(QCOM, TILE_PROPERTIES, tile_properties)
|
||||
EXTENSION(QCOM, FILTER_CUBIC_WEIGHTS, filter_cubic_weights)
|
||||
|
||||
// Define extensions which must be supported.
|
||||
#define FOR_EACH_VK_MANDATORY_EXTENSION(EXTENSION_NAME) \
|
||||
@@ -397,12 +390,6 @@ public:
|
||||
return properties.subgroup_properties.supportedOperations & feature;
|
||||
}
|
||||
|
||||
/// Returns true if subgroup operations are supported in the specified shader stage.
|
||||
/// Mobile GPUs (Qualcomm Adreno) often only support subgroups in fragment/compute stages.
|
||||
bool IsSubgroupSupportedForStage(VkShaderStageFlagBits stage) const {
|
||||
return properties.subgroup_properties.supportedStages & stage;
|
||||
}
|
||||
|
||||
/// Returns the maximum number of push descriptors.
|
||||
u32 MaxPushDescriptors() const {
|
||||
return properties.push_descriptor.maxPushDescriptors;
|
||||
@@ -488,11 +475,6 @@ public:
|
||||
return extensions.image_format_list || instance_version >= VK_API_VERSION_1_2;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_incremental_present.
|
||||
bool IsKhrIncrementalPresentSupported() const {
|
||||
return extensions.incremental_present;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_primitive_topology_list_restart.
|
||||
bool IsTopologyListPrimitiveRestartSupported() const {
|
||||
return features.primitive_topology_list_restart.primitiveTopologyListRestart;
|
||||
@@ -587,31 +569,6 @@ public:
|
||||
return features.custom_border_color.customBorderColorWithoutFormat;
|
||||
}
|
||||
|
||||
/// Returns true if customBorderColors feature is enabled (allows VK_BORDER_COLOR_*_CUSTOM_EXT).
|
||||
bool HasCustomBorderColorFeature() const {
|
||||
return features.custom_border_color.customBorderColors;
|
||||
}
|
||||
|
||||
/// Returns true if customBorderColorWithoutFormat feature is enabled (allows VK_FORMAT_UNDEFINED).
|
||||
bool HasCustomBorderColorWithoutFormatFeature() const {
|
||||
return features.custom_border_color.customBorderColorWithoutFormat;
|
||||
}
|
||||
|
||||
/// Base Vulkan Dynamic State support checks.
|
||||
/// These provide granular control over each base dynamic state, allowing individual states
|
||||
/// to be disabled if broken driver implementations are detected at device initialization.
|
||||
/// By default all states are enabled. If a specific driver has issues with certain states,
|
||||
/// they can be disabled in vulkan_device.cpp constructor (see has_broken_compute pattern).
|
||||
bool SupportsDynamicViewport() const { return supports_dynamic_viewport; }
|
||||
bool SupportsDynamicScissor() const { return supports_dynamic_scissor; }
|
||||
bool SupportsDynamicLineWidth() const { return supports_dynamic_line_width; }
|
||||
bool SupportsDynamicDepthBias() const { return supports_dynamic_depth_bias; }
|
||||
bool SupportsDynamicBlendConstants() const { return supports_dynamic_blend_constants; }
|
||||
bool SupportsDynamicDepthBounds() const { return supports_dynamic_depth_bounds; }
|
||||
bool SupportsDynamicStencilCompareMask() const { return supports_dynamic_stencil_compare; }
|
||||
bool SupportsDynamicStencilWriteMask() const { return supports_dynamic_stencil_write; }
|
||||
bool SupportsDynamicStencilReference() const { return supports_dynamic_stencil_reference; }
|
||||
|
||||
/// Returns true if the device supports VK_EXT_extended_dynamic_state.
|
||||
bool IsExtExtendedDynamicStateSupported() const {
|
||||
return extensions.extended_dynamic_state;
|
||||
@@ -646,98 +603,6 @@ public:
|
||||
return dynamic_state3_enables;
|
||||
}
|
||||
|
||||
// EDS2 granular feature checks
|
||||
bool IsExtExtendedDynamicState2LogicOpSupported() const {
|
||||
return extensions.extended_dynamic_state2 &&
|
||||
features.extended_dynamic_state2.extendedDynamicState2LogicOp;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState2PatchControlPointsSupported() const {
|
||||
return extensions.extended_dynamic_state2 &&
|
||||
features.extended_dynamic_state2.extendedDynamicState2PatchControlPoints;
|
||||
}
|
||||
|
||||
// EDS3 granular feature checks
|
||||
bool IsExtExtendedDynamicState3DepthClampEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3DepthClampEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3LogicOpEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3LogicOpEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3TessellationDomainOriginSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3TessellationDomainOrigin;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3PolygonModeSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3PolygonMode;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3RasterizationSamplesSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3RasterizationSamples;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3SampleMaskSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3SampleMask;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3AlphaToCoverageEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3AlphaToCoverageEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3AlphaToOneEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3AlphaToOneEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3DepthClipEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3DepthClipEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3DepthClipNegativeOneToOneSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3DepthClipNegativeOneToOne;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3LineRasterizationModeSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3LineRasterizationMode;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3LineStippleEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3LineStippleEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3ProvokingVertexModeSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3ProvokingVertexMode;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3ConservativeRasterizationModeSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3ConservativeRasterizationMode;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3SampleLocationsEnableSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3SampleLocationsEnable;
|
||||
}
|
||||
|
||||
bool IsExtExtendedDynamicState3RasterizationStreamSupported() const {
|
||||
return extensions.extended_dynamic_state3 &&
|
||||
features.extended_dynamic_state3.extendedDynamicState3RasterizationStream;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_filter_cubic
|
||||
bool IsExtFilterCubicSupported() const {
|
||||
return extensions.filter_cubic;
|
||||
@@ -748,56 +613,6 @@ public:
|
||||
return extensions.filter_cubic_weights;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_render_pass_shader_resolve
|
||||
bool IsQcomRenderPassShaderResolveSupported() const {
|
||||
return extensions.render_pass_shader_resolve;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_render_pass_store_ops
|
||||
bool IsQcomRenderPassStoreOpsSupported() const {
|
||||
return extensions.render_pass_store_ops;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_tile_properties
|
||||
bool IsQcomTilePropertiesSupported() const {
|
||||
return extensions.tile_properties;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_render_pass_transform
|
||||
bool IsQcomRenderPassTransformSupported() const {
|
||||
return extensions.render_pass_transform;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_rotated_copy_commands
|
||||
bool IsQcomRotatedCopyCommandsSupported() const {
|
||||
return extensions.rotated_copy_commands;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_image_processing
|
||||
bool IsQcomImageProcessingSupported() const {
|
||||
return extensions.image_processing;
|
||||
}
|
||||
|
||||
/// Returns Qualcomm tile size (width, height, depth). Returns {0,0,0} if not queried or unsupported
|
||||
VkExtent3D GetQcomTileSize() const {
|
||||
return properties.qcom_tile_size;
|
||||
}
|
||||
|
||||
/// Returns Qualcomm tile apron size. Returns {0,0} if not queried or unsupported
|
||||
VkExtent2D GetQcomApronSize() const {
|
||||
return properties.qcom_apron_size;
|
||||
}
|
||||
|
||||
/// Returns true if MSAA copy operations are supported via compute shader (upload/download)
|
||||
/// Qualcomm uses render pass shader resolve instead, so this returns false for Qualcomm
|
||||
bool CanUploadMSAA() const {
|
||||
return IsStorageImageMultisampleSupported();
|
||||
}
|
||||
|
||||
bool CanDownloadMSAA() const {
|
||||
return CanUploadMSAA();
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_line_rasterization.
|
||||
bool IsExtLineRasterizationSupported() const {
|
||||
return extensions.line_rasterization;
|
||||
@@ -888,11 +703,6 @@ public:
|
||||
return extensions.shader_atomic_int64;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_shader_atomic_float.
|
||||
bool IsExtShaderAtomicFloatSupported() const {
|
||||
return extensions.shader_atomic_float;
|
||||
}
|
||||
|
||||
bool IsExtConditionalRendering() const {
|
||||
return extensions.conditional_rendering;
|
||||
}
|
||||
@@ -1002,6 +812,21 @@ public:
|
||||
return features2.features.multiViewport;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_maintenance1.
|
||||
bool IsKhrMaintenance1Supported() const {
|
||||
return extensions.maintenance1;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_maintenance2.
|
||||
bool IsKhrMaintenance2Supported() const {
|
||||
return extensions.maintenance2;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_maintenance3.
|
||||
bool IsKhrMaintenance3Supported() const {
|
||||
return extensions.maintenance3;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_maintenance4.
|
||||
bool IsKhrMaintenance4Supported() const {
|
||||
return extensions.maintenance4;
|
||||
@@ -1034,6 +859,16 @@ public:
|
||||
return extensions.maintenance6;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_maintenance7.
|
||||
bool IsKhrMaintenance7Supported() const {
|
||||
return extensions.maintenance7;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_KHR_maintenance8.
|
||||
bool IsKhrMaintenance8Supported() const {
|
||||
return extensions.maintenance8;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports UINT8 index buffer conversion via compute shader.
|
||||
bool SupportsUint8Indices() const {
|
||||
return features.bit8_storage.storageBuffer8BitAccess &&
|
||||
@@ -1163,8 +998,6 @@ private:
|
||||
VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5{};
|
||||
|
||||
VkPhysicalDeviceProperties properties{};
|
||||
VkExtent3D qcom_tile_size{}; // Qualcomm tile dimensions (0 if not queried)
|
||||
VkExtent2D qcom_apron_size{}; // Qualcomm tile apron size
|
||||
};
|
||||
|
||||
Extensions extensions{};
|
||||
@@ -1179,6 +1012,9 @@ private:
|
||||
bool is_blit_depth24_stencil8_supported{}; ///< Support for blitting from and to D24S8.
|
||||
bool is_blit_depth32_stencil8_supported{}; ///< Support for blitting from and to D32S8.
|
||||
bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest.
|
||||
bool is_integrated{}; ///< Is GPU an iGPU.
|
||||
bool is_virtual{}; ///< Is GPU a virtual GPU.
|
||||
bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device.
|
||||
bool has_broken_compute{}; ///< Compute shaders can cause crashes
|
||||
bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit
|
||||
bool has_broken_parallel_compiling{}; ///< Has broken parallel shader compiling.
|
||||
@@ -1199,22 +1035,6 @@ private:
|
||||
bool dynamic_state3_alpha_to_one{};
|
||||
bool supports_conditional_barriers{}; ///< Allows barriers in conditional control flow.
|
||||
size_t sampler_heap_budget{}; ///< Sampler budget for buggy drivers (0 = unlimited).
|
||||
|
||||
/// Base Vulkan Dynamic State support flags (granular fallback for broken drivers).
|
||||
/// All default to true. These can be individually disabled in vulkan_device.cpp
|
||||
/// if specific broken driver implementations are detected during initialization.
|
||||
/// This provides emergency protection against drivers that report support but crash/misbehave.
|
||||
/// Pattern: Check driver/device and set to false in vulkan_device.cpp constructor.
|
||||
bool supports_dynamic_viewport{true}; ///< VK_DYNAMIC_STATE_VIEWPORT
|
||||
bool supports_dynamic_scissor{true}; ///< VK_DYNAMIC_STATE_SCISSOR
|
||||
bool supports_dynamic_line_width{true}; ///< VK_DYNAMIC_STATE_LINE_WIDTH
|
||||
bool supports_dynamic_depth_bias{true}; ///< VK_DYNAMIC_STATE_DEPTH_BIAS
|
||||
bool supports_dynamic_blend_constants{true}; ///< VK_DYNAMIC_STATE_BLEND_CONSTANTS
|
||||
bool supports_dynamic_depth_bounds{true}; ///< VK_DYNAMIC_STATE_DEPTH_BOUNDS
|
||||
bool supports_dynamic_stencil_compare{true}; ///< VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
|
||||
bool supports_dynamic_stencil_write{true}; ///< VK_DYNAMIC_STATE_STENCIL_WRITE_MASK
|
||||
bool supports_dynamic_stencil_reference{true};///< VK_DYNAMIC_STATE_STENCIL_REFERENCE
|
||||
|
||||
u64 device_access_memory{}; ///< Total size of device local memory in bytes.
|
||||
u32 sets_per_pool{}; ///< Sets per Description Pool
|
||||
NvidiaArchitecture nvidia_arch{NvidiaArchitecture::Arch_AmpereOrNewer};
|
||||
|
||||
@@ -259,24 +259,11 @@ namespace Vulkan {
|
||||
vk::Buffer
|
||||
MemoryAllocator::CreateBuffer(const VkBufferCreateInfo &ci, MemoryUsage usage) const
|
||||
{
|
||||
// Qualcomm uses unified memory architecture - prefer DEVICE_LOCAL + HOST_VISIBLE
|
||||
// for zero-copy access without staging buffers
|
||||
const bool is_qualcomm = device.GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY;
|
||||
const bool prefer_unified = is_qualcomm && (usage == MemoryUsage::Upload ||
|
||||
usage == MemoryUsage::Download ||
|
||||
usage == MemoryUsage::Stream);
|
||||
|
||||
VkMemoryPropertyFlags preferred_flags = MemoryUsagePreferredVmaFlags(usage);
|
||||
if (prefer_unified) {
|
||||
// Request DEVICE_LOCAL + HOST_VISIBLE for zero-copy on unified memory architectures
|
||||
preferred_flags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
}
|
||||
|
||||
const VmaAllocationCreateInfo alloc_ci = {
|
||||
.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage),
|
||||
.usage = MemoryUsageVma(usage),
|
||||
.requiredFlags = 0,
|
||||
.preferredFlags = preferred_flags,
|
||||
.preferredFlags = MemoryUsagePreferredVmaFlags(usage),
|
||||
.memoryTypeBits = usage == MemoryUsage::Stream ? 0u : valid_memory_types,
|
||||
.pool = VK_NULL_HANDLE,
|
||||
.pUserData = nullptr,
|
||||
@@ -300,12 +287,6 @@ namespace Vulkan {
|
||||
property_flags
|
||||
);
|
||||
}
|
||||
if (is_qualcomm && prefer_unified) {
|
||||
const bool got_unified = (property_flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) &&
|
||||
(property_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
|
||||
LOG_DEBUG(Render_Vulkan, "Qualcomm buffer allocation: usage={}, unified={}, flags=0x{:X}",
|
||||
static_cast<u32>(usage), got_unified, property_flags);
|
||||
}
|
||||
|
||||
u8 *data = reinterpret_cast<u8 *>(alloc_info.pMappedData);
|
||||
const std::span<u8> mapped_data = data ? std::span<u8>{data, ci.size} : std::span<u8>{};
|
||||
|
||||
@@ -31,10 +31,11 @@ ModSelectDialog::ModSelectDialog(const QStringList& mods, QWidget* parent)
|
||||
}
|
||||
|
||||
ui->treeView->expandAll();
|
||||
ui->treeView->resizeColumnToContents(0);
|
||||
|
||||
int rows = item_model->rowCount();
|
||||
int height =
|
||||
4 + ui->treeView->contentsMargins().top() * 4 + ui->treeView->contentsMargins().bottom() * 4;
|
||||
ui->treeView->contentsMargins().top() * 4 + ui->treeView->contentsMargins().bottom() * 4;
|
||||
int width = 0;
|
||||
|
||||
for (int i = 0; i < rows; ++i) {
|
||||
@@ -45,7 +46,7 @@ ModSelectDialog::ModSelectDialog(const QStringList& mods, QWidget* parent)
|
||||
width +=
|
||||
ui->treeView->contentsMargins().left() * 4 + ui->treeView->contentsMargins().right() * 4;
|
||||
ui->treeView->setMinimumHeight(qMin(height, 600));
|
||||
ui->treeView->setMinimumWidth(qMax(width, 540));
|
||||
ui->treeView->setMinimumWidth(qMin(width, 700));
|
||||
adjustSize();
|
||||
|
||||
connect(this, &QDialog::accepted, this, [this]() {
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>580</width>
|
||||
<width>400</width>
|
||||
<height>430</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Import Mods</string>
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user