Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
src
scene
globalcomponents
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
6
namespace
foray::scene::gcomp
{
7
9
class
MaterialManager
:
public
GlobalComponent
10
{
11
public
:
12
explicit
MaterialManager
(
core::Context
* context);
13
14
std::vector<Material>&
GetVector
() {
return
mBuffer
.GetVector(); }
15
17
void
UpdateDeviceLocal
();
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
:
29
util::ManagedVectorBuffer<Material>
mBuffer
= {};
30
};
31
}
// namespace foray::scene
foray::scene::GlobalComponent
Definition
foray_component.hpp:95
foray::scene::gcomp::MaterialManager
Manages a device local storage buffer providing material information for rendering.
Definition
foray_materialmanager.hpp:10
foray::scene::gcomp::MaterialManager::~MaterialManager
virtual ~MaterialManager()
Definition
foray_materialmanager.hpp:20
foray::scene::gcomp::MaterialManager::Destroy
void Destroy()
foray::scene::gcomp::MaterialManager::UpdateDeviceLocal
void UpdateDeviceLocal()
Apply changes made to the cpu local buffer to the device local buffer.
foray::scene::gcomp::MaterialManager::GetVkBuffer
VkBuffer GetVkBuffer() const
Definition
foray_materialmanager.hpp:25
foray::scene::gcomp::MaterialManager::GetVector
std::vector< Material > & GetVector()
Definition
foray_materialmanager.hpp:14
foray::scene::gcomp::MaterialManager::mBuffer
util::ManagedVectorBuffer< Material > mBuffer
Definition
foray_materialmanager.hpp:29
foray::scene::gcomp::MaterialManager::MaterialManager
MaterialManager(core::Context *context)
foray::scene::gcomp::MaterialManager::GetVkDescriptorInfo
VkDescriptorBufferInfo GetVkDescriptorInfo() const
Definition
foray_materialmanager.hpp:24
foray::util::ManagedVectorBuffer
Class maintaining a resizable array of templated classes in a managed buffer.
Definition
foray_managedvectorbuffer.hpp:22
FORAY_GETTER_CR
#define FORAY_GETTER_CR(member)
Return constant reference.
Definition
foray_basics.hpp:60
foray::scene::gcomp
Definition
foray_scene_declares.hpp:16
foray::core::Context
Non owning context object.
Definition
foray_context.hpp:16
Generated by
1.9.8