From dcb8b4f81ba71a64a6d6400c00b4fcf695c77f9b Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Mon, 13 May 2024 21:02:55 -0500 Subject: [PATCH 1/2] [GPU/Core/Debugger] Reduced struct sizes using align for x64 platforms, fields carefully moved Then revert changes that aren't worth it --- Common/GPU/OpenGL/GLQueueRunner.h | 14 +++++++------- Common/GPU/Vulkan/VulkanQueueRunner.h | 4 ++-- Common/GPU/Vulkan/VulkanRenderManager.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Common/GPU/OpenGL/GLQueueRunner.h b/Common/GPU/OpenGL/GLQueueRunner.h index 87d9a76be6..d7832a9b52 100644 --- a/Common/GPU/OpenGL/GLQueueRunner.h +++ b/Common/GPU/OpenGL/GLQueueRunner.h @@ -95,13 +95,13 @@ struct GLRRenderData { GLenum func; } depth; struct { - GLboolean enabled; GLenum func; - uint8_t ref; - uint8_t compareMask; GLenum sFail; GLenum zFail; GLenum pass; + GLboolean enabled; + uint8_t ref; + uint8_t compareMask; uint8_t writeMask; } stencil; struct { @@ -160,8 +160,8 @@ struct GLRRenderData { uint8_t *data; // owned, delete[]-d } texture_subimage; struct { + GLRFramebuffer* framebuffer; int slot; - GLRFramebuffer *framebuffer; int aspect; } bind_fb_texture; struct { @@ -192,9 +192,9 @@ struct GLRRenderData { GLRect2D rc; } scissor; struct { - GLboolean cullEnable; GLenum frontFace; GLenum cullFace; + GLboolean cullEnable; GLboolean ditherEnable; GLboolean depthClampEnable; } raster; @@ -326,9 +326,9 @@ struct GLRStep { GLboolean filter; } blit; struct { - int aspectMask; - GLRFramebuffer *src; + GLRFramebuffer* src; GLRect2D srcRect; + int aspectMask; Draw::DataFormat dstFormat; } readback; struct { diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.h b/Common/GPU/Vulkan/VulkanQueueRunner.h index da40ad300b..03f84ea54b 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.h +++ b/Common/GPU/Vulkan/VulkanQueueRunner.h @@ -71,12 +71,12 @@ struct VkRenderData { uint32_t offset; } draw; struct { + VkBuffer vbuffer; + VkBuffer ibuffer; uint32_t descSetIndex; uint32_t uboOffsets[3]; uint16_t numUboOffsets; uint16_t instances; - VkBuffer vbuffer; - VkBuffer ibuffer; uint32_t voffset; uint32_t ioffset; uint32_t count; diff --git a/Common/GPU/Vulkan/VulkanRenderManager.h b/Common/GPU/Vulkan/VulkanRenderManager.h index c1af6cc342..66f252671b 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.h +++ b/Common/GPU/Vulkan/VulkanRenderManager.h @@ -156,10 +156,10 @@ struct CompileQueueEntry { enum class Type { GRAPHICS, }; - Type type; + VKRGraphicsPipeline* graphics = nullptr; VkRenderPass compatibleRenderPass; + Type type; RenderPassType renderPassType; - VKRGraphicsPipeline *graphics = nullptr; VkSampleCountFlagBits sampleCount; }; From b21efd6728294728604310e88c87df01416eb6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 17 Sep 2024 14:55:20 +0200 Subject: [PATCH 2/2] Revert possibly problematic parts --- Common/GPU/Vulkan/VulkanQueueRunner.h | 4 ++-- Common/GPU/Vulkan/VulkanRenderManager.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.h b/Common/GPU/Vulkan/VulkanQueueRunner.h index 03f84ea54b..da40ad300b 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.h +++ b/Common/GPU/Vulkan/VulkanQueueRunner.h @@ -71,12 +71,12 @@ struct VkRenderData { uint32_t offset; } draw; struct { - VkBuffer vbuffer; - VkBuffer ibuffer; uint32_t descSetIndex; uint32_t uboOffsets[3]; uint16_t numUboOffsets; uint16_t instances; + VkBuffer vbuffer; + VkBuffer ibuffer; uint32_t voffset; uint32_t ioffset; uint32_t count; diff --git a/Common/GPU/Vulkan/VulkanRenderManager.h b/Common/GPU/Vulkan/VulkanRenderManager.h index 66f252671b..ed65c0c4b4 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.h +++ b/Common/GPU/Vulkan/VulkanRenderManager.h @@ -156,10 +156,10 @@ struct CompileQueueEntry { enum class Type { GRAPHICS, }; - VKRGraphicsPipeline* graphics = nullptr; - VkRenderPass compatibleRenderPass; Type type; + VkRenderPass compatibleRenderPass; RenderPassType renderPassType; + VKRGraphicsPipeline* graphics = nullptr; VkSampleCountFlagBits sampleCount; };