Compare commits

..

33 commits

Author SHA1 Message Date
Wunkolo
6b62f8ec19 renderer_gl: Add layer/level specifier to MSAA resolves 2026-06-02 15:33:37 -07:00
Wunkolo
773c086dca renderer_gl: Fix MakeHandle string-view hazard
`glObjectLabel` expects a null-terminated string, but an `std::string_view` is not necessarily null-terminated
2026-06-02 15:33:37 -07:00
Wunkolo
31c9b8d4a9 renderer_gl: Implement TextureRuntime::ClearTexture MSAA clears
When ArbClearTexture is not available, ensure the fallback implementation also clears the MSAA texture as well.
2026-06-02 15:33:37 -07:00
Wunkolo
71179b1e9c renderer_gl: Resolve framebuffer after each draw
Brute force approach while trying to determine a better heuristic. Framebuffer changes are not enough to determine the end of a "render pass". An 'msaa dirty flag' is likely the better way here.
2026-06-02 15:33:37 -07:00
Wunkolo
d78f719bf7 renderer_gl: Implement multisample Convert{DS24S8ToRGBA8,RGBA4ToRGB5A1} 2026-06-02 15:33:37 -07:00
Wunkolo
9660492f99 renderer_gl: Fix surface ScaleUp implementation
Should assign the new `res_scale` and `sample_count`
2026-06-02 15:33:37 -07:00
Wunkolo
86c05a27e8 renderer_gl: Initial MSAA implementation
Basically copied over some of the paradigms over from Vulkan. Covers most rendering uses-cases except for conversions such as `ConvertDS24S8ToRGBA8` and `ConvertRGBA4ToRGB5A1`
2026-06-02 15:33:37 -07:00
Wunkolo
63a52b9dc3 config: Refactor sample_count to antialiasing setting
Intended to allow for other anti-aliasing methods to be introduced
2026-06-02 15:33:37 -07:00
Wunkolo
a922cdaa45 renderer_vulkan: Fix Multisample ConvertDS24S8ToRGBA8
Migrate `ResolveTexture` to `BlitHelper`.
If the conversion was multi-sample, do a final resolve at the end of the conversion to ensure the non-multisample textures are updated as well.

Fixes Pokemon!
2026-06-02 15:33:37 -07:00
Wunkolo
4c4c75cd1b renderer_vulkan: Fix MSAA image debug name 2026-06-02 15:33:37 -07:00
Wunkolo
844939d372 renderer_vulkan: Fix multisample framebuffer creation
MSAA renderpasses require the "current" image as the main resolve target, and the MSAA image as the second attachment.
2026-06-02 15:33:37 -07:00
Wunkolo
7eac2ec7af renderer_vulkan: Fix multisample ClearTextureWithRenderpass
Ensure that the multisample framebuffer is used rather than the usual one when using a render pass to clear the textures.

