5#include "../Base/ContextCommon.h"
7#include "EffectsD3D11.h"
14 struct GraphicsDeviceD3D11;
15 struct RenderTargetsD3D11;
16 struct SyncObjectsD3D11;
21 ID3D11Buffer * currentVertexBuffers[kMaxVertexInputSlots] = {};
46 void setViewport(
const float x,
const float y,
const float width,
const float height);
47 void setScissor(
const int x,
const int y,
const int width,
const int height);
65 void setupConstantBuffers();
74 void dispatchCompute(
const unsigned int threadGroupsX,
const unsigned int threadGroupsY,
const unsigned int threadGroupsZ);
91 void copyTexture(
TextureHandle dstHandle,
unsigned dstSub,
unsigned dstX,
unsigned dstY,
unsigned dstZ,
TextureHandle sourceHandle,
unsigned srcSub)
override;
93 void clearResource(
BufferHandle destinationHandle, uint32_t *Values);
94 void clearResource(
BufferHandle destinationHandle,
float *Values);
106 void setShaderResources(uint32_t * slots, ID3D11ShaderResourceView *
const *ppShaderResourceViews);
112 void resetSRVBindings();
114 void updateRenderTargets();
128 EffectHandle getCurrentEffect()
override {
return currentEffect; }
129 IEffects * getEffects()
override {
return effects; }
133 ID3D11UnorderedAccessView * uavs[D3D11_PS_CS_UAV_REGISTER_COUNT] = {};
134 uint32_t uavCounts[16] = {};
135 uint32_t minUavSlot = ~0u;
136 uint32_t maxUavSlot = 0;
137 bool uavDirty =
false;
151 bool inRenderPass =
false;
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
void updateSubBuffer(BufferHandle bufferHandle, const size_t offset, const size_t size, const void *data) override
Update a region of data in a buffer.
void pushCommandGroupAnnotation(const StringView &name) override
Begin to tag a sequence of commands as a group in graphics debugger.
void resolveResource(TextureHandle sourceTexture, TextureHandle destination)
Resolves the given source resource target into the given destination texture.
void setBufferCounter(BufferHandle bufferHandle, uint32_t value)
Set the associated counter of a buffer.
void draw(PrimitiveType::EPrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes)
Draws non-indexed, non-instanced primitives.
void setRenderTarget(const RenderTargetHandle handle, const DepthStencilHandle depthStencilHandle) override
Sets the current render target and an associated depth stencil target.
void setSamplerState(const SamplerStateBindingHandle samplerStateBindingHandle, const SamplerStateHandle samplerStateHandle)
Sets the sampler state binding given to the given sampler state.
void setBuffer(const BufferBindingHandle bufferBindingHandle, BufferHandle bufferHandle)
Sets a buffer to bind to the given binding.
void setBlendState(const BlendStateHandle handle, const float *constant) override
Set the current blend state.
void readDepthBuffer(BufferHandle bufferHandle, int x, int y, int width, int height, Framebuffer::EFrameBuffer framebuffer)
Reads data from the current depth target into the given bufferHandle.
void setTexture(const TextureBindingHandle textureBindingHandle, const TextureHandle textureHandle)
Sets the texture given to the binding given by textureBindingHandle.
void drawInstancedIndexed(PrimitiveType::EPrimitiveType primitiveType, const size_t startInstance, const size_t numInstances, const size_t startIndex, const size_t numIndexes)
Draws indexed, instanced primitives.
void setRasterizerState(const RasterizerStateHandle handle)
Set the current rasterizer state.
void updateSubTexture(TextureHandle textureHandle, const size_t level, const void *data)
Update the data of a level in the given texture.
void setEffect(EffectHandle handle)
Set the current effect.
void popCommandGroupAnnotation() override
End to tag a sequence of commands as a group in graphics debugger.
void setDepthStencilState(const DepthStencilStateHandle handle)
Set the current depth stencil state.
void endRenderPass() override
End a render pass.
void setInputLayout(const InputLayoutHandle inputLayoutHandle)
Sets the current input layout.
void getBufferCounter(BufferHandle bufferHandle, BufferHandle destinationBufferHandle)
Get the associated counter of a buffer.
void unmap(BufferHandle bufferHandle)
Unmaps the given buffer, applying any synchronization necessary to reflect changes in the mapped memo...
void drawIndexed(PrimitiveType::EPrimitiveType primitiveType, const size_t startIndex, const size_t numIndexes, const size_t startVertex=0)
Draws indexed, non-instanced primitives.
void * map(BufferHandle bufferHandle, MapMode::EMapMode accessMode, uint32_t *stride)
Maps the given buffer so it can be accessed.
void signal(FenceHandle fenceHandle) override
Insert a fence in the command stream that will signal when all commands before the fence are complete...
void setVertexBuffers(const VertexBufferHandle *vertexBufferHandles, const size_t count, const uint32_t *strides, const uint32_t *offsets)
Sets the current vertex buffers.
void setScissor(const int x, const int y, const int width, const int height)
Sets the current scissor rectangle.
void dispatchCompute(const unsigned int threadGroupsX, const unsigned int threadGroupsY, const unsigned int threadGroupsZ)
Dispatch computing work on the graphics device using the desired thread group count.
void clearDepth(const float depth=1.0f)
Clear the currently set depth/stencil target to the given depth.
void beginRenderPass(const RenderPassInfo &info) override
Begin a render pass.
void setViewport(const float x, const float y, const float width, const float height)
Sets the current viewport to the given location and dimensions.
void setIndexBuffer(IndexBufferHandle indexBufferHandle, uint32_t stride, uint32_t offset)
Sets the current index buffer.
void drawInstanced(PrimitiveType::EPrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes, const size_t startInstance, const size_t numInstances)
Draws non-indexed, instanced primitives.
void clearRenderTarget(const float *value)
Clear the currently set render target to the given value (4 component floating point RGBA).
void readColorBuffer(BufferHandle bufferHandle, int x, int y, int width, int height, Framebuffer::EFrameBuffer framebuffer)
Reads data from the current render target into the given bufferHandle.
void setAnnotationMarker(const StringView &name) override
Add a tag in the sequence of commands in graphics debugger.
void setConstantBuffer(const ConstantBufferBindingHandle bufferBinding, const BufferHandle bufferHandle, const uint32_t offset, const uint32_t size)
Sets a constant buffer to the given constant buffer binding.
Provides effects and shader management functionality.
EMapMode
Mapping mode enumeration.
EPrimitiveType
Primitive type enumeration.