Commit 89ade79a by Jamie Madill Committed by Commit Bot

Vulkan: Clean up ScopedDescriptorSetUpdates.

Matches style guide requirement for types before members. Also moves the implementation of the class entirely into the cpp file. Moves the method implementation in ContextVk so we can more easily alter member variables. Unrelated cleanup done while working on consolidating RenderPasses. Bug: angleproject:4911 Change-Id: Ibe4273fc609b494840f1e86584bcee5bc31397d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2331950 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCharlie Lao <cclao@google.com>
parent fba96e90
...@@ -285,6 +285,33 @@ EventName GetTraceEventName(const char *title, uint32_t counter) ...@@ -285,6 +285,33 @@ EventName GetTraceEventName(const char *title, uint32_t counter)
} }
} // anonymous namespace } // anonymous namespace
ANGLE_INLINE void ContextVk::flushDescriptorSetUpdates()
{
if (mWriteDescriptorSets.empty())
{
ASSERT(mDescriptorBufferInfos.empty());
ASSERT(mDescriptorImageInfos.empty());
return;
}
vkUpdateDescriptorSets(getDevice(), static_cast<uint32_t>(mWriteDescriptorSets.size()),
mWriteDescriptorSets.data(), 0, nullptr);
mWriteDescriptorSets.clear();
mDescriptorBufferInfos.clear();
mDescriptorImageInfos.clear();
}
// ContextVk::ScopedDescriptorSetUpdates implementation.
class ContextVk::ScopedDescriptorSetUpdates final : angle::NonCopyable
{
public:
ANGLE_INLINE ScopedDescriptorSetUpdates(ContextVk *contextVk) : mContextVk(contextVk) {}
ANGLE_INLINE ~ScopedDescriptorSetUpdates() { mContextVk->flushDescriptorSetUpdates(); }
private:
ContextVk *mContextVk;
};
ContextVk::DriverUniformsDescriptorSet::DriverUniformsDescriptorSet() ContextVk::DriverUniformsDescriptorSet::DriverUniformsDescriptorSet()
: descriptorSet(VK_NULL_HANDLE), dynamicOffset(0) : descriptorSet(VK_NULL_HANDLE), dynamicOffset(0)
{} {}
...@@ -632,9 +659,6 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk ...@@ -632,9 +659,6 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
mRenderPassCounter(0), mRenderPassCounter(0),
mContextPriority(renderer->getDriverPriority(GetContextPriority(state))), mContextPriority(renderer->getDriverPriority(GetContextPriority(state))),
mCurrentIndirectBuffer(nullptr), mCurrentIndirectBuffer(nullptr),
mBufferInfos(),
mImageInfos(),
mWriteInfos(),
mShareGroupVk(vk::GetImpl(state.getShareGroup())) mShareGroupVk(vk::GetImpl(state.getShareGroup()))
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "ContextVk::ContextVk"); ANGLE_TRACE_EVENT0("gpu.angle", "ContextVk::ContextVk");
...@@ -726,9 +750,9 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk ...@@ -726,9 +750,9 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_TEXTURE_BINDINGS); mPipelineDirtyBitsMask.reset(gl::State::DIRTY_BIT_TEXTURE_BINDINGS);
// Reserve reasonable amount of spaces so that for majority of apps we don't need to grow at all // Reserve reasonable amount of spaces so that for majority of apps we don't need to grow at all
mBufferInfos.reserve(kDescriptorBufferInfosInitialSize); mDescriptorBufferInfos.reserve(kDescriptorBufferInfosInitialSize);
mImageInfos.reserve(kDescriptorImageInfosInitialSize); mDescriptorImageInfos.reserve(kDescriptorImageInfosInitialSize);
mWriteInfos.reserve(kDescriptorWriteInfosInitialSize); mWriteDescriptorSets.reserve(kDescriptorWriteInfosInitialSize);
} }
ContextVk::~ContextVk() = default; ContextVk::~ContextVk() = default;
...@@ -3751,12 +3775,12 @@ angle::Result ContextVk::updateDriverUniformsDescriptorSet( ...@@ -3751,12 +3775,12 @@ angle::Result ContextVk::updateDriverUniformsDescriptorSet(
&driverUniforms->descriptorPoolBinding, &driverUniforms->descriptorSet)); &driverUniforms->descriptorPoolBinding, &driverUniforms->descriptorSet));
// Update the driver uniform descriptor set. // Update the driver uniform descriptor set.
VkDescriptorBufferInfo &bufferInfo = allocBufferInfo(); VkDescriptorBufferInfo &bufferInfo = allocDescriptorBufferInfo();
bufferInfo.buffer = buffer->getBuffer().getHandle(); bufferInfo.buffer = buffer->getBuffer().getHandle();
bufferInfo.offset = 0; bufferInfo.offset = 0;
bufferInfo.range = driverUniformsSize; bufferInfo.range = driverUniformsSize;
VkWriteDescriptorSet &writeInfo = allocWriteInfo(); VkWriteDescriptorSet &writeInfo = allocWriteDescriptorSet();
writeInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; writeInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfo.dstSet = driverUniforms->descriptorSet; writeInfo.dstSet = driverUniforms->descriptorSet;
writeInfo.dstBinding = 0; writeInfo.dstBinding = 0;
...@@ -4649,74 +4673,60 @@ bool ContextVk::isRobustResourceInitEnabled() const ...@@ -4649,74 +4673,60 @@ bool ContextVk::isRobustResourceInitEnabled() const
return mState.isRobustResourceInitEnabled(); return mState.isRobustResourceInitEnabled();
} }
VkDescriptorBufferInfo &ContextVk::allocBufferInfos(size_t count)
{
return allocInfos<VkDescriptorBufferInfo, &VkWriteDescriptorSet::pBufferInfo>(&mBufferInfos,
count);
}
VkDescriptorImageInfo &ContextVk::allocImageInfos(size_t count)
{
return allocInfos<VkDescriptorImageInfo, &VkWriteDescriptorSet::pImageInfo>(&mImageInfos,
count);
}
template <typename T, const T *VkWriteDescriptorSet::*pInfo>
T &ContextVk::allocInfos(std::vector<T> *mInfos, size_t count)
{
size_t oldSize = mInfos->size();
size_t newSize = oldSize + count;
if (newSize > mInfos->capacity())
{
// If we have reached capacity, grow the storage and patch the descriptor set with new
// buffer info pointer
growCapacity<T, pInfo>(mInfos, newSize);
}
mInfos->resize(newSize);
return (*mInfos)[oldSize];
}
template <typename T, const T *VkWriteDescriptorSet::*pInfo> template <typename T, const T *VkWriteDescriptorSet::*pInfo>
void ContextVk::growCapacity(std::vector<T> *mInfos, size_t newSize) void ContextVk::growDesciptorCapacity(std::vector<T> *descriptorVector, size_t newSize)
{ {
const T *const oldInfoStart = mInfos->empty() ? nullptr : &(*mInfos)[0]; const T *const oldInfoStart = descriptorVector->empty() ? nullptr : &(*descriptorVector)[0];
size_t newCapacity = std::max(mInfos->capacity() << 1, newSize); size_t newCapacity = std::max(descriptorVector->capacity() << 1, newSize);
mInfos->reserve(newCapacity); descriptorVector->reserve(newCapacity);
if (oldInfoStart) if (oldInfoStart)
{ {
// patch mWriteInfo with new BufferInfo/ImageInfo pointers // patch mWriteInfo with new BufferInfo/ImageInfo pointers
for (VkWriteDescriptorSet &set : mWriteInfos) for (VkWriteDescriptorSet &set : mWriteDescriptorSets)
{ {
if (set.*pInfo) if (set.*pInfo)
{ {
size_t index = set.*pInfo - oldInfoStart; size_t index = set.*pInfo - oldInfoStart;
set.*pInfo = &(*mInfos)[index]; set.*pInfo = &(*descriptorVector)[index];
} }
} }
} }
} }
// ScopedDescriptorSetUpdates template <typename T, const T *VkWriteDescriptorSet::*pInfo>
ANGLE_INLINE ContextVk::ScopedDescriptorSetUpdates::ScopedDescriptorSetUpdates(ContextVk *contextVk) T *ContextVk::allocDescriptorInfos(std::vector<T> *descriptorVector, size_t count)
: mContextVk(contextVk)
{}
ANGLE_INLINE ContextVk::ScopedDescriptorSetUpdates::~ScopedDescriptorSetUpdates()
{ {
if (mContextVk->mWriteInfos.empty()) size_t oldSize = descriptorVector->size();
size_t newSize = oldSize + count;
if (newSize > descriptorVector->capacity())
{ {
ASSERT(mContextVk->mBufferInfos.empty()); // If we have reached capacity, grow the storage and patch the descriptor set with new
ASSERT(mContextVk->mImageInfos.empty()); // buffer info pointer
return; growDesciptorCapacity<T, pInfo>(descriptorVector, newSize);
} }
descriptorVector->resize(newSize);
return &(*descriptorVector)[oldSize];
}
VkDescriptorBufferInfo *ContextVk::allocDescriptorBufferInfos(size_t count)
{
return allocDescriptorInfos<VkDescriptorBufferInfo, &VkWriteDescriptorSet::pBufferInfo>(
&mDescriptorBufferInfos, count);
}
vkUpdateDescriptorSets(mContextVk->getDevice(), VkDescriptorImageInfo *ContextVk::allocDescriptorImageInfos(size_t count)
static_cast<uint32_t>(mContextVk->mWriteInfos.size()), {
mContextVk->mWriteInfos.data(), 0, nullptr); return allocDescriptorInfos<VkDescriptorImageInfo, &VkWriteDescriptorSet::pImageInfo>(
mContextVk->mWriteInfos.clear(); &mDescriptorImageInfos, count);
mContextVk->mBufferInfos.clear(); }
mContextVk->mImageInfos.clear();
VkWriteDescriptorSet *ContextVk::allocWriteDescriptorSets(size_t count)
{
size_t oldSize = mWriteDescriptorSets.size();
size_t newSize = oldSize + count;
mWriteDescriptorSets.resize(newSize);
return &mWriteDescriptorSets[oldSize];
} }
BufferSerial ContextVk::generateBufferSerial() BufferSerial ContextVk::generateBufferSerial()
......
...@@ -577,18 +577,13 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -577,18 +577,13 @@ class ContextVk : public ContextImpl, public vk::Context
void recycleCommandBuffer(vk::CommandBufferHelper *commandBuffer); void recycleCommandBuffer(vk::CommandBufferHelper *commandBuffer);
// DescriptorSet writes // DescriptorSet writes
VkDescriptorBufferInfo &allocBufferInfo() { return allocBufferInfos(1); } VkDescriptorBufferInfo *allocDescriptorBufferInfos(size_t count);
VkDescriptorBufferInfo &allocBufferInfos(size_t count); VkDescriptorImageInfo *allocDescriptorImageInfos(size_t count);
VkDescriptorImageInfo &allocImageInfo() { return allocImageInfos(1); } VkWriteDescriptorSet *allocWriteDescriptorSets(size_t count);
VkDescriptorImageInfo &allocImageInfos(size_t count);
VkWriteDescriptorSet &allocWriteInfo() { return allocWriteInfos(1); } VkDescriptorBufferInfo &allocDescriptorBufferInfo() { return *allocDescriptorBufferInfos(1); }
VkWriteDescriptorSet &allocWriteInfos(size_t count) VkDescriptorImageInfo &allocDescriptorImageInfo() { return *allocDescriptorImageInfos(1); }
{ VkWriteDescriptorSet &allocWriteDescriptorSet() { return *allocWriteDescriptorSets(1); }
size_t oldSize = mWriteInfos.size();
size_t newSize = oldSize + count;
mWriteInfos.resize(newSize);
return mWriteInfos[oldSize];
}
vk::DynamicBuffer *getDefaultUniformStorage() { return &mDefaultUniformStorage; } vk::DynamicBuffer *getDefaultUniformStorage() { return &mDefaultUniformStorage; }
// For testing only. // For testing only.
...@@ -681,6 +676,8 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -681,6 +676,8 @@ class ContextVk : public ContextImpl, public vk::Context
double cpuTimestampS; double cpuTimestampS;
}; };
class ScopedDescriptorSetUpdates;
angle::Result setupDraw(const gl::Context *context, angle::Result setupDraw(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
GLint firstVertexOrInvalid, GLint firstVertexOrInvalid,
...@@ -852,6 +849,7 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -852,6 +849,7 @@ class ContextVk : public ContextImpl, public vk::Context
bool hasRecordedCommands(); bool hasRecordedCommands();
void dumpCommandStreamDiagnostics(); void dumpCommandStreamDiagnostics();
angle::Result flushOutsideRenderPassCommands(); angle::Result flushOutsideRenderPassCommands();
void flushDescriptorSetUpdates();
ANGLE_INLINE void onRenderPassFinished() ANGLE_INLINE void onRenderPassFinished()
{ {
...@@ -879,9 +877,9 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -879,9 +877,9 @@ class ContextVk : public ContextImpl, public vk::Context
// DescriptorSet writes // DescriptorSet writes
template <typename T, const T *VkWriteDescriptorSet::*pInfo> template <typename T, const T *VkWriteDescriptorSet::*pInfo>
T &allocInfos(std::vector<T> *mInfos, size_t count); T *allocDescriptorInfos(std::vector<T> *descriptorVector, size_t count);
template <typename T, const T *VkWriteDescriptorSet::*pInfo> template <typename T, const T *VkWriteDescriptorSet::*pInfo>
void growCapacity(std::vector<T> *mInfos, size_t newSize); void growDesciptorCapacity(std::vector<T> *descriptorVector, size_t newSize);
std::array<DirtyBitHandler, DIRTY_BIT_MAX> mGraphicsDirtyBitHandlers; std::array<DirtyBitHandler, DIRTY_BIT_MAX> mGraphicsDirtyBitHandlers;
std::array<DirtyBitHandler, DIRTY_BIT_MAX> mComputeDirtyBitHandlers; std::array<DirtyBitHandler, DIRTY_BIT_MAX> mComputeDirtyBitHandlers;
...@@ -1057,18 +1055,9 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -1057,18 +1055,9 @@ class ContextVk : public ContextImpl, public vk::Context
const vk::BufferHelper *mCurrentIndirectBuffer; const vk::BufferHelper *mCurrentIndirectBuffer;
// Storage for vkUpdateDescriptorSets // Storage for vkUpdateDescriptorSets
std::vector<VkDescriptorBufferInfo> mBufferInfos; std::vector<VkDescriptorBufferInfo> mDescriptorBufferInfos;
std::vector<VkDescriptorImageInfo> mImageInfos; std::vector<VkDescriptorImageInfo> mDescriptorImageInfos;
std::vector<VkWriteDescriptorSet> mWriteInfos; std::vector<VkWriteDescriptorSet> mWriteDescriptorSets;
class ScopedDescriptorSetUpdates final : angle::NonCopyable
{
public:
ScopedDescriptorSetUpdates(ContextVk *contextVk);
~ScopedDescriptorSetUpdates();
private:
ContextVk *mContextVk;
};
ShareGroupVk *mShareGroupVk; ShareGroupVk *mShareGroupVk;
......
...@@ -878,8 +878,8 @@ void ProgramExecutableVk::updateDefaultUniformsDescriptorSet( ...@@ -878,8 +878,8 @@ void ProgramExecutableVk::updateDefaultUniformsDescriptorSet(
return; return;
} }
VkWriteDescriptorSet &writeInfo = contextVk->allocWriteInfo(); VkWriteDescriptorSet &writeInfo = contextVk->allocWriteDescriptorSet();
VkDescriptorBufferInfo &bufferInfo = contextVk->allocBufferInfo(); VkDescriptorBufferInfo &bufferInfo = contextVk->allocDescriptorBufferInfo();
if (!defaultUniformBlock.uniformData.empty()) if (!defaultUniformBlock.uniformData.empty())
{ {
...@@ -968,8 +968,8 @@ void ProgramExecutableVk::updateBuffersDescriptorSet(ContextVk *contextVk, ...@@ -968,8 +968,8 @@ void ProgramExecutableVk::updateBuffersDescriptorSet(ContextVk *contextVk,
"VkDeviceSize too small"); "VkDeviceSize too small");
ASSERT(bufferBinding.getSize() >= 0); ASSERT(bufferBinding.getSize() >= 0);
VkDescriptorBufferInfo &bufferInfo = contextVk->allocBufferInfo(); VkDescriptorBufferInfo &bufferInfo = contextVk->allocDescriptorBufferInfo();
VkWriteDescriptorSet &writeInfo = contextVk->allocWriteInfo(); VkWriteDescriptorSet &writeInfo = contextVk->allocWriteDescriptorSet();
BufferVk *bufferVk = vk::GetImpl(bufferBinding.get()); BufferVk *bufferVk = vk::GetImpl(bufferBinding.get());
vk::BufferHelper &bufferHelper = bufferVk->getBuffer(); vk::BufferHelper &bufferHelper = bufferVk->getBuffer();
...@@ -1038,8 +1038,8 @@ void ProgramExecutableVk::updateAtomicCounterBuffersDescriptorSet( ...@@ -1038,8 +1038,8 @@ void ProgramExecutableVk::updateAtomicCounterBuffersDescriptorSet(
continue; continue;
} }
VkDescriptorBufferInfo &bufferInfo = contextVk->allocBufferInfo(); VkDescriptorBufferInfo &bufferInfo = contextVk->allocDescriptorBufferInfo();
VkWriteDescriptorSet &writeInfo = contextVk->allocWriteInfo(); VkWriteDescriptorSet &writeInfo = contextVk->allocWriteDescriptorSet();
BufferVk *bufferVk = vk::GetImpl(bufferBinding.get()); BufferVk *bufferVk = vk::GetImpl(bufferBinding.get());
vk::BufferHelper &bufferHelper = bufferVk->getBuffer(); vk::BufferHelper &bufferHelper = bufferVk->getBuffer();
...@@ -1062,8 +1062,8 @@ void ProgramExecutableVk::updateAtomicCounterBuffersDescriptorSet( ...@@ -1062,8 +1062,8 @@ void ProgramExecutableVk::updateAtomicCounterBuffersDescriptorSet(
vk::BufferHelper &emptyBuffer = contextVk->getEmptyBuffer(); vk::BufferHelper &emptyBuffer = contextVk->getEmptyBuffer();
emptyBuffer.retain(&contextVk->getResourceUseList()); emptyBuffer.retain(&contextVk->getResourceUseList());
size_t count = (~writtenBindings).count(); size_t count = (~writtenBindings).count();
VkDescriptorBufferInfo *bufferInfos = &contextVk->allocBufferInfos(count); VkDescriptorBufferInfo *bufferInfos = contextVk->allocDescriptorBufferInfos(count);
VkWriteDescriptorSet *writeInfos = &contextVk->allocWriteInfos(count); VkWriteDescriptorSet *writeInfos = contextVk->allocWriteDescriptorSets(count);
size_t writeCount = 0; size_t writeCount = 0;
for (size_t binding : ~writtenBindings) for (size_t binding : ~writtenBindings)
{ {
...@@ -1138,8 +1138,8 @@ angle::Result ProgramExecutableVk::updateImagesDescriptorSet( ...@@ -1138,8 +1138,8 @@ angle::Result ProgramExecutableVk::updateImagesDescriptorSet(
// TODO(syoussefi): Support image data reinterpretation by using binding.format. // TODO(syoussefi): Support image data reinterpretation by using binding.format.
// http://anglebug.com/3563 // http://anglebug.com/3563
VkDescriptorImageInfo &imageInfo = contextVk->allocImageInfo(); VkDescriptorImageInfo &imageInfo = contextVk->allocDescriptorImageInfo();
VkWriteDescriptorSet &writeInfo = contextVk->allocWriteInfo(); VkWriteDescriptorSet &writeInfo = contextVk->allocWriteDescriptorSet();
imageInfo.sampler = VK_NULL_HANDLE; imageInfo.sampler = VK_NULL_HANDLE;
imageInfo.imageView = imageView->getHandle(); imageInfo.imageView = imageView->getHandle();
...@@ -1329,8 +1329,8 @@ angle::Result ProgramExecutableVk::updateTexturesDescriptorSet(ContextVk *contex ...@@ -1329,8 +1329,8 @@ angle::Result ProgramExecutableVk::updateTexturesDescriptorSet(ContextVk *contex
mappedSamplerNameToArrayOffset[mappedSamplerName] += arraySize; mappedSamplerNameToArrayOffset[mappedSamplerName] += arraySize;
} }
VkDescriptorImageInfo *imageInfos = &contextVk->allocImageInfos(arraySize); VkDescriptorImageInfo *imageInfos = contextVk->allocDescriptorImageInfos(arraySize);
VkWriteDescriptorSet *writeInfos = &contextVk->allocWriteInfos(arraySize); VkWriteDescriptorSet *writeInfos = contextVk->allocWriteDescriptorSets(arraySize);
for (uint32_t arrayElement = 0; arrayElement < arraySize; ++arrayElement) for (uint32_t arrayElement = 0; arrayElement < arraySize; ++arrayElement)
{ {
GLuint textureUnit = samplerBinding.boundTextureUnits[arrayElement]; GLuint textureUnit = samplerBinding.boundTextureUnits[arrayElement];
......
...@@ -195,8 +195,9 @@ void TransformFeedbackVk::initDescriptorSet(ContextVk *contextVk, ...@@ -195,8 +195,9 @@ void TransformFeedbackVk::initDescriptorSet(ContextVk *contextVk,
if (!contextVk->getFeatures().emulateTransformFeedback.enabled) if (!contextVk->getFeatures().emulateTransformFeedback.enabled)
return; return;
VkDescriptorBufferInfo *descriptorBufferInfo = &contextVk->allocBufferInfos(xfbBufferCount); VkDescriptorBufferInfo *descriptorBufferInfo =
vk::BufferHelper *emptyBuffer = &contextVk->getEmptyBuffer(); contextVk->allocDescriptorBufferInfos(xfbBufferCount);
vk::BufferHelper *emptyBuffer = &contextVk->getEmptyBuffer();
for (size_t bufferIndex = 0; bufferIndex < xfbBufferCount; ++bufferIndex) for (size_t bufferIndex = 0; bufferIndex < xfbBufferCount; ++bufferIndex)
{ {
...@@ -224,7 +225,8 @@ void TransformFeedbackVk::updateDescriptorSet(ContextVk *contextVk, ...@@ -224,7 +225,8 @@ void TransformFeedbackVk::updateDescriptorSet(ContextVk *contextVk,
ASSERT(programState.getTransformFeedbackBufferMode() != GL_INTERLEAVED_ATTRIBS || ASSERT(programState.getTransformFeedbackBufferMode() != GL_INTERLEAVED_ATTRIBS ||
xfbBufferCount == 1); xfbBufferCount == 1);
VkDescriptorBufferInfo *descriptorBufferInfo = &contextVk->allocBufferInfos(xfbBufferCount); VkDescriptorBufferInfo *descriptorBufferInfo =
contextVk->allocDescriptorBufferInfos(xfbBufferCount);
// Update buffer descriptor binding info for output buffers // Update buffer descriptor binding info for output buffers
for (size_t bufferIndex = 0; bufferIndex < xfbBufferCount; ++bufferIndex) for (size_t bufferIndex = 0; bufferIndex < xfbBufferCount; ++bufferIndex)
...@@ -290,7 +292,7 @@ void TransformFeedbackVk::writeDescriptorSet(ContextVk *contextVk, ...@@ -290,7 +292,7 @@ void TransformFeedbackVk::writeDescriptorSet(ContextVk *contextVk,
const std::string bufferName = GetXfbBufferName(0); const std::string bufferName = GetXfbBufferName(0);
ShaderInterfaceVariableInfo &info = variableInfoMap[gl::ShaderType::Vertex][bufferName]; ShaderInterfaceVariableInfo &info = variableInfoMap[gl::ShaderType::Vertex][bufferName];
VkWriteDescriptorSet &writeDescriptorInfo = contextVk->allocWriteInfo(); VkWriteDescriptorSet &writeDescriptorInfo = contextVk->allocWriteDescriptorSet();
writeDescriptorInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; writeDescriptorInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeDescriptorInfo.dstSet = descSet; writeDescriptorInfo.dstSet = descSet;
writeDescriptorInfo.dstBinding = info.binding; writeDescriptorInfo.dstBinding = info.binding;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment