1#include "ClearResourceTask.h"
4#include "Services/Time.h"
5#include "Renderer/RenderBuffer.h"
6#include "Platform/Instrumentation.h"
8#include "Rendering/IGraphicsDevice.h"
9#include "Rendering/IContext.h"
11#include "Foundation/Logging/Logger.h"
18void Cogs::Core::ClearResourceTask::apply(RenderTaskContext * renderContext)
20 RenderInstrumentationScope(renderContext->device->getImmediateContext(), SCOPE_RENDERING,
"ClearResourceTask::apply");
22 auto device = renderContext->device;
23 auto deviceContext = device->getImmediateContext();
25 for (
auto & r : output.resources) {
26 assert(r.type == RenderResourceType::RenderBuffer);
27 auto outputBuffer = output.get(RenderResourceType::RenderBuffer)->renderBuffer;
31 deviceContext->clearResource(outputBuffer->getHandle(destinationIndex), fill.FValues);
34 deviceContext->clearResource(outputBuffer->getHandle(destinationIndex), fill.UValues);
36 outputBuffer->setFrame(destinationIndex, renderContext->context->time->getFrame());
38 LOG_ERROR(logger,
"Input/output buffers not valid.");
Log implementation class.
constexpr Log getLogger(const char(&name)[LEN]) noexcept