GPU: Add test for byte pattern clearing of storage buffers
This commit is contained in:
@@ -98,6 +98,30 @@ static void test_storage_buffer_clear()
|
||||
|
||||
GPU_TEST(storage_buffer_clear);
|
||||
|
||||
static void test_storage_buffer_clear_byte_pattern()
|
||||
{
|
||||
GPUStorageBuf *ssbo = GPU_storagebuf_create_ex(
|
||||
SIZE_IN_BYTES, nullptr, GPU_USAGE_STATIC, __func__);
|
||||
EXPECT_NE(ssbo, nullptr);
|
||||
|
||||
/* Tests a different clear command on Metal. */
|
||||
GPU_storagebuf_clear(ssbo, 0xFCFCFCFCu);
|
||||
|
||||
/* Read back data from SSBO. */
|
||||
Vector<int32_t> read_data;
|
||||
read_data.resize(SIZE, 0);
|
||||
GPU_storagebuf_read(ssbo, read_data.data());
|
||||
|
||||
/* Check if datatest_ is the same. */
|
||||
for (int i : IndexRange(SIZE)) {
|
||||
EXPECT_EQ(0xFCFCFCFCu, read_data[i]);
|
||||
}
|
||||
|
||||
GPU_storagebuf_free(ssbo);
|
||||
}
|
||||
|
||||
GPU_TEST(storage_buffer_clear_byte_pattern);
|
||||
|
||||
static void test_storage_buffer_copy_from_vertex_buffer()
|
||||
{
|
||||
GPUStorageBuf *ssbo = GPU_storagebuf_create_ex(
|
||||
|
||||
Reference in New Issue
Block a user