1#include "Foundation/Logging/Logger.h"
3#include "Rendering/IGraphicsDevice.h"
4#include "Rendering/IContext.h"
5#include "Rendering/IEffects.h"
6#include "Rendering/IBuffers.h"
7#include "Rendering/IRenderTargets.h"
8#include "Rendering/ICapabilities.h"
11#include "ExtensionRegistry.h"
13#include "Systems/Core/LightSystem.h"
15#include "Renderer/Renderer.h"
16#include "Renderer/RenderStates.h"
17#include "Renderer/RenderTarget.h"
18#include "Renderer/RenderTexture.h"
19#include "Renderer/RenderPipelineDefinition.h"
20#include "Renderer/EngineBuffers.h"
22#include "Systems/Core/EnvironmentSystem.h"
23#include "Systems/Core/TransformSystem.h"
25#include "Utilities/Parsing.h"
26#include "Utilities/Preprocessor.h"
27#include "Resources/ResourceStore.h"
29#include "../../TexAtlas/Source/TexAtlasComponent.h"
30#include "../../TexAtlas/Source/TexAtlasSystem.h"
32#include "TwinVisualsSystem.h"
33#include "TwinVisualsComponent.h"
34#include "TwinVisualsTexAtlasRenderTask.h"
36#include <glm/gtc/color_space.hpp>
48 std::string convertDefinesToConst(
const std::string& s) {
50 result.reserve(s.size());
51 std::istringstream iss(s);
52 std::regex e1(
"^\\s*#define\\s+([^\\s]+)\\s+([^\\s]+)");
53 std::regex e2(
"^\\s*#define\\s+([^\\s]+)\\s*$");
54 std::map<std::string, std::string> added;
55 for (std::string line; std::getline(iss, line); ) {
58 if (std::regex_search(line, match, e1)) {
59 id = match.str(1); val = match.str(2);
60 }
else if (std::regex_search(line, match, e2)) {
61 id = match.str(1); val =
"1";
64 result += line +
"\n";
67 if (added.count(
id))
continue;
68 result +=
"const " +
id +
" = " + val +
";\n";
76 std::string preprocessWgslShader(
RenderTaskContext* rtc,
const std::string& shaderPath,
80 for (
const auto& d : desc.definitions) {
81 src +=
"#define " + d.first +
" " + d.second +
"\n";
83 src +=
"#include \"" + shaderPath +
"\"\n";
86 if (!pp.
process(rtc->context, src)) {
87 LOG_ERROR(logger,
"TwinVisualsTexAtlasRenderTask: Failed to preprocess %s", shaderPath.c_str());
91 src = convertDefinesToConst(src);
94 std::string resourcePath =
"TwinVisuals/Shaders/TexAtlasTask" + suffix +
"_" + std::to_string(code) +
".wgsl";
95 rtc->context->resourceStore->addResource(resourcePath, src);
102 glm::mat4 floatCoeffs[4];
103 glm::ivec4 intCoeffs[4];
104 glm::vec4 backgroundColor;
105 glm::vec4 groundColor;
107 glm::vec4 gridLineColorMaj;
108 glm::vec4 gridLineColorMin;
110 float groundElevation;
111 float gridRotationCos;
112 float gridRotationSin;
123 uint32_t levels[4] = { 0, 0, 0, 0 };
124 TwinVisualsTexAtlasStyle style = TwinVisualsTexAtlasStyle::Color;
133 globalBinding.shadowArrayBinding = effects->
getTextureBinding(effect,
"cascadedShadowMap", 1);
134 globalBinding.shadowArrayBinding_1 = effects->
getTextureBinding(effect,
"cascadedShadowMap_1", 1);
135 globalBinding.shadowCubeArrayBinding = effects->
getTextureBinding(effect,
"cubeShadowMap", 2);
136 globalBinding.shadowCubeArrayBinding_1 = effects->
getTextureBinding(effect,
"cubeShadowMap_1", 2);
140 globalBinding.radianceSamplerBinding = effects->
getSamplerStateBinding(effect,
"environmentRadianceSampler", 0);
141 globalBinding.irradianceSamplerBinding = effects->
getSamplerStateBinding(effect,
"environmentIrradianceSampler", 0);
142 globalBinding.ambientIrradianceSamplerBinding = effects->
getSamplerStateBinding(effect,
"ambientIrradianceSampler", 0);
144 globalBinding.skyBinding = effects->
getTextureBinding(effect,
"environmentSky", 0);
151 EngineBuffers* engineBuffers = renderTaskContext->engineBuffers;
156 deviceContext->
setConstantBuffer(globalBinding.sceneBufferBinding, engineBuffers->sceneBufferHandle);
159 if (
bool shadowsEnabled = renderTaskContext->context->
variables->get(
"renderer.shadowsEnabled",
false); shadowsEnabled) {
160 LightSystem* lightSystem = renderTaskContext->context->lightSystem;
163 if (
RenderTexture* shadowTexture = resources->getRenderTexture(lightSystem->cascadeArray); shadowTexture) {
164 deviceContext->
setTexture(globalBinding.shadowArrayBinding, shadowTexture->textureHandle);
169 if (
RenderTexture* shadowTexture = resources->getRenderTexture(lightSystem->cascadeArray); shadowTexture) {
170 deviceContext->
setTexture(globalBinding.shadowArrayBinding_1, shadowTexture->textureHandle);
175 if (
RenderTexture* shadowTexture = resources->getRenderTexture(lightSystem->cubeArray); shadowTexture) {
176 deviceContext->
setTexture(globalBinding.shadowCubeArrayBinding, shadowTexture->textureHandle);
181 if (
RenderTexture* shadowTexture = resources->getRenderTexture(lightSystem->cubeArray); shadowTexture) {
182 deviceContext->
setTexture(globalBinding.shadowCubeArrayBinding_1, shadowTexture->textureHandle);
187 deviceContext->
setSamplerState(globalBinding.shadowSamplerBinding, states->shadowSampler);
192 deviceContext->
setSamplerState(globalBinding.radianceSamplerBinding, states->defaultSampler);
195 deviceContext->
setSamplerState(globalBinding.irradianceSamplerBinding, states->defaultSampler);
197 if (
HandleIsValid(globalBinding.ambientIrradianceSamplerBinding)) {
198 deviceContext->
setSamplerState(globalBinding.ambientIrradianceSamplerBinding, states->defaultSampler);
201 deviceContext->
setSamplerState(globalBinding.brdfLUTSamplerBinding, states->defaultSampler);
204 deviceContext->
setSamplerState(globalBinding.linearSampler, states->defaultSampler);
208 EnvironmentSystem* environmentSystem = renderTaskContext->context->environmentSystem;
210 if (env && env->skyDome) {
211 if (
RenderTexture* skyTexture = renderTaskContext->renderer->getRenderResources().getRenderTexture(env->skyDome); skyTexture) {
212 deviceContext->
setTexture(globalBinding.skyBinding, skyTexture->textureHandle);
217 deviceContext->
setSamplerState(globalBinding.skySamplerBinding, states->defaultSampler);
224 const bool reverseDepth = renderTaskContext->context->
variables->get(
"renderer.reverseDepth",
false);
229 desc.vs =
"TwinVisuals/Shaders/TexAtlasTaskVS.es30.glsl";
230 desc.ps =
"TwinVisuals/Shaders/TexAtlasTaskPS.es30.glsl";
233 desc.vs =
"TwinVisuals/Shaders/TexAtlasTaskVS.wgsl";
234 desc.ps =
"TwinVisuals/Shaders/TexAtlasTaskPS.wgsl";
237 LOG_ERROR(logger,
"TwinVisualsTexAtlasRenderTask: entity does not have a TexAtlasComponent");
242 for (
auto& d : permutation->getDefinition()->definitions) {
243 desc.definitions.emplace_back(d.first, d.second);
247 desc.definitions.push_back({
"COGS_REVERSE_DEPTH",
"1" });
251 switch (renderSettings.sRGBConversion) {
252 case RenderSettings::SRGBConversion::Fast:
253 desc.definitions.push_back({
"COGS_SRGB_CONVERSION_FAST",
"1" });
255 case RenderSettings::SRGBConversion::Approx:
256 desc.definitions.push_back({
"COGS_SRGB_CONVERSION_APPROX",
"1" });
258 case RenderSettings::SRGBConversion::Exact:
259 desc.definitions.push_back({
"COGS_SRGB_CONVERSION_EXACT",
"1" });
262 assert(
false &&
"Invalid enum");
267 switch (renderSettings.tonemapper) {
268 case RenderSettings::Tonemapper::Reinhard:
269 desc.definitions.push_back({
"COGS_TONEMAP_REINHARD",
"1" });
271 case RenderSettings::Tonemapper::Filmic:
272 desc.definitions.push_back({
"COGS_TONEMAP_FILMIC",
"1" });
274 case RenderSettings::Tonemapper::ACESLuminance:
275 desc.definitions.push_back({
"COGS_TONEMAP_ACES_LUMINANCE",
"1" });
277 case RenderSettings::Tonemapper::PBRNeutral:
278 desc.definitions.push_back({
"COGS_TONEMAP_PBR_NEUTRAL",
"1" });
281 assert(
false &&
"Invalid enum");
285 if (renderTaskContext->context->
variables->get(
"renderer.backBuffer.sRGB",
true)) {
286 desc.definitions.emplace_back(
"OUTPUT_SRGB",
"1");
288 if (task.inputSrgb) {
289 desc.definitions.emplace_back(
"INPUT_SRGB",
"1");
291 if (task.lumaInAlpha) {
292 desc.definitions.emplace_back(
"LUMA_IN_ALPHA",
"1");
295 static const std::string keys[4] = {
296 "TEX_ATLAS_LEVELS_0",
297 "TEX_ATLAS_LEVELS_1",
298 "TEX_ATLAS_LEVELS_2",
301 for (
size_t i = 0; i < 4; i++) {
302 if (0 < state.levels[i]) {
303 desc.definitions.emplace_back(keys[i], std::to_string(state.levels[i]));
307 switch (state.style) {
308 case TwinVisualsTexAtlasStyle::Grayscale:
309 desc.definitions.emplace_back(
"TEX_ATLAS_COLORING_GRAYSCALE",
"1");
311 case TwinVisualsTexAtlasStyle::None:
312 desc.definitions.emplace_back(
"TEX_ATLAS_COLORING_NONE",
"1");
314 case TwinVisualsTexAtlasStyle::Color:
317 assert(
false &&
"Invalid enum");
321 EnvironmentSystem* environmentSystem = renderTaskContext->context->environmentSystem;
323 if (env && env->skyDome) {
324 desc.definitions.emplace_back(
"SKY_CUBEMAP",
"1");
329 std::string vsPath = preprocessWgslShader(renderTaskContext, desc.vs, desc,
"VS");
330 std::string psPath = preprocessWgslShader(renderTaskContext, desc.ps, desc,
"PS");
331 if (vsPath.empty() || psPath.empty()) {
332 LOG_ERROR(logger,
"TwinVisualsTexAtlasRenderTask: Failed to preprocess WGSL shaders");
337 desc.definitions.clear();
341 if (effect &&
HandleIsValid(effect->handle) && effect != task.effect) {
342 setupGlobalBindings(renderTaskContext, task.globalBinding, effect->handle);
344 task.effect = effect;
348Cogs::Core::TwinVisualsTexAtlasRenderTask::TwinVisualsTexAtlasRenderTask(
353 const PipelineOptions& )
354: texAtlasSystem(texAtlasSystem)
355, twinVisualsSystem(twinVisualsSystem)
357 assert(texAtlasSystem);
358 assert(twinVisualsSystem);
359 const bool reverseDepth = renderTaskContext->context->
variables->get(
"renderer.reverseDepth",
false);
361 bool depthTest =
true;
362 bool depthWrite =
true;
363 for (
const auto& p : renderTaskDefinition.parameters) {
364 if (p.key ==
"clear") {
365 p.asBool(clearColor);
366 }
else if (p.key ==
"blendMode") {
367 blendMode = parseEnum<BlendMode>(p.value, blendMode);
368 }
else if (p.key ==
"depthTest") {
371 else if (p.key ==
"writeDepth") {
372 p.asBool(depthWrite);
373 }
else if (p.key ==
"inputSrgb") {
376 else if (p.key ==
"outputSrgb") {
377 p.asBool(outputSrgb);
378 }
else if (p.key ==
"lumaInAlpha") {
379 p.asBool(lumaInAlpha);
380 }
else if (p.key ==
"viewportFromTarget") {
381 p.asBool(viewportFromTarget);
393 .writeEnabled = depthWrite,
395 .depthFunction = reverseDepth ? DepthStencilState::GreaterOrEqual : DepthStencilState::LessOrEqual
398 else if (depthWrite) {
400 .depthEnabled =
true,
401 .writeEnabled =
true,
402 .depthFunction = DepthStencilState::Always
407 .depthEnabled =
false,
408 .writeEnabled =
false,
409 .depthFunction = DepthStencilState::Always
414 constants = buffers->
loadBuffer(
nullptr,
sizeof(TexAtlasState::constants), Usage::Dynamic, AccessMode::Write, BindFlags::ConstantBuffer);
417void Cogs::Core::TwinVisualsTexAtlasRenderTask::apply(
RenderTaskContext* renderTaskContext)
419 TexAtlasState state{};
420 RenderResources& renderResources = renderTaskContext->renderer->getRenderResources();
423 const glm::dvec3 origin = renderTaskContext->context->transformSystem->
getOrigin();
427 state.style = tvComp->texAtlasStyle;
430 const float c = std::cos(tvComp->gridRotation);
431 const float s = std::sin(tvComp->gridRotation);
432 glm::dvec2 o = glm::dvec2(origin) - tvComp->gridOrigin;
435 glm::vec2 shift = glm::vec2(fract((1.0 /
double(tvComp->gridSpacingMaj)) * (R * o)));
437 state.constants.backgroundColor = glm::convertSRGBToLinear(renderTaskContext->renderer->
getBackgroundColor());
438 state.constants.groundColor = tvComp->groundColor;
439 state.constants.hazeColor = glm::vec4(tvComp->hazeColor,
440 tvComp->hazeIntensity);
441 state.constants.opaqueness = tvComp->groundOpaqueness;
442 state.constants.groundElevation = float(tvComp->groundElevation - origin.z);
443 state.constants.gridRotationCos = c;
444 state.constants.gridRotationSin = s;
445 state.constants.gridOffsetX = shift.x;
446 state.constants.gridOffsetY = shift.y;
447 state.constants.gridLineColorMaj = tvComp->gridLineColorMaj;
448 state.constants.gridLineColorMin = tvComp->gridLineColorMin;
449 state.constants.gridScaleMaj = tvComp->gridEnable ? (1.f / tvComp->gridSpacingMaj) : 0.f;
450 state.constants.lineWidthMaj = tvComp->gridLineWidthMaj;
451 state.constants.lineWidthMin = tvComp->gridLineWidthMin;
452 state.constants.fadeTweakMaj = tvComp->gridFadeTweakMaj;
453 state.constants.fadeTweakMin = tvComp->gridFadeTweakMin;
459 if (!entity)
continue;
464 LOG_ERROR(logger,
"TwinVisualsTexAtlasRenderTask: entity does not have a TexAtlasComponent");
469 TexAtlasData& texAtlasData = texAtlasSystem->getData(texAtlasComp);
470 texAtlasData.inUse =
true;
472 RenderTexture* treeTex = renderResources.getRenderTexture(texAtlasData.treeTex);
473 RenderTexture* tilesTex = renderResources.getRenderTexture(texAtlasData.tilesTex);
474 if (!treeTex || !tilesTex)
continue;
476 state.constants.floatCoeffs[ix] = texAtlasData.floatCoefficients;
477 state.constants.intCoeffs[ix] = texAtlasData.intCoefficients;
478 state.tilesTex[ix] = tilesTex->textureHandle;
479 state.treeTex[ix] = treeTex->textureHandle;
480 state.levels[ix] = texAtlasData.levels;
485 setupEffect(renderTaskContext, *
this, state);
488 RenderList* renderList = input.get(RenderResourceType::RenderList)->renderList;
489 RenderTarget* renderTarget = output.get(RenderResourceType::RenderTarget)->renderTarget;
491 updateEngineBuffers(renderTaskContext, renderTarget, renderList->viewportData,
nullptr);
495 deviceContext->
setEffect(effect->handle);
499 info.renderTargetHandle = renderTarget->renderTargetHandle;
501 info.loadOp[0] = clearColor ? LoadOp::Clear : LoadOp::Load;
502 info.storeOp[0] = StoreOp::Store;
503 glm::vec4 color = renderTarget->getClearColor();
504 info.clearValue[0][0] = color[0];
505 info.clearValue[0][1] = color[1];
506 info.clearValue[0][2] = color[2];
507 info.clearValue[0][3] = color[3];
508 info.depthLoadOp = LoadOp::Load;
509 info.depthStoreOp = StoreOp::Discard;
520 if (viewportFromTarget) {
521 deviceContext->
setViewport(0.0f, 0.0f,
static_cast<float>(renderTarget->width),
static_cast<float>(renderTarget->height));
526 deviceContext->
setRasterizerState(renderTaskContext->states->defaultRasterizerStateHandle);
527 deviceContext->
setBlendState(renderTaskContext->states->blendStates[
size_t(blendMode)].handle);
532 applyGlobalBindings(renderTaskContext, globalBinding);
534 deviceContext->
updateBuffer(constants, &state.constants,
sizeof(TexAtlasState::constants));
537 static const std::string texAtlasTilesTextureName[4] = {
543 static const std::string texAtlasTilesSamplerName[4] = {
544 "texAtlasTiles0Sampler",
545 "texAtlasTiles1Sampler",
546 "texAtlasTiles2Sampler",
547 "texAtlasTiles3Sampler"
549 static const std::string texAtlasTreeTextureName[4] = {
555 static const std::string texAtlasTreeSamplerName[4] = {
556 "texAtlasTree0Sampler",
557 "texAtlasTree1Sampler",
558 "texAtlasTree2Sampler",
559 "texAtlasTree3Sampler"
562 for (
size_t i = 0; i < 4; i++) {
563 deviceContext->
setTexture(texAtlasTilesTextureName[i], uint32_t(i), state.tilesTex[i]);
564 deviceContext->
setSamplerState(texAtlasTilesSamplerName[i], uint32_t(i), renderStates.commonSamplerStates[1]);
565 deviceContext->
setTexture(texAtlasTreeTextureName[i], uint32_t(i), state.treeTex[i]);
566 deviceContext->
setSamplerState(texAtlasTreeSamplerName[i], uint32_t(i), renderStates.commonSamplerStates[3]);
569 if (
RenderTaskResource* color = input.get(RenderResourceType::RenderTexture,
"ColorTexture"); color && color->renderTexure) {
570 deviceContext->
setTexture(
"colorTexture", 5, color->renderTexure->textureHandle);
571 deviceContext->
setSamplerState(
"colorTextureSampler", 5, renderStates.commonSamplerStates[1]);
573 if (
RenderTaskResource* depth = input.get(RenderResourceType::RenderTexture,
"DepthTexture"); depth && depth->renderTexure) {
574 deviceContext->
setTexture(
"depthTexture", 6, depth->renderTexure->textureHandle);
575 deviceContext->
setSamplerState(
"depthTextureSampler", 6, renderStates.commonSamplerStates[3]);
585void Cogs::Core::TwinVisualsTexAtlasRenderTask::cleanup(
RenderTaskContext* renderTaskContext)
ComponentType * getComponent() const
std::unique_ptr< class Variables > variables
Variables service instance.
EnvironmentComponent * getGlobalEnvironment() const
Get the global environment component.
Holds all LightComponent instances in the system.
Contains render resources used by the renderer.
RenderStates & getRenderStates() override
Get the reference to the RenderStates structure.
IGraphicsDevice * getDevice() override
Get the graphics device used by the renderer.
const RenderSettings & getSettings() const override
Get the settings of the renderer.
glm::vec4 getBackgroundColor() const override
Get the reference to the background color.
EnginePermutations & getEnginePermutations() override
Get the reference to the EnginePermutations structure.
EffectCache & getEffectCache() override
Get the reference to the EffectCache structure.
glm::vec2 getSize() const override
Get the output surface size of the renderer.
Represents a graphics device used to manage graphics resources and issue drawing commands.
virtual IEffects * getEffects()=0
Get a pointer to the effect management interface.
virtual ICapabilities * getCapabilities()=0
Get a pointer to the capability management interface used to query the graphics device capability fla...
virtual IContext * getImmediateContext()=0
Get a pointer to the immediate context used to issue commands to the graphics device.
virtual IBuffers * getBuffers()=0
Get a pointer to the buffer management interface.
virtual GraphicsDeviceType getType() const
Get the type of the graphics device.
virtual IRenderTargets * getRenderTargets()=0
Get a pointer to the render target management interface.
Log implementation class.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
std::shared_ptr< ComponentModel::Entity > EntityPtr
Smart pointer for Entity access.
bool HandleIsValid(const ResourceHandle_t< T > &handle)
Check if the given resource is valid, that is not equal to NoHandle or InvalidHandle.
std::weak_ptr< ComponentModel::Entity > WeakEntityPtr
Weak Smart pointer for Entity access.
constexpr Log getLogger(const char(&name)[LEN]) noexcept
@ OpenGLES30
Graphics device using the OpenGLES 3.0 API.
@ WebGPU
Graphics device using the WebGPU API Backend.
constexpr size_t hash() noexcept
Simple getter function that returns the initial value for fnv1a hashing.
@ TriangleList
List of triangles.
bool process(Context *context, const StringView input)
Run a text block through the preprocessor.
std::string processed
Resulting processed text.
Render settings variables.
Encapsulates state for depth buffer usage and stencil buffer usage in a state object.
bool depthEnabled
If depth testing is enabled/disabled. Default is true.
static const Handle_t NoHandle
Represents a handle to nothing.
Provides buffer management functionality.
virtual BufferHandle loadBuffer(const void *data, const size_t size, Usage::EUsage usage, uint32_t accessMode, uint32_t bindFlags, uint32_t stride=0)=0
Loads a new buffer using the given data to populate the buffer.
virtual void releaseBuffer(BufferHandle bufferHandle)=0
Releases the buffer with the given bufferHandle.
virtual const GraphicsDeviceCapabilities & getDeviceCapabilities() const
Gets the device capabilities in a structure.
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 setRasterizerState(const RasterizerStateHandle handle)=0
Set the current rasterizer state.
virtual void setBlendState(const BlendStateHandle handle, const float *constant=nullptr)=0
Set the current blend state.
virtual void setInputLayout(const InputLayoutHandle inputLayoutHandle)=0
Sets the current input layout.
virtual void clearRenderTarget(const float *value)=0
Clear the currently set render target to the given value (4 component floating point RGBA).
virtual void endRenderPass()=0
End a render pass.
virtual void setIndexBuffer(IndexBufferHandle bufferHandle, uint32_t stride=4, uint32_t offset=0)=0
Sets the current index buffer.
virtual void setDepthStencilState(const DepthStencilStateHandle handle)=0
Set the current depth stencil state.
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 updateBuffer(BufferHandle bufferHandle, const void *data, size_t size)=0
Replace contents of buffer with new data.
virtual void setViewport(const float x, const float y, const float width, const float height)=0
Sets the current viewport to the given location and dimensions.
virtual void draw(PrimitiveType primitiveType, const size_t startVertex, const size_t numVertexes)=0
Draws non-indexed, non-instanced primitives.
virtual void beginRenderPass(const RenderPassInfo &info)=0
Begin a render pass.
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.
virtual void setVertexBuffers(const VertexBufferHandle *vertexBufferHandles, const size_t count, const uint32_t *strides, const uint32_t *offsets)=0
Sets the current vertex buffers.
virtual void setEffect(EffectHandle handle)=0
Set the current effect.
virtual void setRenderTarget(const RenderTargetHandle handle, const DepthStencilHandle depthStencilHandle)=0
Sets the current render target and an associated depth stencil target.
Provides effects and shader management functionality.
virtual SamplerStateBindingHandle getSamplerStateBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot)=0
Get a handle to a sampler state object binding, mapping how to bind the sampler state to the given ef...
virtual ConstantBufferBindingHandle getConstantBufferBinding(EffectHandle effectHandle, const StringView &name)=0
Get a handle to a constant buffer binding, mapping how to bind a constant buffer to the given effect.
virtual TextureBindingHandle getTextureBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot)=0
Get a handle to a texture object binding, mapping how to bind textures to the given effect.
Provides render target management functionality.
virtual void releaseDepthStencilState(DepthStencilStateHandle handle)=0
Release the depth stencil state with the given handle.
virtual DepthStencilStateHandle loadDepthStencilState(const DepthStencilState &depthStencilState)=0
Load a depth stencil state object.