CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
GPUPipelineLayout.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Common.hpp"
11#include "Forward.hpp"
12
13#include "GPUResource.hpp"
14#include "GPUShader.hpp"
15
18
22
23namespace CeresEngine {
24
32
38
43 UInt32 slot = 0;
44
47 UInt32 set = 0;
48
54 UInt32 arraySize = 1;
55
58 template<typename Processor> static constexpr void reflect(Processor&& RTTI) {
59 CE_REFL_DATA(type);
60 CE_REFL_DATA(stages);
61 CE_REFL_DATA(slot);
62 CE_REFL_DATA(set);
63 CE_REFL_DATA(arraySize);
64 }
65 };
66
73
74 // Creates a new `GPUPipelineLayoutDescriptor` from a reflected shader
78
81 template<typename Processor> static constexpr void reflect(Processor&& RTTI) { CE_REFL_DATA(bindings); }
82 };
83
84 class CE_SCRIPT_EXPORT() GPUPipelineLayout : public TDeviceObject<GPUPipelineLayoutDescriptor> {
85 public:
87 using TDeviceObject::TDeviceObject;
88
92
96
97 public:
102 [[nodiscard]] CE_SCRIPT_EXPORT()
103 virtual GPUResourceSetPtr createResourceSet(const GPUResourceSetDescriptor& descriptor, UInt32 setIndex = 0) = 0;
104 };
105
106} // namespace CeresEngine
107
110
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUPipelineLayout.hpp:84
GPUPipelineLayout & operator=(const GPUPipelineLayout &)=delete
GPUPipelineLayout(const GPUPipelineLayout &)=delete
Deleted copy constructor.
GPUPipelineLayout(GPUPipelineLayout &&)=delete
Deleted move constructor.
GPUPipelineLayout & operator=(GPUPipelineLayout &&)=delete
Definition Common.hpp:62
Definition Application.hpp:19
GPUResourceType
An enumeration of supported resource types.
Definition GPUResource.hpp:15
sfl::small_vector< T, N, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > SmallVector
SmallVector is a sequence container similar to Vector.
Definition SmallVector.hpp:31
std::uint32_t UInt32
Definition DataTypes.hpp:23
GPUPipelineStage
Shader stage flags enumeration.
Definition GPUShader.hpp:37
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Layout structure for a single binding point of the pipeline layout descriptor.
Definition GPUPipelineLayout.hpp:27
Pipeline layout descriptor structure.
Definition GPUPipelineLayout.hpp:70
SmallVector< GPUBindingDescriptor, 10 > bindings
List of layout resource bindings.
Definition GPUPipelineLayout.hpp:72
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition GPUPipelineLayout.hpp:81
static GPUPipelineLayoutDescriptor fromReflectionDescriptor(const GPUShaderReflectionDescriptor &reflectionDescriptor)
data.
Definition GPUResourceSet.hpp:716
Shader reflection descriptor structure.
Definition GPUShader.hpp:108