Repository navigation
Expand file tree
/
Copy pathCommandEncoder.h
More file actions
64 lines (54 loc) · 2.06 KB
/
Copy pathCommandEncoder.h
File metadata and controls
64 lines (54 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include "Vulkan/Include.h"
namespace Magic
{
struct Image;
struct Buffer;
class GraphicsPipeline;
class CommandEncoder
{
public:
CommandEncoder() = default;
~CommandEncoder() = default;
CommandEncoder(VkCommandBuffer _commandBuffer, VkCommandPool _commandPool);
[[nodiscard]] VkCommandBuffer Handle() const { return m_handle; }
[[nodiscard]] VkCommandPool Pool() const { return m_pool; }
void Reset() const;
void Begin() const;
void End() const;
void SetViewport(const VkViewport& viewport) const;
void SetViewport(int width, int height) const;
void SetScissor(const VkRect2D& scissor) const;
void SetScissor(int width, int height) const;
void BindGraphicsPipeline(const GraphicsPipeline& pipeline) const;
void BeginRendering(const VkRenderingInfoKHR& renderingInfo) const;
void EndRendering() const;
void BindVertexBufferSimple(const Buffer &buffer) const;
void BindIndexBufferSimple(const Buffer& buffer) const;
void Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const;
void DrawIndexedSimple(uint32_t indexCount, uint32_t firstIndex) const;
void ImageBarrier(
const Image& image
, VkAccessFlags srcAccessMask
, VkAccessFlags dstAcccesMask
, VkPipelineStageFlags srcStageMask
, VkPipelineStageFlags dstStageMask
, VkImageLayout oldLayout
, VkImageLayout newLayout
, VkImageAspectFlags aspectFlags = VK_IMAGE_ASPECT_COLOR_BIT);
void CopyImageToImage(
const Image& srcImage, const Image& dstImage
, VkImageAspectFlags srcImageAspect, VkImageAspectFlags dstImageAspect
, VkImageLayout srcImageLayout, VkImageLayout dstImageLayout
, int width, int height
) const;
void BlitImage(
const Image& srcImage, const Image& dstImage
, const VkImageLayout srcImageLayout, const VkImageLayout dstImageLayout
, const VkFilter filter, int width, int height
) const;
private:
VkCommandBuffer m_handle = VK_NULL_HANDLE;
VkCommandPool m_pool = VK_NULL_HANDLE;
};
}