2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2022 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2022-10-31 16:01:02 +01:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup gpu
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-02-01 10:03:47 +01:00
|
|
|
#include "vk_common.hh"
|
|
|
|
|
|
2022-10-31 16:01:02 +01:00
|
|
|
#include "gpu_batch_private.hh"
|
|
|
|
|
|
|
|
|
|
namespace blender::gpu {
|
2023-05-11 13:01:56 +02:00
|
|
|
class VKVertexBuffer;
|
|
|
|
|
class VKIndexBuffer;
|
2022-10-31 16:01:02 +01:00
|
|
|
|
|
|
|
|
class VKBatch : public Batch {
|
|
|
|
|
public:
|
2023-05-11 13:01:56 +02:00
|
|
|
void draw(int vertex_first, int vertex_count, int instance_first, int instance_count) override;
|
2022-10-31 16:01:02 +01:00
|
|
|
void draw_indirect(GPUStorageBuf *indirect_buf, intptr_t offset) override;
|
|
|
|
|
void multi_draw_indirect(GPUStorageBuf *indirect_buf,
|
|
|
|
|
int count,
|
|
|
|
|
intptr_t offset,
|
|
|
|
|
intptr_t stride) override;
|
2024-02-01 10:03:47 +01:00
|
|
|
void multi_draw_indirect(VkBuffer indirect_buf, int count, intptr_t offset, intptr_t stride);
|
2023-05-11 13:01:56 +02:00
|
|
|
|
|
|
|
|
VKVertexBuffer *vertex_buffer_get(int index);
|
|
|
|
|
VKVertexBuffer *instance_buffer_get(int index);
|
|
|
|
|
VKIndexBuffer *index_buffer_get();
|
2023-08-21 08:55:55 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void draw_setup();
|
2022-10-31 16:01:02 +01:00
|
|
|
};
|
|
|
|
|
|
2024-01-26 17:45:18 +01:00
|
|
|
BLI_INLINE VKBatch *unwrap(GPUBatch *batch)
|
|
|
|
|
{
|
|
|
|
|
return static_cast<VKBatch *>(batch);
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-31 15:49:04 +11:00
|
|
|
} // namespace blender::gpu
|