22 handle = resources_.
size();
28 Resource new_resource = {};
29 resources_.
add_new(handle, new_resource);
35 VkImageLayout vk_image_layout,
41 "Image resource is added twice to the render graph.");
44 Resource &resource = resources_.
lookup(handle);
45 image_resources_.
add_new(vk_image, handle);
48 resource.owner = owner;
49 resource.image.vk_image = vk_image;
50 resource.image.layer_count = layer_count;
51 resource.image.vk_image_layout = vk_image_layout;
57#ifdef VK_RESOURCE_STATE_TRACKER_VALIDATION
66 "Buffer resource is added twice to the render graph.");
69 Resource &resource = resources_.
lookup(handle);
70 buffer_resources_.
add_new(vk_buffer, handle);
74 resource.buffer.vk_buffer = vk_buffer;
80#ifdef VK_RESOURCE_STATE_TRACKER_VALIDATION
95 resources_.
pop(handle);
96 unused_handles_.
append(handle);
98#ifdef VK_RESOURCE_STATE_TRACKER_VALIDATION
107 resources_.
pop(handle);
108 unused_handles_.
append(handle);
110#ifdef VK_RESOURCE_STATE_TRACKER_VALIDATION
118 const Resource &resource)
122 result.stamp = resource.stamp;
126ResourceWithStamp VKResourceStateTracker::get_and_increase_stamp(
ResourceHandle handle,
129 ResourceWithStamp result = get_stamp(handle, resource);
137 Resource &resource = resources_.
lookup(handle);
138 return get_and_increase_stamp(handle, resource);
144 Resource &resource = resources_.
lookup(handle);
145 return get_and_increase_stamp(handle, resource);
151 const Resource &resource = resources_.
lookup(handle);
152 return get_stamp(handle, resource);
158 const Resource &resource = resources_.
lookup(handle);
159 return get_stamp(handle, resource);
165 VKResourceStateTracker::Resource &resource = resources_.
lookup(image_handle);
167 resource.reset_image_layout();
172#ifdef VK_RESOURCE_STATE_TRACKER_VALIDATION
173void VKResourceStateTracker::validate()
const
180 const Resource &resource = resources_.
lookup(item.value);
189 const Resource &resource = resources_.
lookup(item.value);
#define BLI_assert_msg(a, msg)
#define UNUSED_VARS_NDEBUG(...)
Value pop(const Key &key)
const Value & lookup(const Key &key) const
ValueIterator values() const
void add_new(const Key &key, const Value &value)
bool contains(const Key &key) const
void append(const T &value)
void add_image(VkImage vk_image, uint32_t layer_count, VkImageLayout vk_image_layout, ResourceOwner owner, const char *name=nullptr)
ResourceWithStamp get_image_and_increase_stamp(VkImage vk_image)
ResourceWithStamp get_buffer_and_increase_stamp(VkBuffer vk_buffer)
ResourceWithStamp get_buffer(VkBuffer vk_buffer) const
void remove_buffer(VkBuffer vk_buffer)
void add_buffer(VkBuffer vk_buffer, const char *name=nullptr)
void remove_image(VkImage vk_image)
ResourceWithStamp get_image(VkImage vk_image) const
void reset_image_layouts()