Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ghi_infos.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <Common/primitive_type.h>
7#include <Math/TVector2.h>
8#include <Math/TVector3.h>
9
10#include <cstddef>
11#include <array>
12
13namespace ph::editor::ghi
14{
15
22
30
41
52
54{
55public:
57 std::size_t strideOffset = 0;
58
62 uint16 strideSize : 10 = 0;
63
64 uint16 numElements : 2 = 0;
65 uint16 shouldNormalize : 1 = false;
66
68
71 inline VertexAttributeLocatorInfo() = default;
72
73 bool isEmpty() const;
74 std::size_t numAttributeBytes() const;
75};
76
78{
79public:
80 inline constexpr static uint8 MAX_ATTRIBUTES = 8;
81
82 std::array<VertexAttributeLocatorInfo, MAX_ATTRIBUTES> attributes;
83
84 std::size_t numGroupBytes() const;
85};
86
99
100class TextureDesc final
101{
102public:
103 math::Vector3UI sizePx = {0, 0, 0};
105
106 TextureDesc& setSize1D(const uint32 lengthPx)
107 {
108 sizePx.x() = lengthPx;
109 sizePx.y() = 1;
110 sizePx.z() = 1;
111 return *this;
112 }
113
114 TextureDesc& setSize2D(const math::Vector2UI& widthAndHeightPx)
115 {
116 sizePx.x() = widthAndHeightPx.x();
117 sizePx.y() = widthAndHeightPx.y();
118 sizePx.z() = 1;
119 return *this;
120 }
121};
122
124{
125public:
126 inline constexpr static uint8 MAX_COLOR_ATTACHMENTS = 8;
127
128public:
129 math::Vector2UI sizePx = {0, 0};
130 std::array<FramebufferFormatInfo, MAX_COLOR_ATTACHMENTS> colorFormats;
132 uint8 numSamples : 4 = 1;
133};
134
135}// end namespace ph::editor::ghi
Definition ghi_infos.h:88
uint8 maxVertexAttributes
Definition ghi_infos.h:97
uint8 maxTextureUnitsForFragmentShadingStage
Definition ghi_infos.h:91
uint8 maxTextureUnitsForVertexShadingStage
Definition ghi_infos.h:90
Definition ghi_infos.h:124
FramebufferFormatInfo depthStencilFormat
Definition ghi_infos.h:131
static constexpr uint8 MAX_COLOR_ATTACHMENTS
Definition ghi_infos.h:126
math::Vector2UI sizePx
Definition ghi_infos.h:129
uint8 numSamples
Definition ghi_infos.h:132
std::array< FramebufferFormatInfo, MAX_COLOR_ATTACHMENTS > colorFormats
Definition ghi_infos.h:130
ESizedPixelFormat pixelFormat
Definition ghi_infos.h:34
bool isEmpty() const
Definition ghi_infos.h:36
Definition ghi_infos.h:17
EWrapMode wrapMode
Definition ghi_infos.h:20
EFilterMode filterMode
Definition ghi_infos.h:19
Definition ghi_infos.h:46
ShaderHandle computeShader
Definition ghi_infos.h:50
ShaderHandle fragmentShader
Definition ghi_infos.h:49
ShaderHandle vertexShader
Definition ghi_infos.h:48
Definition ghi_infos.h:101
TextureDesc & setSize2D(const math::Vector2UI &widthAndHeightPx)
Definition ghi_infos.h:114
math::Vector3UI sizePx
Definition ghi_infos.h:103
TextureDesc & setSize1D(const uint32 lengthPx)
Definition ghi_infos.h:106
TextureFormatInfo format
Definition ghi_infos.h:104
Definition ghi_infos.h:24
SampleStateInfo sampleState
Definition ghi_infos.h:26
ESizedPixelFormat pixelFormat
Definition ghi_infos.h:27
uint8 numSamples
Definition ghi_infos.h:28
bool isEmpty() const
Definition VertexStorage.h:30
VertexAttributeLocatorInfo()=default
Empty attribute.
uint16 strideSize
Definition ghi_infos.h:62
std::size_t numAttributeBytes() const
Definition ghi_infos.cpp:6
EStorageElement elementType
Definition ghi_infos.h:67
std::size_t strideOffset
Definition ghi_infos.h:57
uint16 numElements
Definition ghi_infos.h:64
uint16 shouldNormalize
Definition ghi_infos.h:65
static constexpr uint8 MAX_ATTRIBUTES
Definition ghi_infos.h:80
std::array< VertexAttributeLocatorInfo, MAX_ATTRIBUTES > attributes
Definition ghi_infos.h:82
std::size_t numGroupBytes() const
Definition ghi_infos.cpp:11
Definition PlatformDisplay.h:13
ESizedPixelFormat
Combined pixel layout and component type information. Unless stated explicitly, the characters RGB do...
Definition ghi_enums.h:19
EWrapMode
Definition ghi_enums.h:64
EStorageElement
Definition ghi_enums.h:70
EFilterMode
Definition ghi_enums.h:58