MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Render

Method Render

Source/Engine/Renderer/ContrastAdaptiveSharpeningPass.cpp:71–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void ContrastAdaptiveSharpeningPass::Render(const RenderContext& renderContext, GPUTexture* input, GPUTextureView* output)
72{
73 ASSERT_LOW_LAYER(CanRender(renderContext));
74 PROFILE_GPU_CPU("Contrast Adaptive Sharpening");
75 auto device = GPUDevice::Instance;
76 auto context = device->GetMainContext();
77 const AntiAliasingSettings& antiAliasing = renderContext.List->Settings.AntiAliasing;
78
79 Data data;
80 data.InputSizeInv = Float2::One / input->Size();
81 data.SharpeningAmount = antiAliasing.CAS_SharpeningAmount;
82 data.EdgeSharpening = antiAliasing.CAS_EdgeSharpening;
83 data.MinEdgeThreshold = antiAliasing.CAS_MinEdgeThreshold;
84 data.OverBlurLimit = antiAliasing.CAS_OverBlurLimit;
85 const auto cb = _shader->GetShader()->GetCB(0);
86 context->UpdateCB(cb, &data);
87 context->BindCB(0, cb);
88 context->BindSR(0, input);
89 context->SetState(_psCAS);
90 context->SetRenderTarget(output);
91 context->DrawFullscreenTriangle();
92}

Callers

nothing calls this directly

Calls 10

CanRenderFunction · 0.85
GetMainContextMethod · 0.45
SizeMethod · 0.45
GetShaderMethod · 0.45
UpdateCBMethod · 0.45
BindCBMethod · 0.45
BindSRMethod · 0.45
SetStateMethod · 0.45
SetRenderTargetMethod · 0.45

Tested by

no test coverage detected