From 4bbfcc1e25cfac3356dfdc484084e3c4133da808 Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 17 Mar 2026 23:53:07 +0000 Subject: [PATCH] fixup more compile issues --- src/video_core/dirty_flags.cpp | 3 + .../renderer_opengl/gl_state_tracker.cpp | 3 + .../renderer_opengl/gl_texture_cache.h | 18 ++--- src/video_core/renderer_vulkan/blit_image.cpp | 12 ++- .../renderer_vulkan/present/fsr.cpp | 4 +- .../renderer_vulkan/vk_rasterizer.cpp | 76 +++++++++---------- .../renderer_vulkan/vk_state_tracker.cpp | 3 + .../renderer_vulkan/vk_texture_cache.cpp | 8 +- 8 files changed, 60 insertions(+), 67 deletions(-) diff --git a/src/video_core/dirty_flags.cpp b/src/video_core/dirty_flags.cpp index c2ecc12f56..fa92563628 100644 --- a/src/video_core/dirty_flags.cpp +++ b/src/video_core/dirty_flags.cpp @@ -75,3 +75,6 @@ void SetupDirtyFlags(Maxwell3D::DirtyState::Tables& tables) { } } // namespace VideoCommon::Dirty + +#undef OFF +#undef NUM diff --git a/src/video_core/renderer_opengl/gl_state_tracker.cpp b/src/video_core/renderer_opengl/gl_state_tracker.cpp index d53b422cac..4430124b7b 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.cpp +++ b/src/video_core/renderer_opengl/gl_state_tracker.cpp @@ -241,3 +241,6 @@ void StateTracker::InvalidateState() { StateTracker::StateTracker() : flags{&default_flags} {} } // namespace OpenGL + +#undef OFF +#undef NUM diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index dfcef4b0b6..dbe7f48382 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -33,14 +33,6 @@ class Image; class ImageView; class Sampler; -using Common::SlotVector; -using VideoCommon::ImageId; -using VideoCommon::ImageViewId; -using VideoCommon::ImageViewType; -using VideoCommon::NUM_RT; -using VideoCommon::Region2D; -using VideoCommon::RenderTargets; - struct FormatProperties { GLenum compatibility_class; bool compatibility_by_size; @@ -114,8 +106,8 @@ public: void EmulateCopyImage(Image& dst, Image& src, std::span copies); - void BlitFramebuffer(Framebuffer* dst, Framebuffer* src, const Region2D& dst_region, - const Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, + void BlitFramebuffer(Framebuffer* dst, Framebuffer* src, const VideoCommon::Region2D& dst_region, + const VideoCommon::Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, Tegra::Engines::Fermi2D::Operation operation); void AccelerateImageUpload(Image& image, const StagingBufferMap& map, @@ -251,8 +243,8 @@ class ImageView : public VideoCommon::ImageViewBase { friend Image; public: - explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, ImageId, Image&, - const SlotVector&); + explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageViewInfo&, VideoCommon::ImageId, Image&, + const Common::SlotVector&); explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo&, const VideoCommon::ImageViewInfo&, GPUVAddr); explicit ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info, @@ -340,7 +332,7 @@ private: class Framebuffer { public: - explicit Framebuffer(TextureCacheRuntime&, std::span color_buffers, + explicit Framebuffer(TextureCacheRuntime&, std::span color_buffers, ImageView* depth_buffer, const VideoCommon::RenderTargets& key); ~Framebuffer(); diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 44385f1654..92aede13c0 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -34,8 +34,6 @@ namespace Vulkan { -using VideoCommon::ImageViewType; - namespace { [[nodiscard]] VkImageAspectFlags AspectMaskFromFormat(VideoCore::Surface::PixelFormat format) { @@ -400,7 +398,7 @@ void BindBlitState(vk::CommandBuffer cmdbuf, VkPipelineLayout layout, const Regi static_cast(src_region.start.y) / static_cast(src_size.height)}, }; - cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); + cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); } VkExtent2D GetConversionExtent(const ImageView& src_image_view) { @@ -709,7 +707,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.BlitPushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_color); + cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_color); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); @@ -733,7 +731,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.BlitPushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_depth); + cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_depth); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); @@ -777,7 +775,7 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb nullptr); cmdbuf.SetViewport(0, viewport); cmdbuf.SetScissor(0, scissor); - cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); + cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); cmdbuf.Draw(3, 1, 0, 0); }); scheduler.InvalidateState(); @@ -823,7 +821,7 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer nullptr); cmdbuf.SetViewport(0, viewport); cmdbuf.SetScissor(0, scissor); - cmdbuf.BlitPushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); + cmdbuf.PushConstants(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 599acbd141..de10397af1 100644 --- a/src/video_core/renderer_vulkan/present/fsr.cpp +++ b/src/video_core/renderer_vulkan/present/fsr.cpp @@ -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.FsrPushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, easu_con); + cmdbuf.PushConstants(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.FsrPushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, rcas_con); + cmdbuf.PushConstants(pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, rcas_con); cmdbuf.Draw(3, 1, 0, 0); cmdbuf.EndRenderPass(); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index f867980a6f..9dacbd8d64 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -45,12 +45,6 @@ namespace Vulkan { -using Maxwell = Tegra::Engines::Maxwell3D::Regs; -using MaxwellDrawState = Tegra::Engines::DrawManager::State; -using VideoCommon::ImageViewId; -using VideoCommon::ImageViewType; - - namespace { struct DrawParams { u32 base_instance; @@ -61,7 +55,7 @@ struct DrawParams { bool is_indexed; }; -VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index, float scale) { +VkViewport GetViewportState(const Device& device, const Tegra::Engines::Maxwell3D::Regs& regs, size_t index, float scale) { const auto& src = regs.viewport_transform[index]; const auto conv = [scale](float value) { float new_value = value * scale; @@ -77,9 +71,9 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in float y = conv(src.translate_y - src.scale_y); float height = conv(src.scale_y * 2.0f); - const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; + const bool lower_left = regs.window_origin.mode != Tegra::Engines::Maxwell3D::Regs::WindowOrigin::Mode::UpperLeft; const bool y_negate = !device.IsNvViewportSwizzleSupported() && - src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY; + src.swizzle.y == Tegra::Engines::Maxwell3D::Regs::ViewportSwizzle::NegativeY; if (lower_left) { // Flip by surface clip height @@ -93,7 +87,7 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in height = -height; } - const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f; + const float reduce_z = regs.depth_mode == Tegra::Engines::Maxwell3D::Regs::DepthMode::MinusOneToOne ? 1.0f : 0.0f; VkViewport viewport{ .x = x, .y = y, @@ -109,7 +103,7 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in return viewport; } -VkRect2D GetScissorState(const Maxwell& regs, size_t index, u32 up_scale = 1, u32 down_shift = 0) { +VkRect2D GetScissorState(const Tegra::Engines::Maxwell3D::Regs& regs, size_t index, u32 up_scale = 1, u32 down_shift = 0) { const auto& src = regs.scissor_test[index]; VkRect2D scissor{}; const auto scale_up = [&](s32 value) -> s32 { @@ -126,7 +120,7 @@ VkRect2D GetScissorState(const Maxwell& regs, size_t index, u32 up_scale = 1, u3 : std::max(converted_value + acumm, 1); }; - const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; + const bool lower_left = regs.window_origin.mode != Tegra::Engines::Maxwell3D::Regs::WindowOrigin::Mode::UpperLeft; const s32 clip_height = regs.surface_clip.height; // Flip coordinates if lower left @@ -151,7 +145,7 @@ VkRect2D GetScissorState(const Maxwell& regs, size_t index, u32 up_scale = 1, u3 return scissor; } -DrawParams MakeDrawParams(const MaxwellDrawState& draw_state, u32 num_instances, bool is_indexed) { +DrawParams MakeDrawParams(const Tegra::Engines::DrawManager::State& draw_state, u32 num_instances, bool is_indexed) { DrawParams params{ .base_instance = draw_state.base_instance, .num_instances = num_instances, @@ -162,11 +156,11 @@ DrawParams MakeDrawParams(const MaxwellDrawState& draw_state, u32 num_instances, }; // 6 triangle vertices per quad, base vertex is part of the index // See BindQuadIndexBuffer for more details - if (draw_state.topology == Maxwell::PrimitiveTopology::Quads) { + if (draw_state.topology == Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology::Quads) { params.num_vertices = (params.num_vertices / 4) * 6; params.base_vertex = 0; params.is_indexed = true; - } else if (draw_state.topology == Maxwell::PrimitiveTopology::QuadStrip) { + } else if (draw_state.topology == Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology::QuadStrip) { params.num_vertices = (params.num_vertices - 2) / 2 * 6; params.base_vertex = 0; params.is_indexed = true; @@ -1107,8 +1101,8 @@ void RasterizerVulkan::HandleTransformFeedback() { GPU::Logging::GPULogger::GetInstance().LogExtensionUsage( "VK_EXT_transform_feedback", "HandleTransformFeedback"); } - UNIMPLEMENTED_IF(regs.IsShaderConfigEnabled(Maxwell::ShaderType::TessellationInit) || - regs.IsShaderConfigEnabled(Maxwell::ShaderType::Tessellation)); + UNIMPLEMENTED_IF(regs.IsShaderConfigEnabled(Tegra::Engines::Maxwell3D::Regs::ShaderType::TessellationInit) || + regs.IsShaderConfigEnabled(Tegra::Engines::Maxwell3D::Regs::ShaderType::Tessellation)); } } @@ -1121,7 +1115,7 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg float y = static_cast(regs.surface_clip.y); float width = (std::max)(1.0f, static_cast(regs.surface_clip.width)); float height = (std::max)(1.0f, static_cast(regs.surface_clip.height)); - if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) { + if (regs.window_origin.mode != Tegra::Engines::Maxwell3D::Regs::WindowOrigin::Mode::UpperLeft) { y += height; height = -height; } @@ -1151,7 +1145,7 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg GetViewportState(device, regs, 14, scale), GetViewportState(device, regs, 15, scale), }; scheduler.Record([this, viewport_list](vk::CommandBuffer cmdbuf) { - const u32 num_viewports = std::min(device.GetMaxViewports(), Maxwell::NumViewports); + const u32 num_viewports = std::min(device.GetMaxViewports(), Tegra::Engines::Maxwell3D::Regs::NumViewports); const vk::Span viewports(viewport_list.data(), num_viewports); cmdbuf.SetViewport(0, viewports); }); @@ -1166,7 +1160,7 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs u32 y = regs.surface_clip.y; u32 width = (std::max)(1u, static_cast(regs.surface_clip.width)); u32 height = (std::max)(1u, static_cast(regs.surface_clip.height)); - if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) { + if (regs.window_origin.mode != Tegra::Engines::Maxwell3D::Regs::WindowOrigin::Mode::UpperLeft) { y = regs.surface_clip.height - (y + height); } VkRect2D scissor{}; @@ -1204,7 +1198,7 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs GetScissorState(regs, 15, up_scale, down_shift), }; scheduler.Record([this, scissor_list](vk::CommandBuffer cmdbuf) { - const u32 num_scissors = std::min(device.GetMaxViewports(), Maxwell::NumViewports); + const u32 num_scissors = std::min(device.GetMaxViewports(), Tegra::Engines::Maxwell3D::Regs::NumViewports); const vk::Span scissors(scissor_list.data(), num_scissors); cmdbuf.SetScissor(0, scissors); }); @@ -1556,11 +1550,11 @@ void RasterizerVulkan::UpdateDepthClampEnable(Tegra::Engines::Maxwell3D::Regs& r return; } bool is_enabled = !(regs.viewport_clip_control.geometry_clip == - Maxwell::ViewportClipControl::GeometryClip::Passthrough || + Tegra::Engines::Maxwell3D::Regs::ViewportClipControl::GeometryClip::Passthrough || regs.viewport_clip_control.geometry_clip == - Maxwell::ViewportClipControl::GeometryClip::FrustumXYZ || + Tegra::Engines::Maxwell3D::Regs::ViewportClipControl::GeometryClip::FrustumXYZ || regs.viewport_clip_control.geometry_clip == - Maxwell::ViewportClipControl::GeometryClip::FrustumZ); + Tegra::Engines::Maxwell3D::Regs::ViewportClipControl::GeometryClip::FrustumZ); scheduler.Record( [is_enabled](vk::CommandBuffer cmdbuf) { cmdbuf.SetDepthClampEnableEXT(is_enabled); }); } @@ -1627,16 +1621,16 @@ void RasterizerVulkan::UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs) { if (!state_tracker.TouchStencilOp()) { return; } - const Maxwell::StencilOp::Op fail = regs.stencil_front_op.fail; - const Maxwell::StencilOp::Op zfail = regs.stencil_front_op.zfail; - const Maxwell::StencilOp::Op zpass = regs.stencil_front_op.zpass; - const Maxwell::ComparisonOp compare = regs.stencil_front_op.func; + const Tegra::Engines::Maxwell3D::Regs::StencilOp::Op fail = regs.stencil_front_op.fail; + const Tegra::Engines::Maxwell3D::Regs::StencilOp::Op zfail = regs.stencil_front_op.zfail; + const Tegra::Engines::Maxwell3D::Regs::StencilOp::Op zpass = regs.stencil_front_op.zpass; + const Tegra::Engines::Maxwell3D::Regs::ComparisonOp compare = regs.stencil_front_op.func; if (regs.stencil_two_side_enable) { // Separate stencil op per face - const Maxwell::StencilOp::Op back_fail = regs.stencil_back_op.fail; - const Maxwell::StencilOp::Op back_zfail = regs.stencil_back_op.zfail; - const Maxwell::StencilOp::Op back_zpass = regs.stencil_back_op.zpass; - const Maxwell::ComparisonOp back_compare = regs.stencil_back_op.func; + const Tegra::Engines::Maxwell3D::Regs::StencilOp::Op back_fail = regs.stencil_back_op.fail; + const Tegra::Engines::Maxwell3D::Regs::StencilOp::Op back_zfail = regs.stencil_back_op.zfail; + const Tegra::Engines::Maxwell3D::Regs::StencilOp::Op back_zpass = regs.stencil_back_op.zpass; + const Tegra::Engines::Maxwell3D::Regs::ComparisonOp back_compare = regs.stencil_back_op.func; scheduler.Record([fail, zfail, zpass, compare, back_fail, back_zfail, back_zpass, back_compare](vk::CommandBuffer cmdbuf) { cmdbuf.SetStencilOpEXT(VK_STENCIL_FACE_FRONT_BIT, MaxwellToVK::StencilOp(fail), @@ -1673,8 +1667,8 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) { } if (state_tracker.TouchColorMask()) { - std::array setup_masks{}; - for (size_t index = 0; index < Maxwell::NumRenderTargets; index++) { + std::array setup_masks{}; + for (size_t index = 0; index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; index++) { const auto& mask = regs.color_mask[regs.color_mask_common ? 0 : index]; auto& current = setup_masks[index]; if (mask.R) { @@ -1696,7 +1690,7 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) { } if (state_tracker.TouchBlendEnable()) { - std::array setup_enables{}; + std::array setup_enables{}; std::ranges::transform( regs.blend.enable, setup_enables.begin(), [&](const auto& is_enabled) { return is_enabled != 0 ? VK_TRUE : VK_FALSE; }); @@ -1706,7 +1700,7 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) { } if (state_tracker.TouchBlendEquations()) { - std::array setup_blends{}; + std::array setup_blends{}; const auto blend_setup = [&](auto& host_blend, const auto& guest_blend) { host_blend.srcColorBlendFactor = MaxwellToVK::BlendFactor(guest_blend.color_source); @@ -1732,12 +1726,12 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) { } // Copy first blend state to all other targets - for (size_t index = 1; index < Maxwell::NumRenderTargets; index++) { + for (size_t index = 1; index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; index++) { setup_blends[index] = setup_blends[0]; } } else { // Per-target blending - for (size_t index = 0; index < Maxwell::NumRenderTargets; index++) { + for (size_t index = 0; index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; index++) { blend_setup(setup_blends[index], regs.blend_per_target[index]); } } @@ -1771,13 +1765,13 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) // generating dirty state. Track the highest dirty attribute and update all attributes until // that one. size_t highest_dirty_attr{}; - for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) { + for (size_t index = 0; index < Tegra::Engines::Maxwell3D::Regs::NumVertexAttributes; ++index) { if (dirty[Dirty::VertexAttribute0 + index]) { highest_dirty_attr = index; } } for (size_t index = 0; index < highest_dirty_attr; ++index) { - const Maxwell::VertexAttribute attribute{regs.vertex_attrib_format[index]}; + const Tegra::Engines::Maxwell3D::Regs::VertexAttribute attribute{regs.vertex_attrib_format[index]}; const u32 binding{attribute.buffer}; dirty[Dirty::VertexAttribute0 + index] = false; dirty[Dirty::VertexBinding0 + static_cast(binding)] = true; @@ -1792,7 +1786,7 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) }); } } - for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) { + for (size_t index = 0; index < Tegra::Engines::Maxwell3D::Regs::NumVertexAttributes; ++index) { if (!dirty[Dirty::VertexBinding0 + index]) { continue; } diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp index 79967d540a..32225c9fa3 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp +++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp @@ -273,3 +273,6 @@ StateTracker::StateTracker() : flags{&default_flags}, default_flags{}, invalidation_flags{MakeInvalidationFlags()} {} } // namespace Vulkan + +#undef OFF +#undef NUM diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index d51564dcb3..6bc610cc35 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -275,7 +275,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { return VK_COMPONENT_SWIZZLE_ZERO; } -[[nodiscard]] VkImageViewType ImageViewType(Shader::TextureType type) { +[[nodiscard]] VkImageViewType ToImageViewType(Shader::TextureType type) { switch (type) { case Shader::TextureType::Color1D: return VK_IMAGE_VIEW_TYPE_1D; @@ -300,7 +300,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { return VK_IMAGE_VIEW_TYPE_2D; } -[[nodiscard]] VkImageViewType ImageViewType(VideoCommon::ImageViewType type) { +[[nodiscard]] VkImageViewType ToImageViewType(VideoCommon::ImageViewType type) { switch (type) { case VideoCommon::ImageViewType::e1D: return VK_IMAGE_VIEW_TYPE_1D; @@ -2139,7 +2139,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI }; const auto create = [&](TextureType tex_type, std::optional num_layers) { VkImageViewCreateInfo ci{create_info}; - ci.viewType = ImageViewType(tex_type); + ci.viewType = ToImageViewType(tex_type); if (num_layers) { ci.subresourceRange.layerCount = *num_layers; } @@ -2272,7 +2272,7 @@ vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_ .pNext = nullptr, .flags = 0, .image = image_handle, - .viewType = ImageViewType(type), + .viewType = ToImageViewType(type), .format = vk_format, .components{ .r = VK_COMPONENT_SWIZZLE_IDENTITY,