From d35154ecf17e510d2359881145bb3e05d4c830c1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 30 Mar 2022 15:54:07 +0900 Subject: [PATCH] [vulkan] Clean up a lot of unnecessary includes Too much copying of base files. --- include/QF/Vulkan/scrap.h | 6 ++-- libs/video/renderer/vulkan/buffer.c | 25 ---------------- libs/video/renderer/vulkan/capture.c | 13 -------- libs/video/renderer/vulkan/command.c | 30 ------------------- libs/video/renderer/vulkan/descriptor.c | 26 +--------------- libs/video/renderer/vulkan/device.c | 21 ++----------- libs/video/renderer/vulkan/image.c | 26 +--------------- libs/video/renderer/vulkan/instance.c | 14 ++------- libs/video/renderer/vulkan/memory.c | 26 ---------------- libs/video/renderer/vulkan/pipeline.c | 29 +----------------- libs/video/renderer/vulkan/projection.c | 4 +-- libs/video/renderer/vulkan/renderpass.c | 27 +---------------- libs/video/renderer/vulkan/scrap.c | 20 ++----------- libs/video/renderer/vulkan/shader.c | 20 ++----------- libs/video/renderer/vulkan/staging.c | 18 +---------- libs/video/renderer/vulkan/swapchain.c | 10 ++----- libs/video/renderer/vulkan/util.c | 7 +---- libs/video/renderer/vulkan/vkparse.c | 27 ++--------------- libs/video/renderer/vulkan/vulkan_alias.c | 18 +---------- libs/video/renderer/vulkan/vulkan_matrices.c | 1 - .../video/renderer/vulkan/vulkan_vid_common.c | 1 - 21 files changed, 24 insertions(+), 345 deletions(-) diff --git a/include/QF/Vulkan/scrap.h b/include/QF/Vulkan/scrap.h index 31ceba506..760d9cb12 100644 --- a/include/QF/Vulkan/scrap.h +++ b/include/QF/Vulkan/scrap.h @@ -15,10 +15,10 @@ size_t QFV_ScrapSize (scrap_t *scrap) __attribute__((pure)); void QFV_ScrapClear (scrap_t *scrap); void QFV_DestroyScrap (scrap_t *scrap); VkImageView QFV_ScrapImageView (scrap_t *scrap) __attribute__((pure)); -subpic_t *QFV_ScrapSubpic (scrap_t *scrap, int width, int height); -void QFV_SubpicDelete (subpic_t *subpic); +struct subpic_s *QFV_ScrapSubpic (scrap_t *scrap, int width, int height); +void QFV_SubpicDelete (struct subpic_s *subpic); -void *QFV_SubpicBatch (subpic_t *subpic, struct qfv_stagebuf_s *stage); +void *QFV_SubpicBatch (struct subpic_s *subpic, struct qfv_stagebuf_s *stage); void QFV_ScrapFlush (scrap_t *scrap); diff --git a/libs/video/renderer/vulkan/buffer.c b/libs/video/renderer/vulkan/buffer.c index 9d8b05679..729fe914d 100644 --- a/libs/video/renderer/vulkan/buffer.c +++ b/libs/video/renderer/vulkan/buffer.c @@ -29,36 +29,11 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/cvar.h" -#include "QF/dstring.h" #include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/buffer.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/instance.h" -#include "QF/Vulkan/memory.h" - -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" VkBuffer QFV_CreateBuffer (qfv_device_t *device, VkDeviceSize size, diff --git a/libs/video/renderer/vulkan/capture.c b/libs/video/renderer/vulkan/capture.c index 03d57d894..f0a2038e5 100644 --- a/libs/video/renderer/vulkan/capture.c +++ b/libs/video/renderer/vulkan/capture.c @@ -29,17 +29,6 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#include - #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/capture.h" #include "QF/Vulkan/command.h" @@ -48,8 +37,6 @@ #include "QF/Vulkan/instance.h" #include "QF/Vulkan/swapchain.h" -#include "vid_vulkan.h" - qfv_capture_t * QFV_CreateCapture (qfv_device_t *device, int numframes, qfv_swapchain_t *swapchain, VkCommandPool cmdPool) diff --git a/libs/video/renderer/vulkan/command.c b/libs/video/renderer/vulkan/command.c index bd21bb8b6..0dae2bc5e 100644 --- a/libs/video/renderer/vulkan/command.c +++ b/libs/video/renderer/vulkan/command.c @@ -29,39 +29,9 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/cvar.h" -#include "QF/dstring.h" -#include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" #include "QF/Vulkan/qf_vid.h" -#include "QF/Vulkan/buffer.h" -#include "QF/Vulkan/image.h" -#include "QF/Vulkan/renderpass.h" -#include "QF/Vulkan/pipeline.h" #include "QF/Vulkan/command.h" #include "QF/Vulkan/device.h" -#include "QF/Vulkan/instance.h" - -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" VkCommandPool QFV_CreateCommandPool (qfv_device_t *device, uint32_t queueFamily, diff --git a/libs/video/renderer/vulkan/descriptor.c b/libs/video/renderer/vulkan/descriptor.c index 30cbd0cad..356fa5f40 100644 --- a/libs/video/renderer/vulkan/descriptor.c +++ b/libs/video/renderer/vulkan/descriptor.c @@ -29,35 +29,11 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/cvar.h" -#include "QF/dstring.h" #include "QF/hash.h" -#include "QF/mathlib.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/descriptor.h" #include "QF/Vulkan/device.h" -#include "QF/Vulkan/instance.h" - -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" VkSampler QFV_CreateSampler (qfv_device_t *device, diff --git a/libs/video/renderer/vulkan/device.c b/libs/video/renderer/vulkan/device.c index 392953826..6f632ef34 100644 --- a/libs/video/renderer/vulkan/device.c +++ b/libs/video/renderer/vulkan/device.c @@ -29,31 +29,14 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif +#include -#include "QF/cvar.h" -#include "QF/dstring.h" -#include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" #include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/instance.h" -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" #include "vid_vulkan.h" #include "util.h" diff --git a/libs/video/renderer/vulkan/image.c b/libs/video/renderer/vulkan/image.c index 49d234b62..092af713a 100644 --- a/libs/video/renderer/vulkan/image.c +++ b/libs/video/renderer/vulkan/image.c @@ -29,37 +29,13 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/cvar.h" -#include "QF/dstring.h" #include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/barrier.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/image.h" #include "QF/Vulkan/instance.h" -#include "QF/Vulkan/memory.h" - -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" VkImage QFV_CreateImage (qfv_device_t *device, int cubemap, diff --git a/libs/video/renderer/vulkan/instance.c b/libs/video/renderer/vulkan/instance.c index 4ba0a9cd8..d8cc53c2d 100644 --- a/libs/video/renderer/vulkan/instance.c +++ b/libs/video/renderer/vulkan/instance.c @@ -26,21 +26,11 @@ # include "config.h" #endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif +#include #include "QF/cvar.h" -#include "QF/dstring.h" #include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" + #include "QF/Vulkan/instance.h" #include "vid_vulkan.h" diff --git a/libs/video/renderer/vulkan/memory.c b/libs/video/renderer/vulkan/memory.c index 8f0ea2b9e..dbcc81de6 100644 --- a/libs/video/renderer/vulkan/memory.c +++ b/libs/video/renderer/vulkan/memory.c @@ -29,36 +29,10 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/cvar.h" -#include "QF/dstring.h" -#include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/device.h" -#include "QF/Vulkan/instance.h" #include "QF/Vulkan/memory.h" -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" - void * QFV_MapMemory (qfv_device_t *device, VkDeviceMemory object, VkDeviceSize offset, VkDeviceSize size) diff --git a/libs/video/renderer/vulkan/pipeline.c b/libs/video/renderer/vulkan/pipeline.c index baade73a1..5130a55c2 100644 --- a/libs/video/renderer/vulkan/pipeline.c +++ b/libs/video/renderer/vulkan/pipeline.c @@ -29,39 +29,12 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/hash.h" -#include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/descriptor.h" #include "QF/Vulkan/device.h" -#include "QF/Vulkan/image.h" -#include "QF/Vulkan/instance.h" #include "QF/Vulkan/pipeline.h" -#include "QF/Vulkan/renderpass.h" - -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" VkPipelineCache QFV_CreatePipelineCache (qfv_device_t *device, dstring_t *cacheData) diff --git a/libs/video/renderer/vulkan/projection.c b/libs/video/renderer/vulkan/projection.c index 7102acb26..701b52af2 100644 --- a/libs/video/renderer/vulkan/projection.c +++ b/libs/video/renderer/vulkan/projection.c @@ -28,9 +28,7 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif +#include #include "QF/cvar.h" #include "QF/Vulkan/projection.h" diff --git a/libs/video/renderer/vulkan/renderpass.c b/libs/video/renderer/vulkan/renderpass.c index 3be4f7295..04936b310 100644 --- a/libs/video/renderer/vulkan/renderpass.c +++ b/libs/video/renderer/vulkan/renderpass.c @@ -29,38 +29,13 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - #include "QF/cvar.h" -#include "QF/dstring.h" -#include "QF/hash.h" -#include "QF/mathlib.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" -#include "QF/va.h" -#include "QF/vid.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/image.h" -#include "QF/Vulkan/instance.h" #include "QF/Vulkan/renderpass.h" -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" -#include "vid_vulkan.h" - -#include "util.h" - VkRenderPass QFV_CreateRenderPass (qfv_device_t *device, qfv_attachmentdescription_t *attachments, diff --git a/libs/video/renderer/vulkan/scrap.c b/libs/video/renderer/vulkan/scrap.c index e56c2a7a5..3eaf74840 100644 --- a/libs/video/renderer/vulkan/scrap.c +++ b/libs/video/renderer/vulkan/scrap.c @@ -28,24 +28,12 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif +#include -#include "QF/alloc.h" -#include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/hash.h" -#include "QF/image.h" -#include "QF/quakefs.h" #include "QF/render.h" -#include "QF/sys.h" +#include "QF/ui/vrect.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/barrier.h" #include "QF/Vulkan/buffer.h" @@ -53,12 +41,10 @@ #include "QF/Vulkan/debug.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/image.h" -#include "QF/Vulkan/instance.h" #include "QF/Vulkan/scrap.h" #include "QF/Vulkan/staging.h" #include "r_scrap.h" -#include "vid_vulkan.h" struct scrap_s { rscrap_t rscrap; diff --git a/libs/video/renderer/vulkan/shader.c b/libs/video/renderer/vulkan/shader.c index bd12d3b79..a71c83300 100644 --- a/libs/video/renderer/vulkan/shader.c +++ b/libs/video/renderer/vulkan/shader.c @@ -28,32 +28,16 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif +#include -#include "QF/alloc.h" -#include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/hash.h" #include "QF/quakefs.h" #include "QF/sys.h" -#include "QF/Vulkan/qf_vid.h" + #include "QF/Vulkan/debug.h" #include "QF/Vulkan/device.h" -#include "QF/Vulkan/image.h" -#include "QF/Vulkan/instance.h" -#include "QF/Vulkan/renderpass.h" #include "QF/Vulkan/shader.h" -#include "vid_vulkan.h" - static #include "libs/video/renderer/vulkan/shader/particle.vert.spvc" static diff --git a/libs/video/renderer/vulkan/staging.c b/libs/video/renderer/vulkan/staging.c index 60c617b7d..660e61a64 100644 --- a/libs/video/renderer/vulkan/staging.c +++ b/libs/video/renderer/vulkan/staging.c @@ -28,22 +28,8 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif - -#include "QF/alloc.h" -#include "QF/cvar.h" #include "QF/dstring.h" -#include "QF/hash.h" -#include "QF/quakefs.h" -#include "QF/sys.h" + #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/buffer.h" #include "QF/Vulkan/command.h" @@ -52,8 +38,6 @@ #include "QF/Vulkan/instance.h" #include "QF/Vulkan/staging.h" -#include "vid_vulkan.h" - qfv_stagebuf_t * QFV_CreateStagingBuffer (qfv_device_t *device, const char *name, size_t size, VkCommandPool cmdPool) diff --git a/libs/video/renderer/vulkan/swapchain.c b/libs/video/renderer/vulkan/swapchain.c index 74990f37d..20766233a 100644 --- a/libs/video/renderer/vulkan/swapchain.c +++ b/libs/video/renderer/vulkan/swapchain.c @@ -3,27 +3,21 @@ #endif #ifdef HAVE_MATH_H -# include +//# include #endif #include "QF/cvar.h" #include "QF/mathlib.h" -#include "QF/sys.h" + #include "QF/Vulkan/qf_vid.h" -#include "QF/Vulkan/cvars.h" -#include "QF/Vulkan/command.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/image.h" #include "QF/Vulkan/instance.h" #include "QF/Vulkan/swapchain.h" -#include "compat.h" -#include "d_iface.h" #include "r_internal.h" #include "vid_vulkan.h" -#include "util.h" - qfv_swapchain_t * QFV_CreateSwapchain (vulkan_ctx_t *ctx, VkSwapchainKHR old_swapchain) { diff --git a/libs/video/renderer/vulkan/util.c b/libs/video/renderer/vulkan/util.c index c62fdbcb6..edd5f5b0f 100644 --- a/libs/video/renderer/vulkan/util.c +++ b/libs/video/renderer/vulkan/util.c @@ -26,12 +26,7 @@ # include "config.h" #endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif +#include #include "QF/hash.h" diff --git a/libs/video/renderer/vulkan/vkparse.c b/libs/video/renderer/vulkan/vkparse.c index 51ef1136f..79c6811e3 100644 --- a/libs/video/renderer/vulkan/vkparse.c +++ b/libs/video/renderer/vulkan/vkparse.c @@ -28,48 +28,25 @@ # include "config.h" #endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif +#include -#include "QF/cexpr.h" #include "QF/cmem.h" #include "QF/cvar.h" -#include "QF/dstring.h" #include "QF/hash.h" #include "QF/mathlib.h" -#include "QF/plist.h" -#include "QF/qargs.h" -#include "QF/quakefs.h" -#include "QF/sys.h" #include "QF/va.h" -#include "QF/vid.h" -#include "QF/simd/vec4f.h" + #include "QF/Vulkan/qf_vid.h" -#include "QF/Vulkan/descriptor.h" #include "QF/Vulkan/debug.h" #include "QF/Vulkan/device.h" -#include "QF/Vulkan/command.h" #include "QF/Vulkan/instance.h" #include "QF/Vulkan/image.h" #include "QF/Vulkan/pipeline.h" -#include "QF/Vulkan/renderpass.h" #include "QF/Vulkan/shader.h" #include "QF/Vulkan/swapchain.h" -#include "compat.h" -#include "d_iface.h" -#include "r_internal.h" #include "vid_vulkan.h" -#include "util.h" - #define vkparse_internal #include "vkparse.h" #undef vkparse_internal diff --git a/libs/video/renderer/vulkan/vulkan_alias.c b/libs/video/renderer/vulkan/vulkan_alias.c index 24e11fd8b..95bc262fb 100644 --- a/libs/video/renderer/vulkan/vulkan_alias.c +++ b/libs/video/renderer/vulkan/vulkan_alias.c @@ -33,22 +33,9 @@ # include "config.h" #endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#include - -#include "qfalloca.h" +#include #include "QF/cvar.h" -#include "QF/darray.h" -#include "QF/image.h" -#include "QF/render.h" -#include "QF/skin.h" -#include "QF/sys.h" #include "QF/va.h" #include "QF/scene/entity.h" @@ -56,10 +43,7 @@ #include "QF/Vulkan/qf_alias.h" #include "QF/Vulkan/qf_matrices.h" #include "QF/Vulkan/qf_texture.h" -#include "QF/Vulkan/buffer.h" -#include "QF/Vulkan/command.h" #include "QF/Vulkan/debug.h" -#include "QF/Vulkan/descriptor.h" #include "QF/Vulkan/device.h" #include "QF/Vulkan/instance.h" #include "QF/Vulkan/renderpass.h" diff --git a/libs/video/renderer/vulkan/vulkan_matrices.c b/libs/video/renderer/vulkan/vulkan_matrices.c index 5ad3a2ca6..363ca70be 100644 --- a/libs/video/renderer/vulkan/vulkan_matrices.c +++ b/libs/video/renderer/vulkan/vulkan_matrices.c @@ -42,7 +42,6 @@ #include "QF/cvar.h" #include "QF/sys.h" #include "QF/va.h" -#include "QF/vid.h" #include "QF/Vulkan/qf_matrices.h" #include "QF/Vulkan/barrier.h" #include "QF/Vulkan/buffer.h" diff --git a/libs/video/renderer/vulkan/vulkan_vid_common.c b/libs/video/renderer/vulkan/vulkan_vid_common.c index e6c1bea5b..d5cbcfaf6 100644 --- a/libs/video/renderer/vulkan/vulkan_vid_common.c +++ b/libs/video/renderer/vulkan/vulkan_vid_common.c @@ -49,7 +49,6 @@ #include "QF/quakefs.h" #include "QF/sys.h" #include "QF/va.h" -#include "QF/vid.h" #include "QF/Vulkan/qf_matrices.h" #include "QF/Vulkan/qf_vid.h" #include "QF/Vulkan/barrier.h"