2024-12-16 21:49:57 +08:00
|
|
|
#pragma once
|
2024-10-30 15:15:25 +08:00
|
|
|
#include "type.h"
|
|
|
|
|
#include "render/renderapi.h"
|
|
|
|
|
namespace vkn {
|
|
|
|
|
using api::BufferDesc;
|
|
|
|
|
struct VulkanContext : public api::RenderContext {
|
|
|
|
|
VkFence surfaceFence;
|
|
|
|
|
VkSemaphore surfaceSemaphore;
|
|
|
|
|
VkSemaphore presentSemaphore;
|
2024-12-12 22:20:56 +08:00
|
|
|
VkSemaphore graphSemaphore;
|
|
|
|
|
VkCommandBuffer surfaceCommand;
|
2024-10-30 15:15:25 +08:00
|
|
|
VkCommandBuffer command;
|
|
|
|
|
void SetScissor(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override;
|
|
|
|
|
void SetViewport(float x, float y, float width, float height, float min_depth, float max_depth) override;
|
|
|
|
|
void BindIndexBuffer(BufferDesc desc, uint32_t index_stride) override;
|
|
|
|
|
void BindVertexBuffer(BufferDesc desc) override;
|
|
|
|
|
void BindVertexBuffers(uint32_t buffer_count, const BufferDesc* descs, const uint32_t* offsets)override;
|
|
|
|
|
void DrawIndexed(uint32_t index_count, uint32_t first_index, uint32_t first_vertex) override;
|
2024-12-16 21:49:57 +08:00
|
|
|
void ExecuteSurfaceBarriers(const ResourceBarrierDesc& desc) override;
|
2024-10-30 15:15:25 +08:00
|
|
|
|
|
|
|
|
void BeginRecord(VkCommandBufferUsageFlags flag);
|
|
|
|
|
void EndRecord(VkQueue queue);
|
|
|
|
|
};
|
|
|
|
|
}
|