2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-07-02 08:09:59 +00:00
|
|
|
#include "vulkan/system/vk_hwbuffer.h"
|
2020-05-31 08:53:11 +00:00
|
|
|
#include "vulkan/shaders/vk_shader.h"
|
|
|
|
|
|
|
|
class VkStreamBuffer;
|
|
|
|
class VkMatrixBuffer;
|
|
|
|
|
|
|
|
class VkStreamBufferWriter
|
|
|
|
{
|
|
|
|
public:
|
2022-12-11 17:30:01 +00:00
|
|
|
VkStreamBufferWriter(VulkanRenderDevice* fb);
|
2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
bool Write(const StreamData& data);
|
|
|
|
void Reset();
|
|
|
|
|
|
|
|
uint32_t DataIndex() const { return mDataIndex; }
|
|
|
|
uint32_t StreamDataOffset() const { return mStreamDataOffset; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
VkStreamBuffer* mBuffer;
|
|
|
|
uint32_t mDataIndex = MAX_STREAM_DATA - 1;
|
|
|
|
uint32_t mStreamDataOffset = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class VkMatrixBufferWriter
|
|
|
|
{
|
|
|
|
public:
|
2022-12-11 17:30:01 +00:00
|
|
|
VkMatrixBufferWriter(VulkanRenderDevice* fb);
|
2020-05-31 08:53:11 +00:00
|
|
|
|
|
|
|
bool Write(const VSMatrix& modelMatrix, bool modelMatrixEnabled, const VSMatrix& textureMatrix, bool textureMatrixEnabled);
|
|
|
|
void Reset();
|
|
|
|
|
|
|
|
uint32_t Offset() const { return mOffset; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
VkStreamBuffer* mBuffer;
|
|
|
|
MatricesUBO mMatrices = {};
|
|
|
|
VSMatrix mIdentityMatrix;
|
|
|
|
uint32_t mOffset = 0;
|
|
|
|
};
|