Separating declaration and definition of RefPtr
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#include "GraphicsResources.h"
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
void Seele::DescriptorLayout::addDescriptorBinding(uint32 bindingIndex, SeDescriptorType type, uint32 arrayCount)
|
||||
{
|
||||
if (descriptorBindings.size() <= bindingIndex)
|
||||
{
|
||||
descriptorBindings.resize(bindingIndex + 1);
|
||||
}
|
||||
DescriptorBinding binding;
|
||||
binding.binding = bindingIndex;
|
||||
binding.descriptorType = type;
|
||||
binding.descriptorCount = arrayCount;
|
||||
descriptorBindings[bindingIndex] = binding;
|
||||
}
|
||||
|
||||
PDescriptorSet Seele::DescriptorLayout::allocatedDescriptorSet()
|
||||
{
|
||||
PDescriptorSet result;
|
||||
allocator->allocateDescriptorSet(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Seele::PipelineLayout::addDescriptorLayout(uint32 setIndex, PDescriptorLayout layout)
|
||||
{
|
||||
if (descriptorSetLayouts.size() <= setIndex)
|
||||
{
|
||||
descriptorSetLayouts.resize(setIndex + 1);
|
||||
}
|
||||
if (descriptorSetLayouts[setIndex] != nullptr)
|
||||
{
|
||||
auto& thisBindings = descriptorSetLayouts[setIndex]->descriptorBindings;
|
||||
auto& otherBindings = layout->descriptorBindings;
|
||||
thisBindings.resize(otherBindings.size());
|
||||
for (size_t i = 0; i < otherBindings.size(); ++i)
|
||||
{
|
||||
if (otherBindings[i].descriptorType != SE_DESCRIPTOR_TYPE_MAX_ENUM)
|
||||
{
|
||||
assert(thisBindings[i].descriptorType != SE_DESCRIPTOR_TYPE_MAX_ENUM ? thisBindings[i].descriptorType == otherBindings[i].descriptorType : true);
|
||||
thisBindings[i] = otherBindings[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
descriptorSetLayouts[setIndex] = layout;
|
||||
}
|
||||
}
|
||||
|
||||
void Seele::PipelineLayout::addPushConstants(const SePushConstantRange& pushConstant)
|
||||
{
|
||||
pushConstants.add(pushConstant);
|
||||
}
|
||||
Reference in New Issue
Block a user