That way, a MSAA-render AND resolve is used to clear the textures at the same time.
2026-06-02 15:33:36 -07:00
Wunkolo
bad3313f04 renderer_vulkan: Fix ConvertDS24S8ToRGBA8 image targets
Ensure that the Multi-Sample texture is used for the destination color image as well. Should the dest image be MSAA too? Or should all the values be resolved into a minimum depth and some combination of stencil-values here?
2026-06-02 15:33:36 -07:00
Wunkolo
808cf2c7d2 renderer_vulkan: Fix Surface::ScaleUp scale/sample increase
This should be checking the _new_ value to possibly cull upscaled texture creation rather than the current value of the surface. Fixes broken up render passes when drawing UI in some games.
2026-06-02 15:33:36 -07:00
Wunkolo
e90cbba7e2 renderer_vulkan: Fix MSAA framebuffer target resolve surface
Use the specified type rather than defaulting to the surface's current one(implicit `ImageView` argument).
2026-06-02 15:33:36 -07:00
Wunkolo
a73c8c7c86 renderer_vulkan: Fix narrowing byte conversion
Fixes a compilation error on Unix platforms.
2026-06-02 15:33:36 -07:00
Wunkolo
5ded99d326 renderer_vulkan: Add TextureRuntime::ResolveTexture
Rather than use a big lambda, just rip this out into a proper function for other blit functions to utilize.
2026-06-02 15:33:36 -07:00
Wunkolo
7ce88bc63b renderer_vulkan: Fix cleanup and debug-naming for d24s8_to_rgba8_ms_comp 2026-06-02 15:33:36 -07:00
Wunkolo
216952b8cd renderer_vulkan: Fix initialization of image handles
Try to optimally create the new image handles when a change in res scale or sample-count has actually occured. MSAA images need to be updated too in the case that the resolution scale has changed
2026-06-02 15:33:36 -07:00
Wunkolo
0b12a881c9 renderer_vulkan: Derive framebuffer sample-count from attachments
Derive the framebuffer sample-count from the input color and depth operands. Similar to how `res_scale` is determined.
2026-06-02 15:33:36 -07:00
Wunkolo
326d658757 renderer_vulkan: Fix dangling surface reference during msaa resolve
These individual parameters need to be copied as the reference to the surface-object only lasts within the scope of this function.
2026-06-02 15:33:36 -07:00
Wunkolo
e74ebf65a6 renderer_vulkan: Fix Framebuffer::sample_count move-operator
`sample_count` needs to be move/copied over.

