3#include "../Interface/LowLevelRenderer.hpp"
16class OpenGLShaderProgram;
17class OpenGLBufferAllocator;
18class OpenGLRenderPassAllocator;
19class OpenGLRenderTargetAllocator;
52 const std::vector<Profiling::Event>&
GetTimeline()
const final;
74 Shader* blitFragmentShader;
85 static const unsigned int buffering = 3;
86 std::vector<Profiling::Event> finishedEvents;
87 unsigned int currentFrame = 0;
88 static const unsigned int maxQueries = buffering * 2 * 50;
89 GLuint queries[maxQueries];
90 std::vector<GLuint> freeQueries;
91 std::vector<OpenGLCommandBuffer::Timing> submittedTimings[buffering];
94 double submissionTimes[buffering];
Definition: Window.hpp:14
A buffer containing GPU accessible data.
Definition: Buffer.hpp:8
BufferUsage
How the buffer is going to be used.
Definition: Buffer.hpp:11
A buffer into which rendering commands are recorded.
Definition: CommandBuffer.hpp:24
A compute pipeline.
Definition: ComputePipeline.hpp:11
Binds together a vertex description with buffers.
Definition: GeometryBinding.hpp:8
IndexType
The type of values in the index buffer.
Definition: GeometryBinding.hpp:11
A graphics pipeline.
Definition: GraphicsPipeline.hpp:11
Low level renderer abstracting the underlaying graphics API (OpenGL or Vulkan).
Definition: LowLevelRenderer.hpp:27
OpenGL implementation of BufferAllocator.
Definition: OpenGLBufferAllocator.hpp:44
OpenGL implementation of RenderPassAllocator.
Definition: OpenGLRenderPassAllocator.hpp:8
OpenGL implementation of RenderTargetAllocator.
Definition: OpenGLRenderTargetAllocator.hpp:8
Low-level renderer implementing OpenGL.
Definition: OpenGLRenderer.hpp:23
OpenGLRenderer(Utility::Window *window)
Create new OpenGL renderer.
Definition: OpenGLRenderer.cpp:31
const OpenGLShaderProgram * GetBlitShaderProgram() const
Get the shader program used for blitting.
Definition: OpenGLRenderer.cpp:262
void FreeRenderTarget(Texture *renderTarget) final
Free a render target.
Definition: OpenGLRenderer.cpp:214
Shader * CreateShader(const ShaderSource &shaderSource, Shader::Type type) final
Create a shader.
Definition: OpenGLRenderer.cpp:190
CommandBuffer * CreateCommandBuffer() final
Create a command buffer.
Definition: OpenGLRenderer.cpp:104
Buffer * CreateBuffer(Buffer::BufferUsage bufferUsage, uint32_t size, const void *data=nullptr) final
Definition: OpenGLRenderer.cpp:174
VertexDescription * CreateVertexDescription(unsigned int attributeCount, const VertexDescription::Attribute *attributes, bool indexBuffer=false) final
Create a vertex description.
Definition: OpenGLRenderer.cpp:182
Texture * CreateRenderTarget(const glm::uvec2 &size, Texture::Format format) final
Create a render target.
Definition: OpenGLRenderer.cpp:210
void BeginFrame() final
Begin a new frame.
Definition: OpenGLRenderer.cpp:108
ShaderProgram * CreateShaderProgram(std::initializer_list< const Shader * > shaders) final
Create a shader program.
Definition: OpenGLRenderer.cpp:194
GraphicsPipeline * CreateGraphicsPipeline(const ShaderProgram *shaderProgram, const GraphicsPipeline::Configuration &configuration, const VertexDescription *vertexDescription=nullptr) final
Create a graphics pipeline.
Definition: OpenGLRenderer.cpp:218
void Present() final
Present the rendered image to the swap chain.
Definition: OpenGLRenderer.cpp:131
const std::vector< Profiling::Event > & GetTimeline() const final
Get profiling timeline.
Definition: OpenGLRenderer.cpp:254
Texture * CreateTexture(const glm::uvec2 size, Texture::Format format, int components, unsigned char *data) final
Create a texture.
Definition: OpenGLRenderer.cpp:198
ComputePipeline * CreateComputePipeline(const ShaderProgram *shaderProgram) final
Create a compute pipeline.
Definition: OpenGLRenderer.cpp:222
const OptionalFeatures & GetOptionalFeatures() const final
Get which optional features are supported.
Definition: OpenGLRenderer.cpp:258
Buffer * CreateTemporaryBuffer(Buffer::BufferUsage bufferUsage, uint32_t size, const void *data=nullptr) final
Definition: OpenGLRenderer.cpp:178
const Sampler * GetSampler(Sampler::Filter filter, Sampler::Clamping clamping) const final
Get a sampler.
Definition: OpenGLRenderer.cpp:203
GeometryBinding * CreateGeometryBinding(const VertexDescription *vertexDescription, Buffer *vertexBuffer, GeometryBinding::IndexType indexType=GeometryBinding::IndexType::NONE, const Buffer *indexBuffer=nullptr) final
Create a geometry binding.
Definition: OpenGLRenderer.cpp:186
GLuint GetFreeQuery()
Get a free query.
Definition: OpenGLRenderer.cpp:266
void Submit(CommandBuffer *commandBuffer) final
Submit a command buffer for execution.
Definition: OpenGLRenderer.cpp:114
void Wait() final
Wait for all rendering to finish.
Definition: OpenGLRenderer.cpp:226
unsigned char * ReadImage(Texture *texture) final
Read a render texture color image.
Definition: OpenGLRenderer.cpp:230
~OpenGLRenderer() final
Destructor.
Definition: OpenGLRenderer.cpp:88
OpenGL implementation of Sampler.
Definition: OpenGLSampler.hpp:10
OpenGL implementation of ShaderProgram.
Definition: OpenGLShaderProgram.hpp:14
Determines how a texture should be sampled.
Definition: Sampler.hpp:6
Filter
The interpolation to apply.
Definition: Sampler.hpp:9
@ COUNT
Number of entries in enum.
Clamping
How to handle sampling outside the texture dimensions.
Definition: Sampler.hpp:16
@ COUNT
Number of entries in enum.
Compiles and handles a shader. Shaders should be linked together into a ShaderProgram.
Definition: Shader.hpp:8
Type
The type of shader.
Definition: Shader.hpp:11
A shader program.
Definition: ShaderProgram.hpp:11
A texture.
Definition: Texture.hpp:8
Format
The format of the texture.
Definition: Texture.hpp:18
Describes how a vertex buffer is accessed by a shader.
Definition: VertexDescription.hpp:8
Definition: ResourceView.hpp:12
Definition: Editor.hpp:18
The configuration of the graphics pipeline.
Definition: GraphicsPipeline.hpp:14
Optional features.
Definition: LowLevelRenderer.hpp:30
Describes an attribute used in a vertex shader.
Definition: VertexDescription.hpp:18