Blender V5.0
GPU_texture.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12
13#pragma once
14
15#include <string>
16
17#include "BLI_assert.h"
18#include "BLI_utildefines.h"
19
20#include "GPU_format.hh"
21
22namespace blender::gpu {
23class VertBuf;
24}
25
26namespace blender::gpu {
27
28/* -------------------------------------------------------------------- */
31
35enum class TextureFormat : uint8_t {
37
38#define DECLARE(a, b, c, blender_enum, d, e, f, g, h) blender_enum = int(DataFormat::blender_enum),
39
40#define GPU_TEXTURE_FORMAT_EXPAND(impl) \
41 SNORM_8_(impl) \
42 SNORM_8_8_(impl) \
43 SNORM_8_8_8_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
44 SNORM_8_8_8_8_(impl) \
45\
46 SNORM_16_(impl) \
47 SNORM_16_16_(impl) \
48 SNORM_16_16_16_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
49 SNORM_16_16_16_16_(impl) \
50\
51 UNORM_8_(impl) \
52 UNORM_8_8_(impl) \
53 UNORM_8_8_8_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
54 UNORM_8_8_8_8_(impl) \
55\
56 UNORM_16_(impl) \
57 UNORM_16_16_(impl) \
58 UNORM_16_16_16_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
59 UNORM_16_16_16_16_(impl) \
60\
61 SINT_8_(impl) \
62 SINT_8_8_(impl) \
63 SINT_8_8_8_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
64 SINT_8_8_8_8_(impl) \
65\
66 SINT_16_(impl) \
67 SINT_16_16_(impl) \
68 SINT_16_16_16_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
69 SINT_16_16_16_16_(impl) \
70\
71 SINT_32_(impl) \
72 SINT_32_32_(impl) \
73 SINT_32_32_32_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
74 SINT_32_32_32_32_(impl) \
75\
76 UINT_8_(impl) \
77 UINT_8_8_(impl) \
78 UINT_8_8_8_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
79 UINT_8_8_8_8_(impl) \
80\
81 UINT_16_(impl) \
82 UINT_16_16_(impl) \
83 UINT_16_16_16_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
84 UINT_16_16_16_16_(impl) \
85\
86 UINT_32_(impl) \
87 UINT_32_32_(impl) \
88 UINT_32_32_32_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
89 UINT_32_32_32_32_(impl) \
90\
91 SFLOAT_16_(impl) \
92 SFLOAT_16_16_(impl) \
93 SFLOAT_16_16_16_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
94 SFLOAT_16_16_16_16_(impl) \
95\
96 SFLOAT_32_(impl) \
97 SFLOAT_32_32_(impl) \
98 SFLOAT_32_32_32_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
99 SFLOAT_32_32_32_32_(impl) \
100\
101 UNORM_10_10_10_2_(impl) \
102 UINT_10_10_10_2_(impl) \
103\
104 UFLOAT_11_11_10_(impl) \
105 UFLOAT_9_9_9_EXP_5_(impl) \
106\
107 UNORM_16_DEPTH_(impl) \
108 SFLOAT_32_DEPTH_(impl) \
109 SFLOAT_32_DEPTH_UINT_8_(impl) \
110\
111 SRGBA_8_8_8_(impl) /* TODO(fclem): Incompatible with metal, to remove. */ \
112 SRGBA_8_8_8_8_(impl) \
113\
114 SNORM_DXT1_(impl) \
115 SNORM_DXT3_(impl) \
116 SNORM_DXT5_(impl) \
117 SRGB_DXT1_(impl) \
118 SRGB_DXT3_(impl) \
119 SRGB_DXT5_(impl)
120
122
123#undef DECLARE
124};
125
127{
128 return DataFormat(int(format));
129}
130
134enum class TextureTargetFormat : uint8_t {
136
137#define DECLARE(a, b, c, blender_enum, d, e, f, g, h) \
138 blender_enum = int(TextureFormat::blender_enum),
139
140#define GPU_TEXTURE_TARGET_FORMAT_EXPAND(impl) \
141 UNORM_8_(impl) \
142 UNORM_8_8_(impl) \
143 UNORM_8_8_8_8_(impl) \
144\
145 UNORM_16_(impl) \
146 UNORM_16_16_(impl) \
147 UNORM_16_16_16_16_(impl) \
148\
149 SINT_8_(impl) \
150 SINT_8_8_(impl) \
151 SINT_8_8_8_8_(impl) \
152\
153 SINT_16_(impl) \
154 SINT_16_16_(impl) \
155 SINT_16_16_16_16_(impl) \
156\
157 SINT_32_(impl) \
158 SINT_32_32_(impl) \
159 SINT_32_32_32_32_(impl) \
160\
161 UINT_8_(impl) \
162 UINT_8_8_(impl) \
163 UINT_8_8_8_8_(impl) \
164\
165 UINT_16_(impl) \
166 UINT_16_16_(impl) \
167 UINT_16_16_16_16_(impl) \
168\
169 UINT_32_(impl) \
170 UINT_32_32_(impl) \
171 UINT_32_32_32_32_(impl) \
172\
173 SFLOAT_16_(impl) \
174 SFLOAT_16_16_(impl) \
175 SFLOAT_16_16_16_16_(impl) \
176\
177 SFLOAT_32_(impl) \
178 SFLOAT_32_32_(impl) \
179 SFLOAT_32_32_32_32_(impl) \
180\
181 UNORM_10_10_10_2_(impl) \
182 UINT_10_10_10_2_(impl) \
183\
184 UFLOAT_11_11_10_(impl) \
185\
186 UNORM_16_DEPTH_(impl) \
187 SFLOAT_32_DEPTH_(impl) \
188 SFLOAT_32_DEPTH_UINT_8_(impl) \
189\
190 SRGBA_8_8_8_8_(impl)
191
193
194#undef DECLARE
195};
196
198{
199 return TextureFormat(int(format));
200}
201
205enum class TextureWriteFormat : uint8_t {
207
208#define DECLARE(a, b, c, blender_enum, d, e, f, g, h) \
209 blender_enum = int(TextureFormat::blender_enum),
210
211#define GPU_TEXTURE_WRITE_FORMAT_EXPAND(impl) \
212 UNORM_8_(impl) \
213 UNORM_8_8_(impl) \
214 UNORM_8_8_8_8_(impl) \
215\
216 UNORM_16_(impl) \
217 UNORM_16_16_(impl) \
218 UNORM_16_16_16_16_(impl) \
219\
220 SINT_8_(impl) \
221 SINT_8_8_(impl) \
222 SINT_8_8_8_8_(impl) \
223\
224 SINT_16_(impl) \
225 SINT_16_16_(impl) \
226 SINT_16_16_16_16_(impl) \
227\
228 SINT_32_(impl) \
229 SINT_32_32_(impl) \
230 SINT_32_32_32_32_(impl) \
231\
232 UINT_8_(impl) \
233 UINT_8_8_(impl) \
234 UINT_8_8_8_8_(impl) \
235\
236 UINT_16_(impl) \
237 UINT_16_16_(impl) \
238 UINT_16_16_16_16_(impl) \
239\
240 UINT_32_(impl) \
241 UINT_32_32_(impl) \
242 UINT_32_32_32_32_(impl) \
243\
244 SFLOAT_16_(impl) \
245 SFLOAT_16_16_(impl) \
246 SFLOAT_16_16_16_16_(impl) \
247\
248 SFLOAT_32_(impl) \
249 SFLOAT_32_32_(impl) \
250 SFLOAT_32_32_32_32_(impl) \
251\
252 UNORM_10_10_10_2_(impl) \
253 UINT_10_10_10_2_(impl) \
254\
255 UFLOAT_11_11_10_(impl)
256
258
259#undef DECLARE
260};
261
263{
264 return TextureFormat(int(format));
265}
266
268
269} // namespace blender::gpu
270
271/* -------------------------------------------------------------------- */
274
310
312
313
317 1;
318
339
340#define GPU_SAMPLER_EXTEND_MODES_COUNT (GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER + 1)
341
376
377#define GPU_SAMPLER_CUSTOM_TYPES_COUNT (GPU_SAMPLER_CUSTOM_ICON + 1)
378
404
437
454
471
487
505
510 {
511 this->filtering = this->filtering | filtering_flags;
512 }
513
518 {
519 this->filtering = this->filtering & ~filtering_flags;
520 }
521
526 void set_filtering_flag_from_test(GPUSamplerFiltering filtering_flags, bool test)
527 {
528 if (test) {
529 this->enable_filtering_flag(filtering_flags);
530 }
531 else {
532 this->disable_filtering_flag(filtering_flags);
533 }
534 }
535
536 std::string to_string() const
537 {
539 return "internal";
540 }
541
542 if (this->type == GPU_SAMPLER_STATE_TYPE_CUSTOM) {
543 switch (this->custom_type) {
545 return "compare";
546 break;
548 return "icon";
549 break;
550 default:
552 return "";
553 }
554 }
555
556 /* The sampler state is of type PARAMETERS, so serialize the parameters. */
558 std::string serialized_parameters;
559
561 serialized_parameters += "linear-filter_";
562 }
563
565 serialized_parameters += "mipmap_";
566 }
567
569 serialized_parameters += "anisotropic_";
570 }
571
572 switch (this->extend_x) {
574 serialized_parameters += "extend-x_";
575 break;
577 serialized_parameters += "repeat-x_";
578 break;
580 serialized_parameters += "mirrored-repeat-x_";
581 break;
583 serialized_parameters += "clamp-to-border-x_";
584 break;
585 default:
587 }
588
589 switch (this->extend_yz) {
591 serialized_parameters += "extend-y_";
592 break;
594 serialized_parameters += "repeat-y_";
595 break;
597 serialized_parameters += "mirrored-repeat-y_";
598 break;
600 serialized_parameters += "clamp-to-border-y_";
601 break;
602 default:
604 }
605
606 switch (this->extend_yz) {
608 serialized_parameters += "extend-z";
609 break;
611 serialized_parameters += "repeat-z";
612 break;
614 serialized_parameters += "mirrored-repeat-z";
615 break;
617 serialized_parameters += "clamp-to-border-z";
618 break;
619 default:
621 }
622
623 return serialized_parameters;
624 }
625
626 uint32_t as_uint() const
627 {
628 uint32_t value = filtering;
629 value = (value << 4) | extend_x;
630 value = (value << 4) | extend_yz;
631 value = (value << 8) | custom_type;
632 value = (value << 8) | type;
633 return value;
634 }
635
636 bool operator==(GPUSamplerState const &rhs) const
637 {
638 return this->filtering == rhs.filtering && this->extend_x == rhs.extend_x &&
639 this->extend_yz == rhs.extend_yz && this->custom_type == rhs.custom_type &&
640 this->type == rhs.type;
641 }
642};
643
645
646/* -------------------------------------------------------------------- */
649
656/* TODO(fclem): Replace by gpu::DataFormat. */
664 /* GPU_DATA_UINT_24_8_DEPRECATED is deprecated since Blender 5.0. It is still here as python
665 * add-ons can still use it. */
670};
671
684 /* Whether texture is sampled or read during a shader. */
686 /* Whether the texture is written to by a shader using imageStore. */
688 /* Whether a texture is used as an attachment in a frame-buffer. */
690 /* Whether a texture is used to create a texture view utilizing a different texture format to the
691 * source textures format. This includes the use of stencil views. */
693 /* Whether the texture needs to be read from by the CPU. */
695 /* When used, the texture will not have any backing storage and can solely exist as a virtual
696 * frame-buffer attachment. */
698 /* Whether a texture can support atomic operations. */
700 /* Whether a texture can be exported to other instances/processes. */
702 /* Create a texture whose usage cannot be defined prematurely.
703 * This is unoptimized and should not be used. */
706};
707
709
711
712/* -------------------------------------------------------------------- */
715
716namespace blender::gpu {
717class Texture;
718} // namespace blender::gpu
719
731 int width,
732 int mip_len,
734 eGPUTextureUsage usage,
735 const float *data);
737 int width,
738 int layer_len,
739 int mip_len,
741 eGPUTextureUsage usage,
742 const float *data);
744 int width,
745 int height,
746 int mip_len,
748 eGPUTextureUsage usage,
749 const float *data);
751 int width,
752 int height,
753 int layer_len,
754 int mip_len,
756 eGPUTextureUsage usage,
757 const float *data);
759 int width,
760 int height,
761 int depth,
762 int mip_len,
764 eGPUTextureUsage usage,
765 const void *data);
767 int width,
768 int mip_len,
770 eGPUTextureUsage usage,
771 const float *data);
773 int width,
774 int layer_len,
775 int mip_len,
777 eGPUTextureUsage usage,
778 const float *data);
785 int width,
786 int height,
787 int mip_len,
789 eGPUTextureUsage usage,
790 const void *data);
791
797 blender::gpu::VertBuf *vertex_buf);
798
805
807
808/* -------------------------------------------------------------------- */
811
819
826
827#define GPU_TEXTURE_FREE_SAFE(texture) \
828 do { \
829 if (texture != nullptr) { \
830 GPU_texture_free(texture); \
831 texture = nullptr; \
832 } \
833 } while (0)
834
836
837/* -------------------------------------------------------------------- */
840
866 blender::gpu::Texture *source_texture,
867 blender::gpu::TextureFormat view_format,
868 int mip_start,
869 int mip_len,
870 int layer_start,
871 int layer_len,
872 bool cube_as_array,
873 bool use_stencil);
874
876
877/* -------------------------------------------------------------------- */
880
889
899 eGPUDataFormat data_format,
900 const void *data);
901
914 eGPUDataFormat data_format,
915 const void *pixels,
916 int offset_x,
917 int offset_y,
918 int offset_z,
919 int width,
920 int height,
921 int depth);
922
930 int mip_level,
931 eGPUDataFormat data_format,
932 const void *pixels);
933
943 eGPUDataFormat data_format,
944 const void *data);
945
951
957
964void *GPU_texture_read(blender::gpu::Texture *texture, eGPUDataFormat data_format, int mip_level);
965
967
968/* -------------------------------------------------------------------- */
971
989
1005
1007
1008/* -------------------------------------------------------------------- */
1011
1016
1024
1032void GPU_texture_mipmap_mode(blender::gpu::Texture *texture, bool use_mipmap, bool use_filter);
1033
1039
1045
1051
1057
1074void GPU_texture_swizzle_set(blender::gpu::Texture *texture, const char swizzle[4]);
1075
1077
1078/* -------------------------------------------------------------------- */
1081
1087
1092
1097
1103
1108
1113
1118
1123
1128
1133
1138
1143
1148
1153
1158
1163
1169void GPU_texture_get_mipmap_size(blender::gpu::Texture *texture, int mip_level, int *r_size);
1170
1172
1173/* -------------------------------------------------------------------- */
1179
1188void GPU_texture_original_size_set(blender::gpu::Texture *texture, int width, int height);
1189
1194#ifndef GPU_NO_USE_PY_REFERENCES
1197#endif
1198
1200
1201/* -------------------------------------------------------------------- */
1204
1209
1214
1220
1226unsigned int GPU_texture_memory_usage_get();
1227
1231void GPU_samplers_update();
1232
1234
1235/* -------------------------------------------------------------------- */
1241
1243struct GPUPixelBuffer;
1244
1248GPUPixelBuffer *GPU_pixel_buffer_create(size_t byte_size);
1249
1254void GPU_pixel_buffer_free(GPUPixelBuffer *pixel_buf);
1255
1262void *GPU_pixel_buffer_map(GPUPixelBuffer *pixel_buf);
1263
1268void GPU_pixel_buffer_unmap(GPUPixelBuffer *pixel_buf);
1269
1273size_t GPU_pixel_buffer_size(GPUPixelBuffer *pixel_buf);
1274
1289
1291
1298 eGPUDataFormat data_format,
1299 GPUPixelBuffer *pixel_buf,
1300 int offset_x,
1301 int offset_y,
1302 int offset_z,
1303 int width,
1304 int height,
1305 int depth);
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#define BLI_assert(a)
Definition BLI_assert.h:46
unsigned int uint
#define ENUM_OPERATORS(_type, _max)
#define DECLARE(a, b, c, blender_enum, d, e, f, g, h)
GPUSamplerCustomType
@ GPU_SAMPLER_CUSTOM_ICON
@ GPU_SAMPLER_CUSTOM_COMPARE
void GPU_texture_extend_mode_y(blender::gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
int GPU_texture_mip_count(const blender::gpu::Texture *texture)
void GPU_texture_swizzle_set(blender::gpu::Texture *texture, const char swizzle[4])
void GPU_texture_clear(blender::gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
void GPU_texture_update_sub(blender::gpu::Texture *texture, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth)
#define GPU_TEXTURE_TARGET_FORMAT_EXPAND(impl)
int GPU_texture_original_height(const blender::gpu::Texture *texture)
void GPU_pixel_buffer_unmap(GPUPixelBuffer *pixel_buf)
void GPU_texture_extend_mode_x(blender::gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
void GPU_texture_copy(blender::gpu::Texture *dst, blender::gpu::Texture *src)
blender::gpu::Texture * GPU_texture_create_view(const char *name, blender::gpu::Texture *source_texture, blender::gpu::TextureFormat view_format, int mip_start, int mip_len, int layer_start, int layer_len, bool cube_as_array, bool use_stencil)
blender::gpu::Texture * GPU_texture_create_2d_array(const char *name, int width, int height, int layer_len, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_get_mipmap_size(blender::gpu::Texture *texture, int mip_level, int *r_size)
void GPU_texture_update_sub_from_pixel_buffer(blender::gpu::Texture *texture, eGPUDataFormat data_format, GPUPixelBuffer *pixel_buf, int offset_x, int offset_y, int offset_z, int width, int height, int depth)
size_t GPU_texture_component_len(blender::gpu::TextureFormat format)
#define GPU_TEXTURE_FORMAT_EXPAND(impl)
size_t GPU_texture_dataformat_size(eGPUDataFormat data_format)
void ** GPU_texture_py_reference_get(blender::gpu::Texture *texture)
void GPU_texture_image_unbind_all()
GPUPixelBufferNativeHandle GPU_pixel_buffer_get_native_handle(GPUPixelBuffer *pixel_buf)
int GPU_texture_height(const blender::gpu::Texture *texture)
void GPU_texture_anisotropic_filter(blender::gpu::Texture *texture, bool use_aniso)
blender::gpu::Texture * GPU_texture_create_cube(const char *name, int width, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
size_t GPU_pixel_buffer_size(GPUPixelBuffer *pixel_buf)
void GPU_texture_update_mipmap(blender::gpu::Texture *texture, int mip_level, eGPUDataFormat data_format, const void *pixels)
blender::gpu::Texture * GPU_texture_create_compressed_2d(const char *name, int width, int height, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const void *data)
bool GPU_texture_has_integer_format(const blender::gpu::Texture *texture)
bool GPU_texture_has_depth_format(const blender::gpu::Texture *texture)
GPUSamplerStateType
@ GPU_SAMPLER_STATE_TYPE_CUSTOM
@ GPU_SAMPLER_STATE_TYPE_PARAMETERS
@ GPU_SAMPLER_STATE_TYPE_INTERNAL
blender::gpu::Texture * GPU_texture_create_1d_array(const char *name, int width, int layer_len, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void * GPU_pixel_buffer_map(GPUPixelBuffer *pixel_buf)
void GPU_texture_update_mipmap_chain(blender::gpu::Texture *texture)
blender::gpu::TextureFormat GPU_texture_format(const blender::gpu::Texture *texture)
int GPU_texture_original_width(const blender::gpu::Texture *texture)
void GPU_texture_unbind(blender::gpu::Texture *texture)
void GPU_pixel_buffer_free(GPUPixelBuffer *pixel_buf)
static const int GPU_SAMPLER_FILTERING_TYPES_COUNT
bool GPU_texture_has_stencil_format(const blender::gpu::Texture *texture)
int GPU_texture_width(const blender::gpu::Texture *texture)
eGPUDataFormat
@ GPU_DATA_HALF_FLOAT
@ GPU_DATA_INT
@ GPU_DATA_10_11_11_REV
@ GPU_DATA_UBYTE
@ GPU_DATA_UINT
@ GPU_DATA_UINT_24_8_DEPRECATED
@ GPU_DATA_2_10_10_10_REV
@ GPU_DATA_FLOAT
void GPU_texture_bind_ex(blender::gpu::Texture *texture, GPUSamplerState state, int unit)
bool GPU_texture_has_signed_format(const blender::gpu::Texture *texture)
void GPU_texture_original_size_set(blender::gpu::Texture *texture, int width, int height)
void GPU_texture_extend_mode(blender::gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
blender::gpu::Texture * GPU_texture_create_cube_array(const char *name, int width, int layer_len, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_mipmap_mode(blender::gpu::Texture *texture, bool use_mipmap, bool use_filter)
void GPU_texture_ref(blender::gpu::Texture *texture)
eGPUTextureUsage
@ GPU_TEXTURE_USAGE_MEMORY_EXPORT
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
@ GPU_TEXTURE_USAGE_HOST_READ
@ GPU_TEXTURE_USAGE_MEMORYLESS
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_TEXTURE_USAGE_GENERAL
@ GPU_TEXTURE_USAGE_ATOMIC
@ GPU_TEXTURE_USAGE_FORMAT_VIEW
GPUSamplerExtendMode
@ GPU_SAMPLER_EXTEND_MODE_MIRRORED_REPEAT
@ GPU_SAMPLER_EXTEND_MODE_REPEAT
@ GPU_SAMPLER_EXTEND_MODE_EXTEND
@ GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER
void * GPU_texture_read(blender::gpu::Texture *texture, eGPUDataFormat data_format, int mip_level)
void GPU_texture_image_bind(blender::gpu::Texture *texture, int unit)
bool GPU_texture_is_cube(const blender::gpu::Texture *texture)
eGPUTextureUsage GPU_texture_usage(const blender::gpu::Texture *texture)
void GPU_texture_py_reference_set(blender::gpu::Texture *texture, void **py_ref)
bool GPU_texture_has_float_format(const blender::gpu::Texture *texture)
void GPU_texture_image_unbind(blender::gpu::Texture *texture)
blender::gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
int GPU_texture_dimensions(const blender::gpu::Texture *texture)
void GPU_texture_unbind_all()
void GPU_texture_compare_mode(blender::gpu::Texture *texture, bool use_compare)
blender::gpu::Texture * GPU_texture_create_from_vertbuf(const char *name, blender::gpu::VertBuf *vertex_buf)
#define GPU_TEXTURE_WRITE_FORMAT_EXPAND(impl)
void GPU_texture_filter_mode(blender::gpu::Texture *texture, bool use_filter)
GPUPixelBuffer * GPU_pixel_buffer_create(size_t byte_size)
void GPU_unpack_row_length_set(uint len)
GPUSamplerFiltering
@ GPU_SAMPLER_FILTERING_MIPMAP
@ GPU_SAMPLER_FILTERING_ANISOTROPIC
@ GPU_SAMPLER_FILTERING_LINEAR
@ GPU_SAMPLER_FILTERING_DEFAULT
const char * GPU_texture_format_name(blender::gpu::TextureFormat format)
int GPU_texture_layer_count(const blender::gpu::Texture *texture)
void GPU_samplers_update()
void GPU_texture_bind(blender::gpu::Texture *texture, int unit)
blender::gpu::Texture * GPU_texture_create_error(int dimension, bool array)
int GPU_texture_depth(const blender::gpu::Texture *texture)
bool GPU_texture_has_normalized_format(const blender::gpu::Texture *texture)
void GPU_texture_free(blender::gpu::Texture *texture)
blender::gpu::Texture * GPU_texture_create_3d(const char *name, int width, int height, int depth, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const void *data)
blender::gpu::Texture * GPU_texture_create_1d(const char *name, int width, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_update(blender::gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
unsigned int GPU_texture_memory_usage_get()
bool GPU_texture_is_array(const blender::gpu::Texture *texture)
BMesh const char void * data
long long int int64_t
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
format
static ulong state[N]
constexpr DataFormat to_data_format(TextureFormat format)
constexpr TextureFormat to_texture_format(TextureTargetFormat format)
const char * name
GPUSamplerCustomType custom_type
GPUSamplerExtendMode extend_yz
static constexpr GPUSamplerState internal_sampler()
static constexpr GPUSamplerState icon_sampler()
static constexpr GPUSamplerState default_sampler()
uint32_t as_uint() const
GPUSamplerFiltering filtering
void enable_filtering_flag(GPUSamplerFiltering filtering_flags)
std::string to_string() const
void disable_filtering_flag(GPUSamplerFiltering filtering_flags)
GPUSamplerExtendMode extend_x
static constexpr GPUSamplerState compare_sampler()
bool operator==(GPUSamplerState const &rhs) const
GPUSamplerStateType type
void set_filtering_flag_from_test(GPUSamplerFiltering filtering_flags, bool test)
uint len