Also reorder the accessor order to match the declaration of variables.
2026-06-02 15:33:36 -07:00
Wunkolo
63e25b2206 renderer_vulkan: Fix multisample texture init barrier
Should address the MultiSampled image directly since the multisampled image is just a transient image and not the leading state of the image.
2026-06-02 15:33:36 -07:00
Wunkolo
fdfe63f76c renderer_vulkan: Implement multisample texture runtime
This seems to be enough for simple programs to render with MSAA enabled!
2026-06-02 15:33:36 -07:00
Wunkolo
950803c2b7 renderer_vulkan: Implement multisample pipeline/renderpass support
Allows multi-sample render passes and graphics pipelines to be created, using sample-rate shading rather than coverage-based MSAA.
2026-06-02 15:33:36 -07:00
Wunkolo
ddc81c390c rasterizer_cache: Initial support for multi-sample surfaces 2026-06-02 15:33:36 -07:00
Wunkolo
29eb887d90 vk_instance: Add detection of MSAA features
Full multi-sample support is when renderpass-2 and depth-stencil-resolve extensions are available and when sample-rate-shading and msaa-storage-images are supported.
2026-06-02 15:33:36 -07:00
Wunkolo
a0eea7bb4d vk_blit_helper: Add d24s8_to_rgba8_ms_comp
Helper host-shader for blitting multi-sampled DS24S8 textures to multi-sampled RGBA8
2026-06-02 15:33:36 -07:00
Wunkolo
14736c7065 config: Add sample_count renderer option
Option is only enabled when the renderer is set to Vulkan, for now.
2026-06-02 15:33:36 -07:00
RedBlackAka
4867bb2e2b
video_core: Change unimplemented gas stub behaviour for Vulkan (#2165) 2026-05-30 23:53:16 +02:00
Wunk
4e4c7e687b
renderer_gl: Fix disabled cubemap texture units (#2159)
Disabled texture units on OpenGL always use a null 2D texture, but there are
cases where the null texture should be a null cubemap rather than a 2D
texture to match the active texture binding state.

Fixes some errors that occur in `OpenGLState::Apply()` found
in Brain Age: Concentration Training.
2026-05-28 15:42:02 +02:00
OpenSauce04
56f738eb06 jni/config.cpp: Reworded default config assert message for clarity 2026-05-27 18:05:48 +01:00
RedBlackAka
b1e537a485
Qt: Do not show Microprofile option at all if disabled (#2156) 2026-05-26 22:44:51 +02:00
4 changed files with 30 additions and 15 deletions

View file

@ -340,14 +340,13 @@ void Config::Reload() {
for (auto key = Settings::Keys::keys_array.begin(); key != Settings::Keys::keys_array.end();
++key) {
const auto key_declaration_string = std::string(*key) + " =";
// FIXME: This code looks so ass when formatted by clang-format -OS
if (std::ranges::find(DefaultINI::android_config_omitted_keys, *key) ==
std::end(DefaultINI::android_config_omitted_keys) &&
std::string(DefaultINI::android_config_default_file_content)
.find(key_declaration_string) == std::string::npos) {
if ((std::ranges::find(DefaultINI::android_config_omitted_keys, *key) ==
std::end(DefaultINI::android_config_omitted_keys)) &&
(std::string(DefaultINI::android_config_default_file_content)
.find(key_declaration_string) == std::string::npos)) {
ASSERT_MSG(false,
"Validation of default content config failed: Missing or malformed key "
"declaration {}",
"Validation of default config content (jni/default_ini.h) failed: Missing "
"declaration for key '{}'",
*key);
}
}

View file

@ -57,7 +57,9 @@
#include "citra_qt/debugger/graphics/graphics_vertex_shader.h"
#include "citra_qt/debugger/ipc/recorder.h"
#include "citra_qt/debugger/lle_service_modules.h"
#if MICROPROFILE_ENABLED
#include "citra_qt/debugger/profiler.h"
#endif
#include "citra_qt/debugger/registers.h"
#include "citra_qt/debugger/wait_tree.h"
#ifdef USE_DISCORD_PRESENCE
@ -712,11 +714,6 @@ void GMainWindow::InitializeDebugWidgets() {
microProfileDialog = new MicroProfileDialog(this);
microProfileDialog->hide();
debug_menu->addAction(microProfileDialog->toggleViewAction());
#else
auto micro_profile_stub = new QAction(tr("MicroProfile (unavailable)"), this);
micro_profile_stub->setEnabled(false);
micro_profile_stub->setChecked(false);
debug_menu->addAction(micro_profile_stub);
#endif
registersWidget = new RegistersWidget(system, this);

View file

@ -686,8 +686,21 @@ void RasterizerOpenGL::SyncTextureUnits(const Framebuffer* framebuffer) {
// If the texture unit is disabled unbind the corresponding gl unit
if (!texture.enabled) {
const Surface& null_surface = res_cache.GetSurface(VideoCore::NULL_SURFACE_ID);
state.texture_units[texture_index].texture_2d = null_surface.Handle();
switch (texture.config.type.Value()) {
case TextureType::TextureCube:
case TextureType::ShadowCube: {
state.texture_units[texture_index].texture_2d =
res_cache.GetSurface(VideoCore::NULL_SURFACE_CUBE_ID).Handle();
state.texture_units[texture_index].target = GL_TEXTURE_CUBE_MAP;
break;
}
default: {
state.texture_units[texture_index].texture_2d =
res_cache.GetSurface(VideoCore::NULL_SURFACE_ID).Handle();
state.texture_units[texture_index].target = GL_TEXTURE_2D;
break;
}
}
continue;
}

View file

@ -72,6 +72,7 @@ void FragmentModule::Generate() {
break;
case TexturingRegs::FogMode::Gas:
WriteGas();
// Return early due to unimplemented gas mode
return;
default:
break;
@ -196,7 +197,12 @@ void FragmentModule::WriteFog() {
void FragmentModule::WriteGas() {
// TODO: Implement me
LOG_CRITICAL(Render, "Unimplemented gas mode");
OpKill();
// Replace the output color with a transparent pixel,
// (just discarding the pixel causes graphical issues
// in some MH games).
OpStore(color_id, ConstF32(0.f, 0.f, 0.f, 0.f));
OpReturn();
OpFunctionEnd();
}