35 lines
1013 B
C++
35 lines
1013 B
C++
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Base/ICloseable.hpp"
|
|
|
|
namespace OpenVulkano::Scene
|
|
{
|
|
class UniformBuffer
|
|
{
|
|
public:
|
|
static constexpr inline DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_UNIFORM_BUFFER, 1, ShaderProgramType::ALL_GRAPHICS };
|
|
|
|
DescriptorSetLayoutBinding binding;
|
|
uint32_t setId = 2;
|
|
ICloseable* renderBuffer = nullptr;
|
|
size_t size = 0;
|
|
const void* data = nullptr;
|
|
UpdateFrequency updateFrequency = UpdateFrequency::Never;
|
|
bool updated = true;
|
|
|
|
void Init(size_t size, const void* data, const DescriptorSetLayoutBinding& binding = DESCRIPTOR_SET_LAYOUT_BINDING)
|
|
{
|
|
this->size = size;
|
|
this->data = data;
|
|
this->binding = binding;
|
|
}
|
|
|
|
UpdateFrequency GetUpdateFrequency() const { return updateFrequency; }
|
|
};
|
|
} |