Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_materialmanager.hpp
Go to the documentation of this file.
1#pragma once
2#include "../../util/foray_managedvectorbuffer.hpp"
3#include "../foray_component.hpp"
4#include "../foray_material.hpp"
5
6namespace foray::scene::gcomp {
7
10 {
11 public:
12 explicit MaterialManager(core::Context* context);
13
14 std::vector<Material>& GetVector() { return mBuffer.GetVector(); }
15
18 void Destroy();
19
20 inline virtual ~MaterialManager() { Destroy(); }
21
22 FORAY_GETTER_CR(Buffer)
23
24 inline VkDescriptorBufferInfo GetVkDescriptorInfo() const { return mBuffer.GetBuffer().GetVkDescriptorBufferInfo(); }
25 inline VkBuffer GetVkBuffer() const { return mBuffer.GetBuffer().GetBuffer(); }
26
27
28 protected:
30 };
31} // namespace foray::scene
Definition foray_component.hpp:95
Manages a device local storage buffer providing material information for rendering.
Definition foray_materialmanager.hpp:10
virtual ~MaterialManager()
Definition foray_materialmanager.hpp:20
void UpdateDeviceLocal()
Apply changes made to the cpu local buffer to the device local buffer.
VkBuffer GetVkBuffer() const
Definition foray_materialmanager.hpp:25
std::vector< Material > & GetVector()
Definition foray_materialmanager.hpp:14
util::ManagedVectorBuffer< Material > mBuffer
Definition foray_materialmanager.hpp:29
MaterialManager(core::Context *context)
VkDescriptorBufferInfo GetVkDescriptorInfo() const
Definition foray_materialmanager.hpp:24
Class maintaining a resizable array of templated classes in a managed buffer.
Definition foray_managedvectorbuffer.hpp:22
#define FORAY_GETTER_CR(member)
Return constant reference.
Definition foray_basics.hpp:60
Definition foray_scene_declares.hpp:16
Non owning context object.
Definition foray_context.hpp:16