From fb4e653269e859a6c34707495cc39184aee9a4a0 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 15 Apr 2023 15:43:03 +0200 Subject: [PATCH] lr: crosshair not transparent with vk. Mazan can be played with gamepad Use transparent quad pipeline to draw crosshairs and vmus Allow mazan and touchscreen games (manic panic, tduno, ...) to be played with a gamepad. --- core/rend/vulkan/vk_context_lr.cpp | 5 ++++- core/rend/vulkan/vk_context_lr.h | 1 + shell/libretro/libretro.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/rend/vulkan/vk_context_lr.cpp b/core/rend/vulkan/vk_context_lr.cpp index e7429eb44..8daa7aaa7 100644 --- a/core/rend/vulkan/vk_context_lr.cpp +++ b/core/rend/vulkan/vk_context_lr.cpp @@ -309,11 +309,13 @@ bool VulkanContext::init(retro_hw_render_interface_vulkan *retro_render_if) shaderManager = std::make_unique(); quadPipeline = std::make_unique(true, false); + quadPipelineWithAlpha = std::make_unique(false, false); quadDrawer = std::make_unique(); quadPipeline->Init(shaderManager.get(), *renderPass, 0); + quadPipelineWithAlpha->Init(shaderManager.get(), *renderPass, 0); quadDrawer->Init(quadPipeline.get()); overlay = std::make_unique(); - overlay->Init(quadPipeline.get()); + overlay->Init(quadPipelineWithAlpha.get()); textureCache = std::make_unique(); return true; @@ -428,6 +430,7 @@ void VulkanContext::term() commandPool.Term(); quadDrawer.reset(); quadPipeline.reset(); + quadPipelineWithAlpha.reset(); renderPass.reset(); shaderManager.reset(); ShaderCompiler::Term(); diff --git a/core/rend/vulkan/vk_context_lr.h b/core/rend/vulkan/vk_context_lr.h index c8c0832e2..16edba20b 100644 --- a/core/rend/vulkan/vk_context_lr.h +++ b/core/rend/vulkan/vk_context_lr.h @@ -138,6 +138,7 @@ private: vk::UniqueRenderPass renderPass; std::unique_ptr shaderManager; std::unique_ptr quadPipeline; + std::unique_ptr quadPipelineWithAlpha; std::unique_ptr quadDrawer; std::vector framebuffers; std::vector> colorAttachments; diff --git a/shell/libretro/libretro.cpp b/shell/libretro/libretro.cpp index e068fcc82..e82e07189 100644 --- a/shell/libretro/libretro.cpp +++ b/shell/libretro/libretro.cpp @@ -2650,7 +2650,7 @@ static void UpdateInputStateNaomi(u32 port) // -- mouse, for rotary encoders updateMouseState(port); // lightgun with analog stick - if (settings.input.JammaSetup == JVS::LightGun || settings.input.JammaSetup == JVS::LightGunAsAnalog) + if (settings.input.lightgunGame) { updateLightgunCoordinatesFromAnalogStick(port); if (input_cb(port, RETRO_DEVICE_LIGHTGUN, 0, RETRO_DEVICE_ID_LIGHTGUN_RELOAD))