5#include "testing/testing.h"
22static constexpr int Size = 2;
24template<GPUVertCompType comp_type, GPUVertFetchMode fetch_mode,
typename ColorType>
43 std::array<Vert, 3>
data = {
71 read_data[0] = read_data[0] * float(127);
74 read_data[0] = read_data[0] * float(255);
77 read_data[0] = read_data[0] * float(32767);
80 read_data[0] = read_data[0] * float(65535);
83 read_data[0] = read_data[0] *
float4(511, 511, 511, 1);
105 char4(100, -127, 127, 0));
107GPU_TEST(vertex_buffer_fetch_mode__GPU_COMP_I8__GPU_FETCH_INT_TO_FLOAT_UNIT);
112 uchar4(100, 0, 255, 127));
114GPU_TEST(vertex_buffer_fetch_mode__GPU_COMP_U8__GPU_FETCH_INT_TO_FLOAT_UNIT);
119 short4(12034, -32767, 32767, 0));
121GPU_TEST(vertex_buffer_fetch_mode__GPU_COMP_I16__GPU_FETCH_INT_TO_FLOAT_UNIT);
126 ushort4(12034, 0, 65535, 32767));
128GPU_TEST(vertex_buffer_fetch_mode__GPU_COMP_U16__GPU_FETCH_INT_TO_FLOAT_UNIT);
135GPU_TEST(vertex_buffer_fetch_mode__GPU_COMP_I10__GPU_FETCH_INT_TO_FLOAT_UNIT);
141GPU_TEST(vertex_buffer_fetch_mode__GPU_COMP_F32__GPU_FETCH_FLOAT);
#define BLI_assert_unreachable()
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
void GPU_batch_discard(blender::gpu::Batch *batch)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, eGPUBuiltinShader shader_id)
void GPU_batch_draw(blender::gpu::Batch *batch)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
GPUOffScreen * GPU_offscreen_create(int width, int height, bool with_depth_buffer, eGPUTextureFormat format, eGPUTextureUsage usage, bool clear, char err_out[256])
GPUTexture * GPU_offscreen_color_texture(const GPUOffScreen *offscreen)
void GPU_offscreen_free(GPUOffScreen *offscreen)
void GPU_offscreen_read_color(GPUOffScreen *offscreen, eGPUDataFormat data_format, void *r_data)
void GPU_offscreen_unbind(GPUOffScreen *offscreen, bool restore)
@ GPU_SHADER_3D_FLAT_COLOR
void GPU_texture_clear(GPUTexture *texture, eGPUDataFormat data_format, const void *data)
@ GPU_TEXTURE_USAGE_HOST_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_vert_set(blender::gpu::VertBuf *verts, uint v_idx, const void *data)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
BMesh const char void * data
struct @064345207361167251075330302113175271221317160336::@113254110077376341056327177062323111323010325277 batch
#define GPU_TEST(test_name)
static void test_vertex_buffer_fetch_mode__GPU_COMP_I8__GPU_FETCH_INT_TO_FLOAT_UNIT()
static constexpr int Size
static void test_vertex_buffer_fetch_mode__GPU_COMP_F32__GPU_FETCH_FLOAT()
static void test_vertex_buffer_fetch_mode__GPU_COMP_U16__GPU_FETCH_INT_TO_FLOAT_UNIT()
static void test_vertex_buffer_fetch_mode__GPU_COMP_I10__GPU_FETCH_INT_TO_FLOAT_UNIT()
static void test_vertex_buffer_fetch_mode__GPU_COMP_U8__GPU_FETCH_INT_TO_FLOAT_UNIT()
static void vertex_buffer_fetch_mode(ColorType color)
static void test_vertex_buffer_fetch_mode__GPU_COMP_I16__GPU_FETCH_INT_TO_FLOAT_UNIT()
VecBase< int32_t, 4 > int4
blender::VecBase< int16_t, 4 > short4
blender::VecBase< uint8_t, 4 > uchar4
VecBase< float, 4 > float4
blender::VecBase< int8_t, 4 > char4
VecBase< float, 2 > float2
blender::VecBase< uint16_t, 4 > ushort4