mirror of
https://github.com/DrBeef/Raze.git
synced 2024-12-02 00:52:56 +00:00
42 lines
898 B
C++
42 lines
898 B
C++
|
|
#pragma once
|
|
|
|
#include "vulkan/system/vk_hwbuffer.h"
|
|
#include "vulkan/shaders/vk_shader.h"
|
|
|
|
class VkStreamBuffer;
|
|
class VkMatrixBuffer;
|
|
|
|
class VkStreamBufferWriter
|
|
{
|
|
public:
|
|
VkStreamBufferWriter(VulkanRenderDevice* fb);
|
|
|
|
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:
|
|
VkMatrixBufferWriter(VulkanRenderDevice* fb);
|
|
|
|
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;
|
|
};
|