20#define RUN_UNSUPPORTED false
24#define RUN_SRGB_UNIMPLEMENTED false
25#define RUN_NON_STANDARD_UNIMPLEMENTED false
26#define RUN_COMPONENT_UNIMPLEMENTED false
36 "rgba32u", 1, 1, 1, TextureFormat::UINT_32_32_32_32, usage,
nullptr);
38 "rgba16u", 1, 1, 1, TextureFormat::UINT_16_16_16_16, usage,
nullptr);
40 "rgba32f", 1, 1, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
42 const float4 fcol = {0.0f, 1.3f, -231.0f, 1000.0f};
43 const uint4 ucol = {0, 1, 2, 12223};
58 MEM_delete(rgba32u_data);
59 MEM_delete(rgba16u_data);
60 MEM_delete(rgba32f_data);
73 GTEST_SKIP() <<
"Clearing 1d textures not supported by OpenGL & Metal";
81 "tex",
SIZE, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
82 float4 clear_color(0.9f, 0.7f, 0.2f, 1.0f);
102 GTEST_SKIP() <<
"Clearing 1d textures not supported by OpenGL & Metal";
104 const int LAYERS = 8;
111 "tex",
SIZE, LAYERS, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
112 float4 clear_color(1.0f, 0.5f, 0.2f, 1.0f);
132 GTEST_SKIP() <<
"Read back of 1d texture arrays not supported by OpenGL";
134 const int LAYERS = 8;
138 int total_size = LAYERS *
SIZE * 4;
143 "tex",
SIZE, LAYERS, 1, TextureFormat::SFLOAT_32_32_32_32, usage, data_in);
150 EXPECT_EQ(memcmp(data_in, data_out,
sizeof(
float) * total_size), 0);
152 MEM_delete(data_out);
160 const int LAYERS = 8;
166 "tex",
SIZE,
SIZE, LAYERS, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
167 float4 clear_color(1.0f, 0.5f, 0.2f, 1.0f);
186 const int LAYERS = 8;
190 int total_size = LAYERS *
SIZE *
SIZE * 4;
195 "tex",
SIZE,
SIZE, LAYERS, 1, TextureFormat::SFLOAT_32_32_32_32, usage, data_in);
202 EXPECT_EQ(memcmp(data_in, data_out,
sizeof(
float) * total_size), 0);
204 MEM_delete(data_out);
217 "tex",
SIZE, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
218 float4 clear_color(1.0f, 0.5f, 0.2f, 1.0f);
237 const int LAYERS = 2;
243 "tex",
SIZE, LAYERS, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
244 float4 clear_color(1.0f, 0.5f, 0.2f, 1.0f);
266 "tex",
SIZE,
SIZE,
SIZE, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
267 float4 clear_color(1.0f, 0.5f, 0.2f, 1.0f);
286 const int SIZE = 128;
291 "src",
SIZE,
SIZE, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
293 "dst",
SIZE,
SIZE, 1, TextureFormat::SFLOAT_32_32_32_32, usage,
nullptr);
296 const float4 clear_color(0.0f);
321 if (std::is_same<DataType, float>()) {
331template<TextureFormat DeviceFormat, eGPUDataFormat HostFormat,
typename DataType,
int Size = 16>
334 static_assert(!std::is_same<DataType, float>());
338 "texture",
Size,
Size, 1, DeviceFormat, usage,
nullptr);
340 GTEST_SKIP() <<
"Platform doesn't support texture format [" <<
STRINGIFY(DeviceFormat) <<
"]";
354 bool ok = (read_data[i] -
data[i]) == 0;
359 MEM_delete(read_data);
365template<TextureFormat DeviceFormat, eGPUDataFormat HostFormat,
int Size = 16>
371 "texture",
Size,
Size, 1, DeviceFormat, usage,
nullptr);
373 GTEST_SKIP() <<
"Platform doesn't support texture format [" <<
STRINGIFY(DeviceFormat) <<
"]";
381 float max_used_bias = 0.0f;
383 float bias =
abs(read_data[i] -
data[i]);
384 max_used_bias =
max_ff(max_used_bias, bias);
386 EXPECT_LE(max_used_bias, max_allowed_bias);
388 MEM_delete(read_data);
396template<TextureFormat DeviceFormat, eGPUDataFormat HostFormat,
int Size = 16>
403 "texture",
Size,
Size, 1, DeviceFormat, usage,
nullptr);
413 bool ok = (read_data[i] -
data[i]) == 0;
418 MEM_delete(read_data);
431GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8);
437GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA16F);
443GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA16);
449GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA32F);
455GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RG8);
461GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RG16F);
467GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RG16);
473GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RG32F);
479GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R8);
485GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R16F);
491GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R16);
497GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R32F);
499#if RUN_NON_STANDARD_UNIMPLEMENTED
500static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB10_A2()
504GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB10_A2);
506static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB10_A2UI()
510GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB10_A2UI);
517GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R11F_G11F_B10F);
523GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8);
529GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_SNORM);
535GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA16_SNORM);
538static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB8()
542GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB8);
544static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB8_SNORM()
548GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB8_SNORM);
550static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB16F()
554GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB16F);
556static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB16()
560GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB16);
561static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB16_SNORM()
565GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB16_SNORM);
567static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB32F()
571GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB32F);
578GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RG8_SNORM);
584GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RG16_SNORM);
590GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R8_SNORM);
596GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_R16_SNORM);
598#if RUN_NON_STANDARD_UNIMPLEMENTED
599static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8_DXT1()
603GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8_DXT1);
605static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8_DXT3()
609GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8_DXT3);
611static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8_DXT5()
615GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8_DXT5);
617static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_DXT1()
621GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_DXT1);
623static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_DXT3()
627GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_DXT3);
629static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_DXT5()
633GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_DXT5);
636#if RUN_SRGB_UNIMPLEMENTED
637static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8()
641GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8);
644#if RUN_NON_STANDARD_UNIMPLEMENTED
645static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB9_E5()
649GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_RGB9_E5);
656GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH_COMPONENT32F);
661 GTEST_SKIP() <<
"Float based texture readback not supported on OpenGL";
665 <<
"Current test uses a range that is outside of [0,1], this is only supported "
666 "when enabling `VK_EXT_depth_range_unrestricted`. We should fix this test case.";
671GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH32F_STENCIL8);
673#if RUN_COMPONENT_UNIMPLEMENTED
674static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH_COMPONENT16()
678GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH_COMPONENT16);
691GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGBA16F);
697GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RG16F);
703GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_R16F);
706static void test_texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGB16F()
710GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGB16F);
723GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGBA8I);
729GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGBA16I);
735GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGBA32I);
741GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RG8I);
747GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RG16I);
753GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RG32I);
765GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_R16I);
771GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_R32I);
774static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGB8I()
778GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGB8I);
780static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGB16I()
784GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGB16I);
786static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGB32I()
790GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGB32I);
803GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGBA8UI);
809GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGBA16UI);
815GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGBA32UI);
821GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RG8UI);
827GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RG16UI);
833GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RG32UI);
839GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_R8UI);
845GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_R16UI);
851GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_R32UI);
854static void test_texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH32F_STENCIL8()
858GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH32F_STENCIL8);
860static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGB8UI()
864GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGB8UI);
866static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGB16UI()
870GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGB16UI);
872static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGB32UI()
876GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGB32UI);
878static void test_texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT32F()
882GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT32F);
885#if RUN_COMPONENT_UNIMPLEMENTED
886static void test_texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT16()
890GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT16);
903GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGBA8UI);
909GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGBA8);
915GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RG8UI);
921GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RG8);
927GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_R8UI);
933GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_R8);
939GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8_A8);
942static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8I()
946GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8I);
948static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8()
952GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8);
954static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8()
958GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8);
968static void test_texture_roundtrip__GPU_DATA_UINT_24_8__GPU_DEPTH32F_STENCIL8()
974GPU_TEST(texture_roundtrip__GPU_DATA_UINT_24_8__GPU_DEPTH32F_STENCIL8);
987GPU_TEST(texture_roundtrip__GPU_DATA_10_11_11_REV__GPU_R11F_G11F_B10F);
999GPU_TEST(texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2);
1004 GTEST_SKIP() <<
"Texture readback not supported on OpenGL";
1008GPU_TEST(texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI);
1018 const int2 size(1024);
1019 const int2 sub_size(256);
1020 const int2 sub_offset(256);
1025 TextureFormat::SFLOAT_32_32_32_32,
1028 const float4 clear_color(0.0f, 0.0f, 0.0f, 0.0f);
1031 const float4 texture_color(0.0f, 1.0f, 0.0f, 1.0f);
1033 for (
int i = 0; i < sub_size.x * sub_size.y; i++) {
1034 texture_data[i] = texture_color;
1041 for (
int x = 0;
x < size.x;
x++) {
1042 for (
int y = 0;
y < sub_offset.y;
y++) {
1044 ASSERT_EQ(texture_data_read[
index], clear_color);
1047 for (
int y = sub_offset.y;
y < sub_offset.y + sub_size.y;
y++) {
1048 for (
int x = 0;
x < sub_offset.x;
x++) {
1050 ASSERT_EQ(texture_data_read[
index], clear_color);
1052 for (
int x = sub_offset.x;
x < sub_offset.x + sub_size.x;
x++) {
1054 ASSERT_EQ(texture_data_read[
index], texture_color);
1056 for (
int x = sub_offset.x + sub_size.x;
x < size.x;
x++) {
1058 ASSERT_EQ(texture_data_read[
index], clear_color);
1061 for (
int x = 0;
x < size.x;
x++) {
1062 for (
int y = sub_offset.y + sub_size.y;
y < size.y;
y++) {
1064 ASSERT_EQ(texture_data_read[
index], clear_color);
1068 MEM_delete(texture_data);
1069 MEM_delete(texture_data_read);
1076 const int2 size(1024);
1077 const int2 sub_size(256);
1078 const int2 sub_offset(256);
1083 TextureFormat::SFLOAT_32_32_32_32,
1086 const float4 clear_color(0.0f, 0.0f, 0.0f, 0.0f);
1089 const float4 texture_color(0.0f, 1.0f, 0.0f, 1.0f);
1090 const float4 texture_color_off(1.0f, 0.0f, 0.0f, 1.0f);
1092 for (
int x = 0;
x < size.x;
x++) {
1093 for (
int y = 0;
y < size.y;
y++) {
1095 texture_data[
index] = ((
x >= sub_offset.x &&
x < sub_offset.x + sub_size.x) &&
1096 (
y >= sub_offset.y &&
y < sub_offset.y + sub_size.y)) ?
1102 float4 *texture_data_offset = &texture_data[sub_offset.x + sub_offset.y * size.x];
1105 texture_data_offset,
1113 for (
int x = 0;
x < size.x;
x++) {
1114 for (
int y = 0;
y < sub_offset.y;
y++) {
1116 ASSERT_EQ(texture_data_read[
index], clear_color);
1119 for (
int y = sub_offset.y;
y < sub_offset.y + sub_size.y;
y++) {
1120 for (
int x = 0;
x < sub_offset.x;
x++) {
1122 ASSERT_EQ(texture_data_read[
index], clear_color);
1124 for (
int x = sub_offset.x;
x < sub_offset.x + sub_size.x;
x++) {
1126 ASSERT_EQ(texture_data_read[
index], texture_color);
1128 for (
int x = sub_offset.x + sub_size.x;
x < size.x;
x++) {
1130 ASSERT_EQ(texture_data_read[
index], clear_color);
1133 for (
int x = 0;
x < size.x;
x++) {
1134 for (
int y = sub_offset.y + sub_size.y;
y < size.y;
y++) {
1136 ASSERT_EQ(texture_data_read[
index], clear_color);
1140 MEM_delete(texture_data);
1141 MEM_delete(texture_data_read);
1148 const int2 size1(10);
1149 const int2 size2(20);
1150 const int2 size3(30);
1170 gpu::Texture *tex1 = test_acquire(size1, format1, usage);
1171 gpu::Texture *tex2 = test_acquire(size2, format1, usage);
1172 gpu::Texture *tex3 = test_acquire(size3, format2, usage);
1173 gpu::Texture *tex4 = test_acquire(size3, format3, usage);
1179 tex1 = test_acquire(size1, format1, usage);
1184 EXPECT_BLI_ASSERT(pool.
reset(),
"Missing texture release");
Read Blender memory allocation and freeing.
constexpr IndexRange()=default
virtual void reset(bool force_free=false)=0
virtual void release_texture(Texture *tex)=0
virtual Texture * acquire_texture_2d(int2 extent, int mip_len, TextureFormat format, eGPUTextureUsage usage, const char *name=nullptr)=0
static TexturePool & get()
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
#define EXPECT_FALSE(result)
#define EXPECT_LE(result, expect)
#define GPU_TEST(test_name)
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_R8()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_R32UI()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_R16I()
static void test_texture_1d()
static void test_texture_1d_array_upload()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGBA32I()
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RG8UI()
static void test_texture_cube()
static void test_texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGBA16F()
static void test_texture_3d()
static constexpr int Size
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGBA16UI()
static DataType * generate_test_data(size_t data_len)
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RG8UI()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_RG32I()
static void test_texture_copy()
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_R8UI()
static void test_texture_2d_array_upload()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA16F()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA32F()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R32F()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_R8I()
static void texture_create_upload_read_with_bias(float max_allowed_bias)
static void test_texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R16F()
static void test_texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_R16F()
static void test_texture_update_sub_unpack_row_length()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R16()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGBA32UI()
static void test_texture_roundtrip__GPU_DATA_10_11_11_REV__GPU_R11F_G11F_B10F()
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RG8()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_R8UI()
static void test_texture_1d_array()
static void test_texture_update_sub_no_unpack_row_length()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R16_SNORM()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_RG16I()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH_COMPONENT32F()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RG16_SNORM()
static void test_texture_read()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_R16UI()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R11F_G11F_B10F()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8_SNORM()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA16()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH32F_STENCIL8()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGBA8I()
static void test_texture_2d_array()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RG32F()
static void test_texture_cube_array()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RG16()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGBA8UI()
static void texture_create_upload_read_pixel()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_R32I()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_SRGB8_A8()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA8()
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RGBA8UI()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_RG8I()
static void texture_create_upload_read()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RG16UI()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RG16F()
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8_A8()
static void test_texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2()
static void test_texture_pool()
GPU_TEST(compute_indirect)
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R8()
static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RGBA8()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RG8_SNORM()
static void test_texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RG16F()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RG8()
static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGBA16I()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_R8_SNORM()
static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_RGBA16_SNORM()
static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RG32UI()
int to_bytesize(const DataFormat format)
int to_component_len(TextureFormat format)
constexpr bool validate_data_format(TextureFormat tex_format, eGPUDataFormat data_format)
gpu::Texture * GPU_texture_create_cube_array(const char *name, int width, int layer_len, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * GPU_texture_create_1d(const char *name, int width, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_update(gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
gpu::TextureFormat GPU_texture_format(const gpu::Texture *texture)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
GPUBackendType GPU_backend_get_type()
@ GPU_DATA_UINT_24_8_DEPRECATED
VecBase< uint32_t, 4 > uint4
void GPU_texture_copy(gpu::Texture *dst, gpu::Texture *src)
gpu::Texture * GPU_texture_create_2d_array(const char *name, int width, int height, int layer_len, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_update_sub(gpu::Texture *texture, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth, uint unpack_row_length=0)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
@ GPU_TEXTURE_USAGE_GENERAL
@ GPU_TEXTURE_USAGE_HOST_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
void GPU_memory_barrier(GPUBarrier barrier)
BMesh const char void * data
gpu::Texture * GPU_texture_create_3d(const char *name, int width, int height, int depth, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const void *data)
int GPU_texture_width(const gpu::Texture *texture)
@ GPU_BARRIER_TEXTURE_UPDATE
gpu::Texture * GPU_texture_create_cube(const char *name, int width, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void GPU_texture_clear(gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
int GPU_texture_height(const gpu::Texture *texture)
MINLINE float max_ff(float a, float b)
void GPU_texture_free(gpu::Texture *texture)
void * GPU_texture_read(gpu::Texture *texture, eGPUDataFormat data_format, int mip_level)
gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * GPU_texture_create_1d_array(const char *name, int width, int layer_len, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1