Commit a1614939 by Chris Forbes

Set up input attachment descriptors the same as storage images

These work the same way; differences are in coordinate handling and where we find the image format. Bug: b/131171141 Change-Id: I9dccfd88e686102d6200bdba8a8ad64b7debeca3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29688Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent ed46cde6
...@@ -245,31 +245,6 @@ uint8_t* DescriptorSetLayout::getOffsetPointer(DescriptorSet *descriptorSet, uin ...@@ -245,31 +245,6 @@ uint8_t* DescriptorSetLayout::getOffsetPointer(DescriptorSet *descriptorSet, uin
return &descriptorSet->data[byteOffset]; return &descriptorSet->data[byteOffset];
} }
const uint8_t* DescriptorSetLayout::GetInputData(const VkWriteDescriptorSet& writeDescriptorSet)
{
switch(writeDescriptorSet.descriptorType)
{
case VK_DESCRIPTOR_TYPE_SAMPLER:
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
return reinterpret_cast<const uint8_t*>(writeDescriptorSet.pImageInfo);
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
return reinterpret_cast<const uint8_t*>(writeDescriptorSet.pTexelBufferView);
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
return reinterpret_cast<const uint8_t*>(writeDescriptorSet.pBufferInfo);
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
ASSERT("descriptorType has custom handling");
default:
UNIMPLEMENTED("descriptorType");
return nullptr;
}
}
void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptorUpdateTemplateEntry const &entry, char const *src) void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptorUpdateTemplateEntry const &entry, char const *src)
{ {
DescriptorSetLayout* dstLayout = dstSet->layout; DescriptorSetLayout* dstLayout = dstSet->layout;
...@@ -439,7 +414,8 @@ void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptor ...@@ -439,7 +414,8 @@ void DescriptorSetLayout::WriteDescriptorSet(DescriptorSet *dstSet, VkDescriptor
} }
} }
} }
else if (entry.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) else if (entry.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||
entry.descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)
{ {
auto descriptor = reinterpret_cast<StorageImageDescriptor *>(memToWrite); auto descriptor = reinterpret_cast<StorageImageDescriptor *>(memToWrite);
for(uint32_t i = 0; i < entry.descriptorCount; i++) for(uint32_t i = 0; i < entry.descriptorCount; i++)
......
...@@ -98,7 +98,6 @@ public: ...@@ -98,7 +98,6 @@ public:
private: private:
size_t getDescriptorSetDataSize() const; size_t getDescriptorSetDataSize() const;
uint32_t getBindingIndex(uint32_t binding) const; uint32_t getBindingIndex(uint32_t binding) const;
static const uint8_t* GetInputData(const VkWriteDescriptorSet& descriptorWrites);
static bool isDynamic(VkDescriptorType type); static bool isDynamic(VkDescriptorType type);
VkDescriptorSetLayoutCreateFlags flags; VkDescriptorSetLayoutCreateFlags flags;
......
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