18 static std::string
endl;
29 bool is_recording_ =
false;
30 bool is_cpu_synchronizing_ =
false;
38 EXPECT_FALSE(is_recording_);
44 EXPECT_TRUE(is_recording_);
45 is_recording_ =
false;
50 EXPECT_FALSE(is_recording_);
51 EXPECT_FALSE(is_cpu_synchronizing_);
52 is_cpu_synchronizing_ =
true;
56 EXPECT_FALSE(is_recording_);
57 EXPECT_TRUE(is_cpu_synchronizing_);
58 is_cpu_synchronizing_ =
false;
61 void bind_pipeline(VkPipelineBindPoint pipeline_bind_point, VkPipeline pipeline)
override
63 EXPECT_TRUE(is_recording_);
65 ss <<
"bind_pipeline(";
66 ss <<
"pipeline_bind_point=" <<
to_string(pipeline_bind_point);
67 ss <<
", pipeline=" <<
to_string(pipeline);
73 VkPipelineLayout layout,
76 const VkDescriptorSet *p_descriptor_sets,
78 const uint32_t *p_dynamic_offsets)
override
87 EXPECT_TRUE(is_recording_);
89 ss <<
"bind_descriptor_sets(";
90 ss <<
"pipeline_bind_point=" <<
to_string(pipeline_bind_point);
92 ss <<
", p_descriptor_sets=" <<
to_string(p_descriptor_sets[0]);
97 void bind_index_buffer(VkBuffer buffer, VkDeviceSize offset, VkIndexType index_type)
override
100 EXPECT_TRUE(is_recording_);
101 GTEST_FAIL() << __func__ <<
" not implemented!";
106 const VkBuffer *p_buffers,
107 const VkDeviceSize *p_offsets)
override
109 UNUSED_VARS(first_binding, binding_count, p_buffers, p_offsets);
110 EXPECT_TRUE(is_recording_);
111 GTEST_FAIL() << __func__ <<
" not implemented!";
119 EXPECT_TRUE(is_recording_);
120 std::stringstream ss;
122 ss <<
"vertex_count=" << vertex_count;
123 ss <<
", instance_count=" << instance_count;
124 ss <<
", first_vertex=" << first_vertex;
125 ss <<
", first_instance=" << first_instance;
136 EXPECT_TRUE(is_recording_);
137 std::stringstream ss;
138 ss <<
"draw_indexed(";
139 ss <<
"index_count=" << index_count;
140 ss <<
", instance_count=" << instance_count;
141 ss <<
", first_index=" << first_index;
142 ss <<
", vertex_offset=" << vertex_offset;
143 ss <<
", first_instance=" << first_instance;
154 EXPECT_TRUE(is_recording_);
155 GTEST_FAIL() << __func__ <<
" not implemented!";
164 EXPECT_TRUE(is_recording_);
165 GTEST_FAIL() << __func__ <<
" not implemented!";
170 UNUSED_VARS(group_count_x, group_count_y, group_count_z);
171 EXPECT_TRUE(is_recording_);
172 std::stringstream ss;
174 ss <<
"group_count_x=" << group_count_x;
175 ss <<
", group_count_y=" << group_count_y;
176 ss <<
", group_count_z=" << group_count_z;
183 EXPECT_TRUE(is_recording_);
184 std::stringstream ss;
185 ss <<
"dispatch_indirect(";
187 ss <<
", offset=" << offset;
193 VkDeviceSize dst_offset,
194 VkDeviceSize data_size,
195 const void * )
override
197 EXPECT_TRUE(is_recording_);
198 std::stringstream ss;
199 ss <<
"update_buffer(";
200 ss <<
"dst_buffer=" <<
to_string(dst_buffer);
201 ss <<
", dst_offset=" << dst_offset;
202 ss <<
", data_size=" << data_size;
209 const VkBufferCopy *p_regions)
override
211 EXPECT_TRUE(is_recording_);
212 std::stringstream ss;
213 ss <<
"copy_buffer(";
214 ss <<
"src_buffer=" <<
to_string(src_buffer);
215 ss <<
", dst_buffer=" <<
to_string(dst_buffer);
218 ss <<
" - region(" <<
to_string(region, 1) <<
")" << std::endl;
225 VkImageLayout src_image_layout,
227 VkImageLayout dst_image_layout,
229 const VkImageCopy *p_regions)
override
231 EXPECT_TRUE(is_recording_);
232 std::stringstream ss;
234 ss <<
"src_image=" <<
to_string(src_image);
235 ss <<
", src_image_layout=" <<
to_string(src_image_layout);
236 ss <<
", dst_image=" <<
to_string(dst_image);
237 ss <<
", dst_image_layout=" <<
to_string(dst_image_layout);
240 ss <<
" - region(" <<
to_string(region, 1) <<
")" << std::endl;
247 VkImageLayout src_image_layout,
249 VkImageLayout dst_image_layout,
251 const VkImageBlit *p_regions,
252 VkFilter filter)
override
254 EXPECT_TRUE(is_recording_);
255 std::stringstream ss;
257 ss <<
"src_image=" <<
to_string(src_image);
258 ss <<
", src_image_layout=" <<
to_string(src_image_layout);
259 ss <<
", dst_image=" <<
to_string(dst_image);
260 ss <<
", dst_image_layout=" <<
to_string(dst_image_layout);
264 ss <<
" - region(" <<
to_string(region, 1) <<
")" << std::endl;
272 VkImageLayout dst_image_layout,
274 const VkBufferImageCopy *p_regions)
override
276 EXPECT_TRUE(is_recording_);
277 std::stringstream ss;
278 ss <<
"copy_buffer_to_image(";
279 ss <<
"src_buffer=" <<
to_string(src_buffer);
280 ss <<
", dst_image=" <<
to_string(dst_image);
281 ss <<
", src_image_layout=" <<
to_string(dst_image_layout);
285 ss <<
" - region(" <<
to_string(region, 1) <<
")" << std::endl;
292 VkImageLayout src_image_layout,
295 const VkBufferImageCopy *p_regions)
override
297 EXPECT_TRUE(is_recording_);
298 std::stringstream ss;
299 ss <<
"copy_image_to_buffer(";
300 ss <<
"src_image=" <<
to_string(src_image);
301 ss <<
", src_image_layout=" <<
to_string(src_image_layout);
302 ss <<
", dst_buffer=" <<
to_string(dst_buffer);
306 ss <<
" - region(" <<
to_string(region, 1) <<
")" << std::endl;
313 VkDeviceSize dst_offset,
317 EXPECT_TRUE(is_recording_);
318 std::stringstream ss;
319 ss <<
"fill_buffer(";
320 ss <<
"dst_buffer=" <<
to_string(dst_buffer);
321 ss <<
", dst_offset=" << dst_offset;
322 ss <<
", size=" <<
size;
323 ss <<
", data=" <<
data;
329 VkImageLayout image_layout,
330 const VkClearColorValue *p_color,
332 const VkImageSubresourceRange *p_ranges)
override
335 EXPECT_TRUE(is_recording_);
336 std::stringstream ss;
337 ss <<
"clear_color_image(";
339 ss <<
", image_layout=" <<
to_string(image_layout);
345 VkImageLayout image_layout,
346 const VkClearDepthStencilValue *p_depth_stencil,
348 const VkImageSubresourceRange *p_ranges)
override
350 UNUSED_VARS(image, image_layout, p_depth_stencil, range_count, p_ranges);
351 EXPECT_TRUE(is_recording_);
352 GTEST_FAIL() << __func__ <<
" not implemented!";
356 const VkClearAttachment *p_attachments,
358 const VkClearRect *p_rects)
override
360 UNUSED_VARS(attachment_count, p_attachments, rect_count, p_rects);
361 EXPECT_TRUE(is_recording_);
362 std::stringstream ss;
363 ss <<
"clear_attachments(";
364 for (
const VkClearAttachment &attachment :
367 ss <<
" - attachment(" <<
to_string(attachment, 1) <<
")" << std::endl;
370 ss <<
" - rect(" <<
to_string(rect, 1) <<
")" << std::endl;
378 VkPipelineStageFlags dst_stage_mask,
379 VkDependencyFlags dependency_flags,
381 const VkMemoryBarrier *p_memory_barriers,
382 uint32_t buffer_memory_barrier_count,
383 const VkBufferMemoryBarrier *p_buffer_memory_barriers,
384 uint32_t image_memory_barrier_count,
385 const VkImageMemoryBarrier *p_image_memory_barriers)
override
387 UNUSED_VARS(dependency_flags, memory_barrier_count, p_memory_barriers);
388 EXPECT_TRUE(is_recording_);
389 std::stringstream ss;
390 ss <<
"pipeline_barrier(";
394 for (VkImageMemoryBarrier image_barrier :
397 ss <<
" - image_barrier(" <<
to_string(image_barrier, 1) <<
")" << std::endl;
399 for (VkBufferMemoryBarrier buffer_barrier :
402 ss <<
" - buffer_barrier(" <<
to_string(buffer_barrier, 1) <<
")" << std::endl;
410 VkShaderStageFlags stage_flags,
413 const void *p_values)
override
415 UNUSED_VARS(layout, stage_flags, offset, size, p_values);
416 EXPECT_TRUE(is_recording_);
417 GTEST_FAIL() << __func__ <<
" not implemented!";
422 EXPECT_TRUE(is_recording_);
423 std::stringstream ss;
424 ss <<
"begin_rendering(";
425 ss <<
"p_rendering_info=" <<
to_string(*p_rendering_info);
432 EXPECT_TRUE(is_recording_);
433 std::stringstream ss;
434 ss <<
"end_rendering()";
440 VkQueryControlFlags )
override
465 operator VKObjectType()
const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void append(const T &value)
void clear_attachments(uint32_t attachment_count, const VkClearAttachment *p_attachments, uint32_t rect_count, const VkClearRect *p_rects) override
void begin_rendering(const VkRenderingInfo *p_rendering_info) override
void update_buffer(VkBuffer dst_buffer, VkDeviceSize dst_offset, VkDeviceSize data_size, const void *) override
void begin_debug_utils_label(const VkDebugUtilsLabelEXT *) override
virtual ~CommandBufferLog()
void push_constants(VkPipelineLayout layout, VkShaderStageFlags stage_flags, uint32_t offset, uint32_t size, const void *p_values) override
void clear_depth_stencil_image(VkImage image, VkImageLayout image_layout, const VkClearDepthStencilValue *p_depth_stencil, uint32_t range_count, const VkImageSubresourceRange *p_ranges) override
void pipeline_barrier(VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask, VkDependencyFlags dependency_flags, uint32_t memory_barrier_count, const VkMemoryBarrier *p_memory_barriers, uint32_t buffer_memory_barrier_count, const VkBufferMemoryBarrier *p_buffer_memory_barriers, uint32_t image_memory_barrier_count, const VkImageMemoryBarrier *p_image_memory_barriers) override
void copy_image_to_buffer(VkImage src_image, VkImageLayout src_image_layout, VkBuffer dst_buffer, uint32_t region_count, const VkBufferImageCopy *p_regions) override
void draw(uint32_t vertex_count, uint32_t instance_count, uint32_t first_vertex, uint32_t first_instance) override
void end_recording() override
void begin_recording() override
void bind_pipeline(VkPipelineBindPoint pipeline_bind_point, VkPipeline pipeline) override
void draw_indirect(VkBuffer buffer, VkDeviceSize offset, uint32_t draw_count, uint32_t stride) override
void copy_image(VkImage src_image, VkImageLayout src_image_layout, VkImage dst_image, VkImageLayout dst_image_layout, uint32_t region_count, const VkImageCopy *p_regions) override
void wait_for_cpu_synchronization(VkFence) override
void bind_vertex_buffers(uint32_t first_binding, uint32_t binding_count, const VkBuffer *p_buffers, const VkDeviceSize *p_offsets) override
void reset_query_pool(VkQueryPool, uint32_t, uint32_t) override
void begin_query(VkQueryPool, uint32_t, VkQueryControlFlags) override
void dispatch_indirect(VkBuffer buffer, VkDeviceSize offset) override
void draw_indexed_indirect(VkBuffer buffer, VkDeviceSize offset, uint32_t draw_count, uint32_t stride) override
void copy_buffer_to_image(VkBuffer src_buffer, VkImage dst_image, VkImageLayout dst_image_layout, uint32_t region_count, const VkBufferImageCopy *p_regions) override
void fill_buffer(VkBuffer dst_buffer, VkDeviceSize dst_offset, VkDeviceSize size, uint32_t data) override
void draw_indexed(uint32_t index_count, uint32_t instance_count, uint32_t first_index, int32_t vertex_offset, uint32_t first_instance) override
void end_rendering() override
void end_query(VkQueryPool, uint32_t) override
void clear_color_image(VkImage image, VkImageLayout image_layout, const VkClearColorValue *p_color, uint32_t range_count, const VkImageSubresourceRange *p_ranges) override
void copy_buffer(VkBuffer src_buffer, VkBuffer dst_buffer, uint32_t region_count, const VkBufferCopy *p_regions) override
void submit_with_cpu_synchronization(VkFence) override
CommandBufferLog(Vector< std::string > &log)
void dispatch(uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z) override
void bind_index_buffer(VkBuffer buffer, VkDeviceSize offset, VkIndexType index_type) override
void bind_descriptor_sets(VkPipelineBindPoint pipeline_bind_point, VkPipelineLayout layout, uint32_t first_set, uint32_t descriptor_set_count, const VkDescriptorSet *p_descriptor_sets, uint32_t dynamic_offset_count, const uint32_t *p_dynamic_offsets) override
void blit_image(VkImage src_image, VkImageLayout src_image_layout, VkImage dst_image, VkImageLayout dst_image_layout, uint32_t region_count, const VkImageBlit *p_regions, VkFilter filter) override
void end_debug_utils_label() override
ccl_device_inline float3 log(float3 v)
BLI_INLINE std::string & endl()
const char * to_string(ShaderStage stage)
std::string to_string_vk_pipeline_stage_flags(const VkPipelineStageFlags vk_pipeline_stage_flags)
unsigned __int64 uint64_t
VkHandle(uint64_t handle)