3#include "../IContext.h"
5#include "../VertexFormat.h"
6#include "../Statistics.h"
8#include "EffectsCommon.h"
12 const int kMaxVertexInputSlots = 32;
16 size_t numVertexBuffers = 0;
18 uint32_t strides[kMaxVertexInputSlots] = {};
19 uint32_t offsets[kMaxVertexInputSlots] = {};
32 void frameStatisticsConfigure(
bool enable)
override { frameStatisticsEnabled = enable; }
59 void setCurrentEffect(
Effect * currentEffect);
60 void updateConstantBuffers();
63 void frameStatisticsAccountDrawCall(
size_t count,
bool indexed);
66 void uploadStatisticsBufferUpload(
size_t size);
67 void uploadStatisticsTextureUpload(
size_t size);
70 FrameStatistics currStats{};
72 UploadStatistics prevUploadStats{};
73 UploadStatistics currUploadStats{};
77 uint32_t dirtySRV[(int)Cogs::ShaderType::NumShaderSlots] = {};
78 uint32_t dirtyCB[(int)Cogs::ShaderType::NumShaderSlots] = {};
86 bool constantBuffersUpdated =
true;
87 bool frameStatisticsEnabled =
false;
88 bool uploadStatisticsEnabled =
true;
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
PrimitiveType
Primitive types for interpreting vertex data sent to the graphics pipeline.
void frameStatisticsBeginFrame()
void setConstantBuffer(const StringView &name, const BufferHandle bufferHandle, const uint32_t offset, const uint32_t size) final
Sets a constant buffer to be bound to the given name and slot.
void setSamplerState(const StringView &name, unsigned int unit, SamplerStateHandle handle) final
Sets the sampler slot given by unit with the given name to contain the given sampler state.
void setVertexArrayObject(VertexArrayObjectHandle vertexArrayObject) override
void updateBuffer(BufferHandle bufferHandle, const void *data, size_t size) override
Replace contents of buffer with new data.
void setTexture(const StringView &name, unsigned int unit, TextureHandle textureHandle) final
Sets the texture slot given by unit with the given name to contain the given texture.
void setBuffer(const StringView &name, BufferHandle bufferHandle) final
Sets the given buffer to the buffer binding slot with the given name.
virtual void signal(FenceHandle) override
Insert a fence in the command stream that will signal when all commands before the fence are complete...
Represents a graphics device context which can receive rendering commands.
virtual void setTexture(const StringView &name, unsigned int unit, TextureHandle textureHandle)=0
Sets the texture slot given by unit with the given name to contain the given texture.
virtual void setConstantBuffer(const StringView &name, const BufferHandle bufferHandle, const uint32_t offset=0, const uint32_t size=~0u)=0
Sets a constant buffer to be bound to the given name and slot.
virtual void setBuffer(const StringView &name, BufferHandle bufferHandle)=0
Sets the given buffer to the buffer binding slot with the given name.
virtual void setSamplerState(const StringView &name, unsigned int unit, SamplerStateHandle samplerStateHandle)=0
Sets the sampler slot given by unit with the given name to contain the given sampler state.
Provides effects and shader management functionality.