diff --git a/src/dynarmic/src/dynarmic/common/fp/fused.cpp b/src/dynarmic/src/dynarmic/common/fp/fused.cpp index d993c6de7f..d1197b4a42 100644 --- a/src/dynarmic/src/dynarmic/common/fp/fused.cpp +++ b/src/dynarmic/src/dynarmic/common/fp/fused.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2018 MerryMage * SPDX-License-Identifier: 0BSD diff --git a/src/dynarmic/src/dynarmic/common/u128.cpp b/src/dynarmic/src/dynarmic/common/u128.cpp index 595961557d..541e009b23 100644 --- a/src/dynarmic/src/dynarmic/common/u128.cpp +++ b/src/dynarmic/src/dynarmic/common/u128.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. diff --git a/src/dynarmic/src/dynarmic/common/u128.h b/src/dynarmic/src/dynarmic/common/u128.h index e8336075d5..4e4bb3cf10 100644 --- a/src/dynarmic/src/dynarmic/common/u128.h +++ b/src/dynarmic/src/dynarmic/common/u128.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later /* This file is part of the dynarmic project. diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index be7ea62ef5..44385f1654 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -69,7 +69,7 @@ namespace { }; } -struct PushConstants { +struct BlitPushConstants { std::array tex_scale; std::array tex_offset; }; @@ -394,13 +394,13 @@ void BindBlitState(vk::CommandBuffer cmdbuf, VkPipelineLayout layout, const Regi static_cast(src_size.width); const float scale_y = static_cast(src_region.end.y - src_region.start.y) / static_cast(src_size.height); - const PushConstants push_constants{ + const BlitPushConstants push_constants{ .tex_scale = {scale_x, scale_y}, .tex_offset = {static_cast(src_region.start.x) / static_cast(src_size.width), static_cast(src_region.start.y) / static_cast(src_size.height)}, }; - cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); + cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); } VkExtent2D GetConversionExtent(const ImageView& src_image_view) { @@ -507,11 +507,11 @@ BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_, descriptor_pool.Allocator(*two_textures_set_layout, TEXTURE_DESCRIPTOR_BANK_INFO<2>)}, one_texture_pipeline_layout(device.GetLogical().CreatePipelineLayout(PipelineLayoutCreateInfo( one_texture_set_layout.address(), - PUSH_CONSTANT_RANGE))), + PUSH_CONSTANT_RANGE))), two_textures_pipeline_layout( device.GetLogical().CreatePipelineLayout(PipelineLayoutCreateInfo( two_textures_set_layout.address(), - PUSH_CONSTANT_RANGE))), + PUSH_CONSTANT_RANGE))), clear_color_pipeline_layout(device.GetLogical().CreatePipelineLayout(PipelineLayoutCreateInfo( nullptr, PUSH_CONSTANT_RANGE))), full_screen_vert(BuildShader(device, FULL_SCREEN_TRIANGLE_VERT_SPV)), @@ -709,7 +709,7 @@ void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u8 color_ma (color_mask & 0x4) ? 1.0f : 0.0f, (color_mask & 0x8) ? 1.0f : 0.0f}; cmdbuf.SetBlendConstants(blend_color.data()); BindBlitState(cmdbuf, dst_region); - cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_color); + cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_color); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); @@ -733,7 +733,7 @@ void BlitImageHelper::ClearDepthStencil(const Framebuffer* dst_framebuffer, bool cmdbuf.SetBlendConstants(blend_constants.data()); cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); BindBlitState(cmdbuf, dst_region); - cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_depth); + cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_depth); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); @@ -765,7 +765,7 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb .offset = offset, .extent = extent, }; - const PushConstants push_constants{ + const BlitPushConstants push_constants{ .tex_scale = {viewport.width, viewport.height}, .tex_offset = {0.0f, 0.0f}, }; @@ -777,7 +777,7 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb nullptr); cmdbuf.SetViewport(0, viewport); cmdbuf.SetScissor(0, scissor); - cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); + cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); @@ -811,7 +811,7 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer .offset = offset, .extent = extent, }; - const PushConstants push_constants{ + const BlitPushConstants push_constants{ .tex_scale = {viewport.width, viewport.height}, .tex_offset = {0.0f, 0.0f}, }; @@ -823,7 +823,7 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer nullptr); cmdbuf.SetViewport(0, viewport); cmdbuf.SetScissor(0, scissor); - cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); + cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); diff --git a/src/video_core/renderer_vulkan/present/fsr.cpp b/src/video_core/renderer_vulkan/present/fsr.cpp index ba6252ed95..599acbd141 100644 --- a/src/video_core/renderer_vulkan/present/fsr.cpp +++ b/src/video_core/renderer_vulkan/present/fsr.cpp @@ -23,7 +23,7 @@ namespace Vulkan { using namespace FSR; -using PushConstants = std::array; +using FsrPushConstants = std::array; FSR::FSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_count, VkExtent2D extent) @@ -96,7 +96,7 @@ void FSR::CreatePipelineLayouts() { const VkPushConstantRange range{ .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, .offset = 0, - .size = sizeof(PushConstants), + .size = sizeof(FsrPushConstants), }; VkPipelineLayoutCreateInfo ci{ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, @@ -168,8 +168,8 @@ VkImageView FSR::Draw(Scheduler& scheduler, size_t image_index, VkImage source_i const f32 viewport_height = (crop_rect.bottom - crop_rect.top) * input_image_height; const f32 viewport_y = crop_rect.top * input_image_height; - PushConstants easu_con{}; - PushConstants rcas_con{}; + FsrPushConstants easu_con{}; + FsrPushConstants rcas_con{}; FsrEasuConOffset(easu_con.data() + 0, easu_con.data() + 4, easu_con.data() + 8, easu_con.data() + 12, viewport_width, viewport_height, input_image_width, input_image_height, output_image_width, output_image_height, viewport_x, @@ -190,7 +190,7 @@ VkImageView FSR::Draw(Scheduler& scheduler, size_t image_index, VkImage source_i cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, easu_pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_layout, 0, easu_descriptor_set, {}); - cmdbuf.PushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, easu_con); + cmdbuf.FsrPushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, easu_con); cmdbuf.Draw(3, 1, 0, 0); cmdbuf.EndRenderPass(); @@ -200,7 +200,7 @@ VkImageView FSR::Draw(Scheduler& scheduler, size_t image_index, VkImage source_i cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, rcas_pipeline); cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_layout, 0, rcas_descriptor_set, {}); - cmdbuf.PushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, rcas_con); + cmdbuf.FsrPushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, rcas_con); cmdbuf.Draw(3, 1, 0, 0); cmdbuf.EndRenderPass(); diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp index 5f5633d4d1..7dae933c9a 100644 --- a/src/video_core/shader_environment.cpp +++ b/src/video_core/shader_environment.cpp @@ -32,8 +32,6 @@ constexpr std::array MAGIC_NUMBER{'y', 'u', 'z', 'u', 'c', 'a', 'c', 'h constexpr size_t INST_SIZE = sizeof(u64); -using Maxwell = Tegra::Engines::Maxwell3D::Regs; - static u64 MakeCbufKey(u32 index, u32 offset) { return (static_cast(index) << 32) | offset; } @@ -286,34 +284,34 @@ Tegra::Texture::TICEntry GenericEnvironment::ReadTextureInfo(GPUVAddr tic_addr, GraphicsEnvironment::GraphicsEnvironment(Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_, - Maxwell::ShaderType program, GPUVAddr program_base_, + Tegra::Engines::Maxwell3D::Regs::ShaderType program, GPUVAddr program_base_, u32 start_address_) : GenericEnvironment{gpu_memory_, program_base_, start_address_}, maxwell3d{&maxwell3d_} { gpu_memory->ReadBlock(program_base + start_address, &sph, sizeof(sph)); initial_offset = sizeof(sph); gp_passthrough_mask = maxwell3d->regs.post_vtg_shader_attrib_skip_mask; switch (program) { - case Maxwell::ShaderType::VertexA: + case Tegra::Engines::Maxwell3D::Regs::ShaderType::VertexA: stage = Shader::Stage::VertexA; stage_index = 0; break; - case Maxwell::ShaderType::VertexB: + case Tegra::Engines::Maxwell3D::Regs::ShaderType::VertexB: stage = Shader::Stage::VertexB; stage_index = 0; break; - case Maxwell::ShaderType::TessellationInit: + case Tegra::Engines::Maxwell3D::Regs::ShaderType::TessellationInit: stage = Shader::Stage::TessellationControl; stage_index = 1; break; - case Maxwell::ShaderType::Tessellation: + case Tegra::Engines::Maxwell3D::Regs::ShaderType::Tessellation: stage = Shader::Stage::TessellationEval; stage_index = 2; break; - case Maxwell::ShaderType::Geometry: + case Tegra::Engines::Maxwell3D::Regs::ShaderType::Geometry: stage = Shader::Stage::Geometry; stage_index = 3; break; - case Maxwell::ShaderType::Pixel: + case Tegra::Engines::Maxwell3D::Regs::ShaderType::Pixel: stage = Shader::Stage::Fragment; stage_index = 4; break; @@ -369,7 +367,7 @@ std::optional GraphicsEnvironment::GetReplaceConstBuffe Shader::TextureType GraphicsEnvironment::ReadTextureType(u32 handle) { const auto& regs{maxwell3d->regs}; - const bool via_header_index{regs.sampler_binding == Maxwell::SamplerBinding::ViaHeaderBinding}; + const bool via_header_index{regs.sampler_binding == Tegra::Engines::Maxwell3D::Regs::SamplerBinding::ViaHeaderBinding}; auto entry = ReadTextureInfo(regs.tex_header.Address(), regs.tex_header.limit, via_header_index, handle); const Shader::TextureType result{ConvertTextureType(entry)}; @@ -379,7 +377,7 @@ Shader::TextureType GraphicsEnvironment::ReadTextureType(u32 handle) { Shader::TexturePixelFormat GraphicsEnvironment::ReadTexturePixelFormat(u32 handle) { const auto& regs{maxwell3d->regs}; - const bool via_header_index{regs.sampler_binding == Maxwell::SamplerBinding::ViaHeaderBinding}; + const bool via_header_index{regs.sampler_binding == Tegra::Engines::Maxwell3D::Regs::SamplerBinding::ViaHeaderBinding}; auto entry = ReadTextureInfo(regs.tex_header.Address(), regs.tex_header.limit, via_header_index, handle); const Shader::TexturePixelFormat result(ConvertTexturePixelFormat(entry));