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};
73 GTEST_SKIP() <<
"OpenGL texture clearing doesn't support 1d textures.";
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() <<
"Read back of 1d texture arrays not supported by OpenGL";
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);
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);
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;
357 EXPECT_FALSE(failed);
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);
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;
416 EXPECT_FALSE(failed);
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";
666GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH32F_STENCIL8);
668#if RUN_COMPONENT_UNIMPLEMENTED
669static void test_texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH_COMPONENT16()
673GPU_TEST(texture_roundtrip__GPU_DATA_FLOAT__GPU_DEPTH_COMPONENT16);
686GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGBA16F);
692GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RG16F);
698GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_R16F);
701static void test_texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGB16F()
705GPU_TEST(texture_roundtrip__GPU_DATA_HALF_FLOAT__GPU_RGB16F);
718GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGBA8I);
724GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGBA16I);
730GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGBA32I);
736GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RG8I);
739static void test_texture_roundtrip__GPU_DATA_INT__GPU_RG16I()
743GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RG16I);
750GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RG32I);
762GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_R16I);
768GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_R32I);
771static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGB8I()
775GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGB8I);
777static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGB16I()
781GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGB16I);
783static void test_texture_roundtrip__GPU_DATA_INT__GPU_RGB32I()
787GPU_TEST(texture_roundtrip__GPU_DATA_INT__GPU_RGB32I);
800GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGBA8UI);
806GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGBA16UI);
812GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGBA32UI);
818GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RG8UI);
824GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RG16UI);
830GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RG32UI);
836GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_R8UI);
842GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_R16UI);
848GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_R32UI);
851static void test_texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH32F_STENCIL8()
855GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH32F_STENCIL8);
857static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGB8UI()
861GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGB8UI);
863static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGB16UI()
867GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGB16UI);
869static void test_texture_roundtrip__GPU_DATA_UINT__GPU_RGB32UI()
873GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_RGB32UI);
875static void test_texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT32F()
879GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT32F);
882#if RUN_COMPONENT_UNIMPLEMENTED
883static void test_texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT16()
887GPU_TEST(texture_roundtrip__GPU_DATA_UINT__GPU_DEPTH_COMPONENT16);
900GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGBA8UI);
906GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGBA8);
912GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RG8UI);
918GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RG8);
924GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_R8UI);
930GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_R8);
936GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8_A8);
939static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8I()
943GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8I);
945static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8()
949GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_RGB8);
951static void test_texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8()
955GPU_TEST(texture_roundtrip__GPU_DATA_UBYTE__GPU_SRGB8);
965static void test_texture_roundtrip__GPU_DATA_UINT_24_8__GPU_DEPTH32F_STENCIL8()
971GPU_TEST(texture_roundtrip__GPU_DATA_UINT_24_8__GPU_DEPTH32F_STENCIL8);
984GPU_TEST(texture_roundtrip__GPU_DATA_10_11_11_REV__GPU_R11F_G11F_B10F);
996GPU_TEST(texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2);
1001 GTEST_SKIP() <<
"Texture readback not supported on OpenGL";
1005GPU_TEST(texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI);
1016 const int2 sub_size(256);
1017 const int2 sub_offset(256);
1022 TextureFormat::SFLOAT_32_32_32_32,
1025 const float4 clear_color(0.0f, 0.0f, 0.0f, 0.0f);
1028 const float4 texture_color(0.0f, 1.0f, 0.0f, 1.0f);
1030 for (
int i = 0;
i < sub_size.x * sub_size.y;
i++) {
1031 texture_data[
i] = texture_color;
1038 for (
int x = 0;
x <
size.x;
x++) {
1039 for (
int y = 0;
y < sub_offset.y;
y++) {
1040 int index =
x +
y *
size.x;
1041 ASSERT_EQ(texture_data_read[index], clear_color);
1044 for (
int y = sub_offset.y;
y < sub_offset.y + sub_size.y;
y++) {
1045 for (
int x = 0;
x < sub_offset.x;
x++) {
1046 int index =
x +
y *
size.x;
1047 ASSERT_EQ(texture_data_read[index], clear_color);
1049 for (
int x = sub_offset.x;
x < sub_offset.x + sub_size.x;
x++) {
1050 int index =
x +
y *
size.x;
1051 ASSERT_EQ(texture_data_read[index], texture_color);
1053 for (
int x = sub_offset.x + sub_size.x;
x <
size.x;
x++) {
1054 int index =
x +
y *
size.x;
1055 ASSERT_EQ(texture_data_read[index], clear_color);
1058 for (
int x = 0;
x <
size.x;
x++) {
1059 for (
int y = sub_offset.y + sub_size.y;
y <
size.y;
y++) {
1060 int index =
x +
y *
size.x;
1061 ASSERT_EQ(texture_data_read[index], clear_color);
1074 const int2 sub_size(256);
1075 const int2 sub_offset(256);
1080 TextureFormat::SFLOAT_32_32_32_32,
1083 const float4 clear_color(0.0f, 0.0f, 0.0f, 0.0f);
1086 const float4 texture_color(0.0f, 1.0f, 0.0f, 1.0f);
1087 const float4 texture_color_off(1.0f, 0.0f, 0.0f, 1.0f);
1089 for (
int x = 0;
x <
size.x;
x++) {
1090 for (
int y = 0;
y <
size.y;
y++) {
1091 int index =
x +
y *
size.x;
1092 texture_data[index] = ((
x >= sub_offset.x &&
x < sub_offset.x + sub_size.x) &&
1093 (
y >= sub_offset.y &&
y < sub_offset.y + sub_size.y)) ?
1100 float4 *texture_data_offset = &texture_data[sub_offset.x + sub_offset.y *
size.x];
1106 for (
int x = 0;
x <
size.x;
x++) {
1107 for (
int y = 0;
y < sub_offset.y;
y++) {
1108 int index =
x +
y *
size.x;
1109 ASSERT_EQ(texture_data_read[index], clear_color);
1112 for (
int y = sub_offset.y;
y < sub_offset.y + sub_size.y;
y++) {
1113 for (
int x = 0;
x < sub_offset.x;
x++) {
1114 int index =
x +
y *
size.x;
1115 ASSERT_EQ(texture_data_read[index], clear_color);
1117 for (
int x = sub_offset.x;
x < sub_offset.x + sub_size.x;
x++) {
1118 int index =
x +
y *
size.x;
1119 ASSERT_EQ(texture_data_read[index], texture_color);
1121 for (
int x = sub_offset.x + sub_size.x;
x <
size.x;
x++) {
1122 int index =
x +
y *
size.x;
1123 ASSERT_EQ(texture_data_read[index], clear_color);
1126 for (
int x = 0;
x <
size.x;
x++) {
1127 for (
int y = sub_offset.y + sub_size.y;
y <
size.y;
y++) {
1128 int index =
x +
y *
size.x;
1129 ASSERT_EQ(texture_data_read[index], clear_color);
1141 const int2 size1(10);
1142 const int2 size2(20);
1143 const int2 size3(30);
1172 tex1 = test_acquire(size1, format1, usage);
1177 EXPECT_BLI_ASSERT(pool.
reset(),
"Missing texture release");
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
MINLINE float max_ff(float a, float b)
GPUBackendType GPU_backend_get_type()
@ GPU_BARRIER_TEXTURE_UPDATE
void GPU_memory_barrier(GPUBarrier barrier)
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)
void GPU_texture_copy(blender::gpu::Texture *dst, blender::gpu::Texture *src)
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)
int GPU_texture_height(const blender::gpu::Texture *texture)
blender::gpu::Texture * GPU_texture_create_cube(const char *name, int width, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
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)
blender::gpu::TextureFormat GPU_texture_format(const blender::gpu::Texture *texture)
int GPU_texture_width(const blender::gpu::Texture *texture)
@ GPU_DATA_UINT_24_8_DEPRECATED
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)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
@ GPU_TEXTURE_USAGE_HOST_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_TEXTURE_USAGE_GENERAL
void * GPU_texture_read(blender::gpu::Texture *texture, eGPUDataFormat data_format, int mip_level)
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)
void GPU_unpack_row_length_set(uint len)
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)
Read Guarded memory(de)allocation.
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void reset(bool force_free=false)
blender::gpu::Texture * acquire_texture(int width, int height, blender::gpu::TextureFormat format, eGPUTextureUsage usage)
static TexturePool & get()
void release_texture(blender::gpu::Texture *tmp_tex)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
#define GPU_TEST(test_name)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
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_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()
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)
VecBase< uint32_t, 4 > uint4
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2