Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Commands.inl
Go to the documentation of this file.
1/*
2Copyright (c) 2018 DIVIDE-Studio
3Copyright (c) 2009 Ionut Cava
4
5This file is part of DIVIDE Framework.
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software
9and associated documentation files (the "Software"), to deal in the Software
10without restriction,
11including without limitation the rights to use, copy, modify, merge, publish,
12distribute, sublicense,
13and/or sell copies of the Software, and to permit persons to whom the
14Software is furnished to do so,
15subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED,
22INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23PARTICULAR PURPOSE AND NONINFRINGEMENT.
24IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27IN CONNECTION WITH THE SOFTWARE
28OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30*/
31
32#pragma once
33#ifndef DVD_GFX_COMMAND_INL_
34#define DVD_GFX_COMMAND_INL_
35
36#include "CommandBuffer.h"
37#include "ClipPlanes.h"
38#include "DescriptorSetsFwd.h"
39#include "GenericDrawCommand.h"
40#include "PushConstants.h"
47
48struct ImDrawData;
49
50namespace Divide {
51class Pipeline;
52class ShaderBuffer;
53
54namespace GFX {
55
56template<CommandType EnumVal>
58{
59 using CType = MapToDataType<EnumVal>;
60 buffer->add( static_cast<const CType&>(*this) );
61}
62
63template<CommandType EnumVal>
65{
66 using CType = MapToDataType<EnumVal>;
67 CmdAllocator<CType>::GetPool().deleteElement( cmd->As<CType>() );
68 cmd = nullptr;
69}
70
72 const Pipeline* _pipeline = nullptr;
74
76 UniformData* _uniformData = nullptr;
79
83
87
91
93
96 RTDrawDescriptor _descriptor{};
97 RTClearDescriptor _clearDescriptor{};
98 Str<64> _name{};
100
102 RTTransitionMask _transitionMask = {true, true, true, true, true};
104
106 U32 _queryMask{ 0u };
108
110 QueryResults* _resultContainer{nullptr};
111 bool _waitForResults{false};
113
117 RTBlitParams _params{};
119
121 Handle<Texture> _source{ INVALID_HANDLE<Texture> };
122 Handle<Texture> _destination{ INVALID_HANDLE<Texture> };
123 U8 _sourceMSAASamples{ 0u };
124 U8 _destinationMSAASamples{ 0u };
127
129 Handle<Texture> _texture{ INVALID_HANDLE<Texture> };
130 PixelAlignment _pixelPackAlignment{};
131 U8 _mipLevel{0u};
134
136 Handle<Texture> _texture{ INVALID_HANDLE<Texture> };
139 SubRange _layerRange{0u, U16_MAX};
140 U8 _mipLevel{ 0u };
142
144 Handle<Texture> _texture{ INVALID_HANDLE<Texture> };
145 SubRange _layerRange{ 0u, 1u };
146 SubRange _mipRange{ 0u, U16_MAX };
149
153
157
161
163
167
172
175 U32 _scopeId{ U32_MAX };
177
179
182 U32 _msgId{ U32_MAX };
184
188
193
195 ShaderBuffer* _buffer{ nullptr };
196 std::pair<bufferPtr, size_t> _target { nullptr, 0u };
197 U32 _offsetElementCount{ 0 };
198 U32 _elementCount{ 0 };
200
202 ShaderBuffer* _buffer{ nullptr };
203 U32 _offsetElementCount{ 0 };
204 U32 _elementCount{ 0 };
206
207}; //namespace GFX
208}; //namespace Divide
209
210#endif //DVD_GFX_COMMAND_INL_
#define DEFINE_COMMAND_BEGIN(Name, Enum)
Definition: Commands.h:87
#define DEFINE_COMMAND_END(Name)
Definition: Commands.h:93
#define DEFINE_COMMAND(Name, Enum)
Definition: Commands.h:95
typename MapToDataType_t< T >::type MapToDataType
Definition: Commands.h:48
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
eastl::fixed_vector< RTBlitEntry, MAX_BLIT_ENTRIES, false > RTBlitParams
std::function< Ret(Args...) > DELEGATE_STD
uint8_t U8
eastl::fixed_vector< TextureLayoutChange, 6, true > TextureLayoutChanges
Definition: Texture.h:77
eastl::fixed_vector< BufferLock, 6, true > BufferLocks
Definition: BufferLocks.h:63
constexpr U16 U16_MAX
constexpr RenderTargetID INVALID_RENDER_TARGET_ID
constexpr U32 U32_MAX
eastl::fixed_vector< GenericDrawCommand, 1, true > GenericDrawCommandContainer
std::array< RTClearEntry, RT_MAX_ATTACHMENT_COUNT > RTClearDescriptor
bool[RT_MAX_ATTACHMENT_COUNT] RTTransitionMask
U32 RenderTargetID
DescriptorSetUsage
uint32_t U32
std::array< std::pair< QueryType, I64 >, to_base(QueryType::COUNT)> QueryResults
UColour4 _clearColour
r = depth, g = stencil if target is a depth(+stencil) attachment
Definition: Commands.inl:138
FORCE_INLINE T * As()
Definition: Commands.h:60
virtual void DeleteCmd(CommandBase *&cmd) const final
Definition: Commands.inl:64
virtual void addToBuffer(CommandBuffer *buffer) const final
Definition: Commands.inl:57
GenericDrawCommandContainer _drawCommands
Definition: Commands.inl:81
TextureLayoutChanges _textureLayoutChanges
Definition: Commands.inl:191
CameraSnapshot _cameraSnapshot
Definition: Commands.inl:159
DELEGATE_STD< void, const ImageReadbackData & > _callback
Definition: Commands.inl:132
CameraSnapshot _cameraSnapshot
Definition: Commands.inl:155
FrustumClipPlanes _clippingPlanes
Definition: Commands.inl:165