MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / test_all

Method test_all

tests/cgpu/QueueOperations/QueueOperations.cpp:60–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59template <ECGPUBackend backend>
60void QueueOperations<backend>::test_all()
61{
62 SUBCASE("GetGraphicsQueue")
63 {
64 CGPUQueueId graphicsQueue;
65 auto gQueue = cgpu_query_queue_count(adapter, CGPU_QUEUE_TYPE_GRAPHICS);
66 if (gQueue > 0)
67 {
68 graphicsQueue = cgpu_get_queue(device, CGPU_QUEUE_TYPE_GRAPHICS, 0);
69 EXPECT_NE(graphicsQueue, CGPU_NULLPTR);
70 EXPECT_NE(graphicsQueue, nullptr);
71 cgpu_free_queue(graphicsQueue);
72 }
73 }
74
75 SUBCASE("GetSameQueue")
76 {
77 CGPUQueueId graphicsQueue;
78 CGPUQueueId graphicsQueueSame;
79 auto gQueue = cgpu_query_queue_count(adapter, CGPU_QUEUE_TYPE_GRAPHICS);
80 if (gQueue > 0)
81 {
82 graphicsQueue = cgpu_get_queue(device, CGPU_QUEUE_TYPE_GRAPHICS, 0);
83 EXPECT_NE(graphicsQueue, CGPU_NULLPTR);
84 graphicsQueueSame = cgpu_get_queue(device, CGPU_QUEUE_TYPE_GRAPHICS, 0);
85 EXPECT_EQ(graphicsQueue, graphicsQueueSame);
86 cgpu_free_queue(graphicsQueue);
87 }
88 }
89
90 SUBCASE("CreateCommands")
91 {
92 CGPUQueueId graphicsQueue;
93 auto gQueue = cgpu_query_queue_count(adapter, CGPU_QUEUE_TYPE_GRAPHICS);
94 if (gQueue > 0)
95 {
96 graphicsQueue = cgpu_get_queue(device, CGPU_QUEUE_TYPE_GRAPHICS, 0);
97 EXPECT_NE(graphicsQueue, CGPU_NULLPTR);
98 EXPECT_NE(graphicsQueue, nullptr);
99
100 auto pool = cgpu_create_command_pool(graphicsQueue, nullptr);
101 EXPECT_NE(pool, CGPU_NULLPTR);
102 {
103 SKR_DECLARE_ZERO(CGPUCommandBufferDescriptor, desc);
104 desc.is_secondary = false;
105 auto cmd = cgpu_create_command_buffer(pool, &desc);
106 EXPECT_NE(cmd, CGPU_NULLPTR);
107 cgpu_free_command_buffer(cmd);
108 }
109 cgpu_free_command_pool(pool);
110 cgpu_free_queue(graphicsQueue);
111 }
112 }
113
114 SUBCASE("TransferCmdReadback")
115 {
116 // Create Upload Buffer
117 CGPUBufferId upload_buffer, index_buffer;

Callers

nothing calls this directly

Calls 15

cgpu_query_queue_countFunction · 0.85
cgpu_get_queueFunction · 0.85
cgpu_free_queueFunction · 0.85
cgpu_create_command_poolFunction · 0.85
cgpu_free_command_bufferFunction · 0.85
cgpu_free_command_poolFunction · 0.85
cgpu_create_bufferFunction · 0.85
cgpu_cmd_beginFunction · 0.85
cgpu_cmd_endFunction · 0.85
cgpu_submit_queueFunction · 0.85

Tested by

no test coverage detected