Kore 3
Loading...
Searching...
No Matches
texture.h
Go to the documentation of this file.
1#ifndef KORE_GPU_TEXTURE_HEADER
2#define KORE_GPU_TEXTURE_HEADER
3
4#include <kore3/global.h>
5
6#include "api.h"
7#include "textureformat.h"
8
9#if defined(KORE_DIRECT3D11)
10#include <kore3/direct3d11/texture_structs.h>
11#elif defined(KORE_DIRECT3D12)
12#include <kore3/direct3d12/texture_structs.h>
13#elif defined(KORE_METAL)
14#include <kore3/metal/texture_structs.h>
15#elif defined(KORE_OPENGL)
16#include <kore3/opengl/texture_structs.h>
17#elif defined(KORE_VULKAN)
18#include <kore3/vulkan/texture_structs.h>
19#elif defined(KORE_WEBGPU)
20#include <kore3/webgpu/texture_structs.h>
21#elif defined(KORE_KOMPJUTA)
22#include <kore3/kompjuta/texture_structs.h>
23#elif defined(KORE_CONSOLE)
24#include <kore3/console/texture_structs.h>
25#else
26#error ("Unknown GPU backend")
27#endif
28
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37typedef struct kore_gpu_texture {
38 uint32_t width;
39 uint32_t height;
40 kore_gpu_texture_format format;
41
42 KORE_GPU_IMPL(texture);
43
44#ifdef __cplusplus
45 kore_gpu_texture() = default;
46 kore_gpu_texture(const kore_gpu_texture &) = delete;
47 kore_gpu_texture &operator=(const kore_gpu_texture &) = delete;
48#endif
50
51typedef enum kore_gpu_texture_view_dimension {
52 KORE_GPU_TEXTURE_VIEW_DIMENSION_1D,
53 KORE_GPU_TEXTURE_VIEW_DIMENSION_2D,
54 KORE_GPU_TEXTURE_VIEW_DIMENSION_2DARRAY,
55 KORE_GPU_TEXTURE_VIEW_DIMENSION_CUBE,
56 KORE_GPU_TEXTURE_VIEW_DIMENSION_CUBEARRAY,
57 KORE_GPU_TEXTURE_VIEW_DIMENSION_3D
58} kore_gpu_texture_view_dimension;
59
60typedef enum kore_gpu_texture_aspect {
61 KORE_GPU_IMAGE_COPY_ASPECT_ALL,
62 KORE_GPU_IMAGE_COPY_ASPECT_DEPTH_ONLY,
63 KORE_GPU_IMAGE_COPY_ASPECT_STENCIL_ONLY
64} kore_gpu_texture_aspect;
65
66typedef struct kore_gpu_texture_view {
67 kore_gpu_texture *texture;
68 kore_gpu_texture_format format;
69 kore_gpu_texture_view_dimension dimension;
70 kore_gpu_texture_aspect aspect;
71 uint32_t base_mip_level;
72 uint32_t mip_level_count;
73 uint32_t base_array_layer;
74 uint32_t array_layer_count;
76
77KORE_FUNC void kore_gpu_texture_set_name(kore_gpu_texture *texture, const char *name);
78
79KORE_FUNC void kore_gpu_texture_destroy(kore_gpu_texture *texture);
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
Definition texture.h:66
Definition texture.h:37
Provides an enum containing all supported texture formats and some companion functions.