common: switch to explicit includes

Since we no longer need the GCC pragma for symbol visibility, there's
also no more reason to have common.h import everything under the sun -
so only have modules import what they actually use.

This speeds up compilation a tiny bit.
parent 6835ae5d
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <math.h> #include <math.h>
#include "common.h" #include "common.h"
#include <libplacebo/colorspace.h>
bool pl_color_system_is_ycbcr_like(enum pl_color_system sys) bool pl_color_system_is_ycbcr_like(enum pl_color_system sys)
{ {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
#include "common.h" #include "common.h"
#include <libplacebo/common.h>
void pl_rect2d_normalize(struct pl_rect2d *rc) void pl_rect2d_normalize(struct pl_rect2d *rc)
{ {
......
...@@ -28,24 +28,6 @@ ...@@ -28,24 +28,6 @@
#include "config.h" #include "config.h"
#include "pl_assert.h" #include "pl_assert.h"
#include "include/libplacebo/colorspace.h"
#include "include/libplacebo/common.h"
#include "include/libplacebo/context.h"
#include "include/libplacebo/dispatch.h"
#include "include/libplacebo/dither.h"
#include "include/libplacebo/filters.h"
#include "include/libplacebo/gpu.h"
#include "include/libplacebo/renderer.h"
#include "include/libplacebo/shaders.h"
#include "include/libplacebo/shaders/colorspace.h"
#include "include/libplacebo/shaders/sampling.h"
#include "include/libplacebo/swapchain.h"
#include "include/libplacebo/utils/upload.h"
#if PL_HAVE_VULKAN
#include "include/libplacebo/vulkan.h"
#endif
// Align up to the nearest multiple of an arbitrary alignment, which may also // Align up to the nearest multiple of an arbitrary alignment, which may also
// be 0 to signal no alignment requirements. // be 0 to signal no alignment requirements.
#define PL_ALIGN(x, align) ((align) ? ((x) + (align) - 1) / (align) * (align) : (x)) #define PL_ALIGN(x, align) ((align) ? ((x) + (align) - 1) / (align) * (align) : (x))
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "bstr/bstr.h" #include "bstr/bstr.h"
#include "common.h" #include "common.h"
#include <libplacebo/context.h>
struct pl_context { struct pl_context {
struct pl_context_params params; struct pl_context_params params;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#pragma once #pragma once
#include "common.h" #include "common.h"
#include <libplacebo/dispatch.h>
// Like `pl_dispatch_begin`, but has an extra `unique` parameter. If this is // Like `pl_dispatch_begin`, but has an extra `unique` parameter. If this is
// true, the generated shader will be uniquely namespaced `unique` and may be // true, the generated shader will be uniquely namespaced `unique` and may be
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <math.h> #include <math.h>
#include "common.h" #include "common.h"
#include <libplacebo/dither.h>
void pl_generate_bayer_matrix(float *data, int size) void pl_generate_bayer_matrix(float *data, int size)
{ {
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "common.h" #include "common.h"
#include "context.h" #include "context.h"
#include <libplacebo/filters.h>
bool pl_filter_function_eq(const struct pl_filter_function *a, bool pl_filter_function_eq(const struct pl_filter_function *a,
const struct pl_filter_function *b) const struct pl_filter_function *b)
{ {
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#pragma once #pragma once
#include "common.h" #include "common.h"
#include <libplacebo/gpu.h>
#include <libplacebo/dispatch.h>
#define GPU_PFN(name) __typeof__(pl_##name) *name #define GPU_PFN(name) __typeof__(pl_##name) *name
struct pl_gpu_fns { struct pl_gpu_fns {
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "common.h" #include "common.h"
#include "bstr/bstr.h" #include "bstr/bstr.h"
#include <libplacebo/shaders/colorspace.h>
// Compute a transformation from one color profile to another, and fill the // Compute a transformation from one color profile to another, and fill the
// provided array by the resulting 3DLUT. The array must have room for four // provided array by the resulting 3DLUT. The array must have room for four
// components per sample. // components per sample.
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "shaders.h" #include "shaders.h"
#include "dispatch.h" #include "dispatch.h"
#include <libplacebo/renderer.h>
enum { enum {
// The scalers for each plane are set up to be just the index itself // The scalers for each plane are set up to be just the index itself
SCALER_PLANE0 = 0, SCALER_PLANE0 = 0,
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "context.h" #include "context.h"
#include "gpu.h" #include "gpu.h"
#include <libplacebo/shaders.h>
// This represents an identifier (e.g. name of function, uniform etc.) for // This represents an identifier (e.g. name of function, uniform etc.) for
// a shader resource. The generated identifiers are immutable, but only live // a shader resource. The generated identifiers are immutable, but only live
// until pl_shader_reset - so make copies when passing to external stuff. // until pl_shader_reset - so make copies when passing to external stuff.
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
#include <math.h> #include <math.h>
#include "shaders.h" #include "shaders.h"
#include <libplacebo/dither.h>
#include <libplacebo/shaders/colorspace.h>
void pl_shader_decode_color(struct pl_shader *sh, struct pl_color_repr *repr, void pl_shader_decode_color(struct pl_shader *sh, struct pl_color_repr *repr,
const struct pl_color_adjustment *params) const struct pl_color_adjustment *params)
{ {
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <math.h> #include <math.h>
#include "shaders.h" #include "shaders.h"
#include <libplacebo/shaders/sampling.h>
const struct pl_deband_params pl_deband_default_params = { const struct pl_deband_params pl_deband_default_params = {
.iterations = 1, .iterations = 1,
.threshold = 4.0, .threshold = 4.0,
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "common.h" #include "common.h"
#include "context.h" #include "context.h"
#include <libplacebo/gpu.h>
enum glsl_shader_stage { enum glsl_shader_stage {
GLSL_SHADER_VERTEX, GLSL_SHADER_VERTEX,
GLSL_SHADER_FRAGMENT, GLSL_SHADER_FRAGMENT,
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#pragma once #pragma once
#include "common.h" #include "common.h"
#include <libplacebo/swapchain.h>
#define SW_PFN(name) __typeof__(pl_swapchain_##name) *name #define SW_PFN(name) __typeof__(pl_swapchain_##name) *name
struct pl_sw_fns { struct pl_sw_fns {
......
#include "tests.h" #include "tests.h"
#include <sys/time.h> #include <sys/time.h>
#include <libplacebo/dispatch.h>
#include <libplacebo/shaders/colorspace.h>
#include <libplacebo/shaders/sampling.h>
#include <libplacebo/vulkan.h>
#define TEX_SIZE 2048 #define TEX_SIZE 2048
#define CUBE_SIZE 64 #define CUBE_SIZE 64
#define NUM_FBOS 10 #define NUM_FBOS 10
......
#include "tests.h" #include "tests.h"
#include <libplacebo/colorspace.h>
int main() int main()
{ {
......
#include "tests.h" #include "tests.h"
#include <libplacebo/dither.h>
#define SHIFT 4 #define SHIFT 4
#define SIZE (1 << SHIFT) #define SIZE (1 << SHIFT)
......
#include "tests.h" #include "tests.h"
#include <libplacebo/filters.h>
int main() int main()
{ {
......
#include "tests.h" #include "tests.h"
#include "shaders.h" #include "shaders.h"
#include <libplacebo/gpu.h>
#include <libplacebo/renderer.h>
#include <libplacebo/shaders/colorspace.h>
#include <libplacebo/shaders/sampling.h>
#include <libplacebo/utils/upload.h>
static void pl_test_roundtrip(const struct pl_gpu *gpu, const struct pl_tex *tex, static void pl_test_roundtrip(const struct pl_gpu *gpu, const struct pl_tex *tex,
float *src, float *dst) float *src, float *dst)
{ {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#pragma once #pragma once
#include "common.h" #include "common.h"
#include <libplacebo/context.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
#include "tests.h" #include "tests.h"
#include "gpu.h" #include "gpu.h"
#include <libplacebo/utils/upload.h>
int main() int main()
{ {
struct pl_plane_data data = {0}; struct pl_plane_data data = {0};
......
#include "gpu_tests.h" #include "gpu_tests.h"
#include <libplacebo/vulkan.h>
int main() int main()
{ {
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "common.h" #include "common.h"
#include "gpu.h" #include "gpu.h"
#include <libplacebo/utils/upload.h>
struct comp { struct comp {
int order; // e.g. 0, 1, 2, 3 for RGBA int order; // e.g. 0, 1, 2, 3 for RGBA
int size; // size in bits int size; // size in bits
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "../common.h" #include "../common.h"
#include "../context.h" #include "../context.h"
#include <libplacebo/vulkan.h>
// Vulkan allows the optional use of a custom allocator. We don't need one but // Vulkan allows the optional use of a custom allocator. We don't need one but
// mark this parameter with a better name in case we ever decide to change this // mark this parameter with a better name in case we ever decide to change this
// in the future. (And to make the code more readable) // in the future. (And to make the code more readable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment