Skip to content

Commit

Permalink
tests: Create a OneOffDescriptorIndexingSet
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Dec 13, 2024
1 parent e1b6492 commit c7a002b
Show file tree
Hide file tree
Showing 28 changed files with 537 additions and 910 deletions.
81 changes: 68 additions & 13 deletions tests/framework/descriptor_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,78 @@

#include "descriptor_helper.h"

OneOffDescriptorSet::OneOffDescriptorSet(vkt::Device *device, const Bindings &bindings,
OneOffDescriptorSet::OneOffDescriptorSet(vkt::Device *device, const std::vector<VkDescriptorSetLayoutBinding> &bindings,
VkDescriptorSetLayoutCreateFlags layout_flags, void *layout_pnext,
VkDescriptorPoolCreateFlags poolFlags, void *allocate_pnext, void *create_pool_pnext)
: device_{device}, pool_{}, layout_(*device, bindings, layout_flags, layout_pnext), set_(VK_NULL_HANDLE) {
VkResult err;
std::vector<VkDescriptorPoolSize> sizes;
for (const auto &b : bindings) sizes.emplace_back(VkDescriptorPoolSize{b.descriptorType, std::max(1u, b.descriptorCount)});

VkDescriptorPoolCreateInfo dspci = {
VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, create_pool_pnext, poolFlags, 1, uint32_t(sizes.size()), sizes.data()};
err = vk::CreateDescriptorPool(device_->handle(), &dspci, nullptr, &pool_);
VkDescriptorPoolCreateFlags pool_flags, void *allocate_pnext, void *create_pool_pnext)
: device_{device}, layout_(*device, bindings, layout_flags, layout_pnext) {
std::vector<VkDescriptorPoolSize> pool_sizes;
for (const auto &b : bindings) {
pool_sizes.emplace_back(VkDescriptorPoolSize{b.descriptorType, std::max(1u, b.descriptorCount)});
}

VkDescriptorPoolCreateInfo pool_ci = vku::InitStructHelper(create_pool_pnext);
pool_ci.flags = pool_flags;
pool_ci.maxSets = 1;
pool_ci.poolSizeCount = pool_sizes.size();
pool_ci.pPoolSizes = pool_sizes.data();
VkResult err = vk::CreateDescriptorPool(device_->handle(), &pool_ci, nullptr, &pool_);
if (err != VK_SUCCESS) return;

if ((layout_flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT) == 0) {
VkDescriptorSetAllocateInfo ds_alloc_info = vku::InitStructHelper(allocate_pnext);
ds_alloc_info.descriptorPool = pool_;
ds_alloc_info.descriptorSetCount = 1;
ds_alloc_info.pSetLayouts = &layout_.handle();
err = vk::AllocateDescriptorSets(device_->handle(), &ds_alloc_info, &set_);
}
}

OneOffDescriptorIndexingSet::OneOffDescriptorIndexingSet(vkt::Device *device, const OneOffDescriptorIndexingSet::Bindings &bindings,
void *allocate_pnext, void *create_pool_pnext) {
device_ = device;
std::vector<VkDescriptorPoolSize> pool_sizes;
VkDescriptorSetLayoutCreateFlags layout_flags = 0;
VkDescriptorPoolCreateFlags pool_flags = 0;
std::vector<VkDescriptorSetLayoutBinding> ds_layout_bindings;
std::vector<VkDescriptorBindingFlags> ds_binding_flags;

for (const auto &b : bindings) {
pool_sizes.emplace_back(VkDescriptorPoolSize{b.descriptorType, std::max(1u, b.descriptorCount)});
ds_layout_bindings.emplace_back(
VkDescriptorSetLayoutBinding{b.binding, b.descriptorType, b.descriptorCount, b.stageFlags, b.pImmutableSamplers});
ds_binding_flags.emplace_back(b.flag);

// Automatically set the needed flags if using UAB
if (b.flag & VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT) {
layout_flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT;
pool_flags = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT;
}
}

VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = ds_binding_flags.size();
flags_create_info.pBindingFlags = ds_binding_flags.data();

VkDescriptorSetLayoutCreateInfo ds_layout_ci = vku::InitStructHelper(&flags_create_info);
ds_layout_ci.flags = layout_flags;
ds_layout_ci.bindingCount = ds_layout_bindings.size();
ds_layout_ci.pBindings = ds_layout_bindings.data();
layout_.init(*device, ds_layout_ci);

VkDescriptorPoolCreateInfo pool_ci = vku::InitStructHelper(create_pool_pnext);
pool_ci.flags = pool_flags;
pool_ci.maxSets = 1;
pool_ci.poolSizeCount = pool_sizes.size();
pool_ci.pPoolSizes = pool_sizes.data();
VkResult err = vk::CreateDescriptorPool(device_->handle(), &pool_ci, nullptr, &pool_);
if (err != VK_SUCCESS) return;

if ((layout_flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT) == 0) {
VkDescriptorSetAllocateInfo alloc_info = {VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, allocate_pnext, pool_, 1,
&layout_.handle()};
err = vk::AllocateDescriptorSets(device_->handle(), &alloc_info, &set_);
VkDescriptorSetAllocateInfo ds_alloc_info = vku::InitStructHelper(allocate_pnext);
ds_alloc_info.descriptorPool = pool_;
ds_alloc_info.descriptorSetCount = 1;
ds_alloc_info.pSetLayouts = &layout_.handle();
err = vk::AllocateDescriptorSets(device_->handle(), &ds_alloc_info, &set_);
}
}

Expand Down
38 changes: 29 additions & 9 deletions tests/framework/descriptor_helper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2023 The Khronos Group Inc.
* Copyright (c) 2023 Valve Corporation
* Copyright (c) 2023 LunarG, Inc.
* Copyright (c) 2023-2024 The Khronos Group Inc.
* Copyright (c) 2023-2024 Valve Corporation
* Copyright (c) 2023-2024 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,12 +14,12 @@

#include "layer_validation_tests.h"

struct OneOffDescriptorSet {
class OneOffDescriptorSet {
public:
vkt::Device *device_;
VkDescriptorPool pool_;
VkDescriptorPool pool_{};
vkt::DescriptorSetLayout layout_;
VkDescriptorSet set_;
typedef std::vector<VkDescriptorSetLayoutBinding> Bindings;
VkDescriptorSet set_{VK_NULL_HANDLE};

// Only one member of ResourceInfo object contains a value.
// The pointers to Image/Buffer/BufferView info structures can't be stored in 'descriptor_writes'
Expand All @@ -34,9 +34,11 @@ struct OneOffDescriptorSet {
std::vector<ResourceInfo> resource_infos;
std::vector<VkWriteDescriptorSet> descriptor_writes;

OneOffDescriptorSet(vkt::Device *device, const Bindings &bindings, VkDescriptorSetLayoutCreateFlags layout_flags = 0,
void *layout_pnext = nullptr, VkDescriptorPoolCreateFlags poolFlags = 0, void *allocate_pnext = nullptr,
OneOffDescriptorSet(vkt::Device *device, const std::vector<VkDescriptorSetLayoutBinding> &bindings,
VkDescriptorSetLayoutCreateFlags layout_flags = 0, void *layout_pnext = nullptr,
VkDescriptorPoolCreateFlags pool_flags = 0, void *allocate_pnext = nullptr,
void *create_pool_pnext = nullptr);
OneOffDescriptorSet(){};
~OneOffDescriptorSet();
bool Initialized();
void Clear();
Expand All @@ -56,3 +58,21 @@ struct OneOffDescriptorSet {
void AddDescriptorWrite(uint32_t binding, uint32_t array_element, VkDescriptorType descriptor_type,
uint32_t descriptor_count = 1);
};

// Descriptor Indexing focused variation
class OneOffDescriptorIndexingSet : public OneOffDescriptorSet {
public:
// Same as VkDescriptorSetLayoutBinding but ties the flags into it
struct Binding {
uint32_t binding;
VkDescriptorType descriptorType;
uint32_t descriptorCount;
VkShaderStageFlags stageFlags;
const VkSampler *pImmutableSamplers;
VkDescriptorBindingFlags flag;
};
typedef std::vector<Binding> Bindings;

OneOffDescriptorIndexingSet(vkt::Device *device, const Bindings &bindings, void *allocate_pnext = nullptr,
void *create_pool_pnext = nullptr);
};
24 changes: 8 additions & 16 deletions tests/unit/best_practices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,25 +1159,17 @@ TEST_F(VkBestPracticesLayerTest, ThreadUpdateDescriptorUpdateAfterBindNoCollisio
RETURN_IF_SKIP(Init());
InitRenderTarget();

std::array<VkDescriptorBindingFlagsEXT, 2> flags = {
{VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT}};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = (uint32_t)flags.size();
flags_create_info.pBindingFlags = flags.data();

OneOffDescriptorSet normal_descriptor_set(m_device,
{
{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, nullptr},
{1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, nullptr},
},
VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, &flags_create_info,
VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT);

OneOffDescriptorIndexingSet descriptor_set(m_device, {
{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT,
nullptr, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT},
{1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT,
nullptr, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT},
});
vkt::Buffer buffer(*m_device, 256, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);

ThreadTestData data;
data.device = device();
data.descriptorSet = normal_descriptor_set.set_;
data.descriptorSet = descriptor_set.set_;
data.binding = 0;
data.buffer = buffer.handle();
std::atomic<bool> bailout{false};
Expand All @@ -1190,7 +1182,7 @@ TEST_F(VkBestPracticesLayerTest, ThreadUpdateDescriptorUpdateAfterBindNoCollisio

ThreadTestData data2;
data2.device = device();
data2.descriptorSet = normal_descriptor_set.set_;
data2.descriptorSet = descriptor_set.set_;
data2.binding = 1;
data2.buffer = buffer.handle();
data2.bailout = &bailout;
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/descriptor_indexing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ TEST_F(NegativeDescriptorIndexing, UpdateAfterBind) {
RETURN_IF_SKIP(Init());
InitRenderTarget();

VkDescriptorBindingFlagsEXT flags[3] = {0, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT,
VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT};
VkDescriptorBindingFlags flags[3] = {0, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT,
VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 3;
flags_create_info.pBindingFlags = &flags[0];
Expand Down Expand Up @@ -207,7 +207,7 @@ TEST_F(NegativeDescriptorIndexing, SetLayout) {

RETURN_IF_SKIP(Init());

std::array<VkDescriptorBindingFlagsEXT, 2> flags = {
std::array<VkDescriptorBindingFlags, 2> flags = {
{VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT}};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = size32(flags);
Expand Down
30 changes: 9 additions & 21 deletions tests/unit/descriptor_indexing_positive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TEST_F(PositiveDescriptorIndexing, BindingPartiallyBound) {
RETURN_IF_SKIP(Init());
InitRenderTarget();

VkDescriptorBindingFlagsEXT ds_binding_flags[2] = {};
VkDescriptorBindingFlags ds_binding_flags[2] = {};
VkDescriptorSetLayoutBindingFlagsCreateInfo layout_createinfo_binding_flags = vku::InitStructHelper();
ds_binding_flags[0] = 0;
// No Error
Expand Down Expand Up @@ -109,16 +109,10 @@ TEST_F(PositiveDescriptorIndexing, UpdateAfterBind) {
vkt::Buffer buffer2(*m_device, 4096, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT);
vkt::Buffer buffer3(*m_device, 4096, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT);

OneOffDescriptorSet::Bindings binding_defs = {
{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr},
{1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr},
};
VkDescriptorBindingFlagsEXT flags[2] = {VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, 0};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 2;
flags_create_info.pBindingFlags = flags;
OneOffDescriptorSet descriptor_set(m_device, binding_defs, VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT,
&flags_create_info, VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT);
OneOffDescriptorIndexingSet descriptor_set(
m_device,
{{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr, VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT},
{1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr, 0}});
const vkt::PipelineLayout pipeline_layout(*m_device, {&descriptor_set.layout_});

descriptor_set.WriteDescriptorBufferInfo(0, buffer1, 0, VK_WHOLE_SIZE, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
Expand Down Expand Up @@ -185,16 +179,10 @@ TEST_F(PositiveDescriptorIndexing, PartiallyBoundDescriptors) {
vkt::Buffer buffer1(*m_device, 4096, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT);
vkt::Buffer buffer3(*m_device, 4096, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT);

OneOffDescriptorSet::Bindings binding_defs = {
{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr},
{1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr},
};
VkDescriptorBindingFlagsEXT flags[2] = {VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT, 0};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 2;
flags_create_info.pBindingFlags = flags;
OneOffDescriptorSet descriptor_set(m_device, binding_defs, VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT,
&flags_create_info, VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT);
OneOffDescriptorIndexingSet descriptor_set(
m_device,
{{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr, VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT},
{1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr, 0}});
const vkt::PipelineLayout pipeline_layout(*m_device, {&descriptor_set.layout_});

descriptor_set.WriteDescriptorBufferInfo(0, buffer1, 0, VK_WHOLE_SIZE, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
Expand Down
25 changes: 13 additions & 12 deletions tests/unit/descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,16 @@ TEST_F(NegativeDescriptors, WriteDescriptorSetIntegrity) {

vkt::Sampler sampler(*m_device, SafeSaneSamplerCreateInfo());

OneOffDescriptorSet::Bindings bindings = {{0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_ALL, NULL},
{1, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{2, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, &sampler.handle()},
{3, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{4, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 3, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{5, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{6, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, NULL},
{7, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{8, VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL}};
std::vector<VkDescriptorSetLayoutBinding> bindings = {
{0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_ALL, NULL},
{1, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{2, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, &sampler.handle()},
{3, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{4, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 3, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{5, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{6, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, NULL},
{7, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL},
{8, VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL}};
OneOffDescriptorSet descriptor_set(m_device, bindings);
ASSERT_TRUE(descriptor_set.Initialized());

Expand Down Expand Up @@ -4015,7 +4016,7 @@ TEST_F(NegativeDescriptors, DISABLED_AllocatingVariableDescriptorSets) {
AddRequiredFeature(vkt::Feature::descriptorBindingVariableDescriptorCount);
RETURN_IF_SKIP(Init());

VkDescriptorBindingFlagsEXT flags[2] = {0, VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT};
VkDescriptorBindingFlags flags[2] = {0, VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 2;
flags_create_info.pBindingFlags = flags;
Expand Down Expand Up @@ -4860,7 +4861,7 @@ TEST_F(NegativeDescriptors, DescriptorIndexingMissingFeatures) {

RETURN_IF_SKIP(Init());

VkDescriptorBindingFlagsEXT flag = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT;
VkDescriptorBindingFlags flag = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT;
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 1u;
flags_create_info.pBindingFlags = &flag;
Expand Down Expand Up @@ -4943,7 +4944,7 @@ TEST_F(NegativeDescriptors, IncompatibleDescriptorFlagsWithBindingFlags) {
bindings[1].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
bindings[1].pImmutableSamplers = nullptr;

VkDescriptorBindingFlagsEXT binding_flags[] = {VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, 0};
VkDescriptorBindingFlags binding_flags[] = {VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, 0};
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 1u;
flags_create_info.pBindingFlags = binding_flags;
Expand Down
10 changes: 2 additions & 8 deletions tests/unit/gpu_av_descriptor_class_general_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,8 @@ TEST_F(NegativeGpuAVDescriptorClassGeneralBuffer, PartialBoundDescriptorSSBO) {
}
)glsl";

VkDescriptorBindingFlags binding_flags = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT;
VkDescriptorSetLayoutBindingFlagsCreateInfo flags_create_info = vku::InitStructHelper();
flags_create_info.bindingCount = 1;
flags_create_info.pBindingFlags = &binding_flags;

OneOffDescriptorSet descriptor_set(m_device, {{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr}},
VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, &flags_create_info,
VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT);
OneOffDescriptorIndexingSet descriptor_set(m_device, {{0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr,
VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT}});
const vkt::PipelineLayout pipeline_layout(*m_device, {&descriptor_set.layout_});

CreateComputePipelineHelper pipe(*this);
Expand Down
Loading

0 comments on commit c7a002b

Please sign in to comment.