Faro Engine 0.0.0.b519570 (main)
Loading...
Searching...
No Matches
GraphicsBuffer.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace Faro
6{
7 /// @brief Describes the state of a graphics buffer
9 {
10 RS_Unknown, ///< Unknown state. The buffer must be transitioned into another state before usage.
11 RS_CopySource, ///< Source buffer for a copy operation.
12 RS_CopyDestination, ///< Destination buffer for a copy operation.
13 RS_RenderTarget, ///< Allows the buffer to be used as a rendertarget.
14 RS_ShaderResource, ///< Allows the buffer to be used as a shader resource.
15 RS_Present ///< Marks a rendertarget buffer read for presentation by its swapchain.
16 };
17
18 /// @brief A buffer storing graphics related data. Created by GraphicsAdapter::CreateBuffer.
20 {
21 public:
22 /**
23 * @brief Get the description of this buffer.
24 * @return const GraphicsBufferDesc& Buffer description
25 */
27
29
30 void Init(GraphicsAdapter* adapter, GraphicsBufferCreateDesc createDesc);
31
32 /**
33 * @brief Prepare the given data so it can be uploaded to the graphics adapter. This buffer **must** be created as BT_Upload!
34 * @param data Pointer to the data to upload
35 */
36 virtual void Upload(uint8* data) = 0;
37
38 /**
39 * @brief Get the current resource state of this buffer.
40 * @return GraphicsResourceState Current resource state
41 */
43
44 protected:
45 /**
46 * @brief Set the resource state flag for internal referencing.
47 * @param state New resource state
48 */
50
51 private:
55 };
56}
Definition GraphicsAdapter.hpp:27
A buffer storing graphics related data. Created by GraphicsAdapter::CreateBuffer.
Definition GraphicsBuffer.hpp:20
virtual void Upload(uint8 *data)=0
Prepare the given data so it can be uploaded to the graphics adapter. This buffer must be created as ...
GraphicsResourceState GetResourceState()
Get the current resource state of this buffer.
Definition GraphicsBuffer.cpp:22
const GraphicsBufferDesc & GetDesc()
Get the description of this buffer.
Definition GraphicsBuffer.cpp:5
GraphicsBufferType GetBufferType()
Definition GraphicsBuffer.cpp:10
void SetResourceState(GraphicsResourceState state)
Set the resource state flag for internal referencing.
Definition GraphicsBuffer.cpp:27
Definition GraphicsAdapterChild.hpp:9
void Init() override
Run the initialization logic of this object. Should be overriden by deriving classes.
Definition GraphicsAdapterChild.cpp:16
Definition Array.hpp:8
GraphicsResourceState
Describes the state of a graphics buffer.
Definition GraphicsBuffer.hpp:9
@ RS_Unknown
Unknown state. The buffer must be transitioned into another state before usage.
Definition GraphicsBuffer.hpp:10
@ RS_ShaderResource
Allows the buffer to be used as a shader resource.
Definition GraphicsBuffer.hpp:14
@ RS_Present
Marks a rendertarget buffer read for presentation by its swapchain.
Definition GraphicsBuffer.hpp:15
@ RS_CopySource
Source buffer for a copy operation.
Definition GraphicsBuffer.hpp:11
@ RS_CopyDestination
Destination buffer for a copy operation.
Definition GraphicsBuffer.hpp:12
@ RS_RenderTarget
Allows the buffer to be used as a rendertarget.
Definition GraphicsBuffer.hpp:13
GraphicsBufferType
Determines the type of a graphics buffer.
Definition GraphicsBufferDesc.hpp:84
uint8_t uint8
Definition Primitives.hpp:6
Definition GraphicsBufferDesc.hpp:90
Description of a graphics buffer.
Definition GraphicsBufferDesc.hpp:20