| 1073 | } |
| 1074 | |
| 1075 | void GlobalSignDistanceFieldPass::RenderDebug(RenderContext& renderContext, GPUContext* context, GPUTexture* output) |
| 1076 | { |
| 1077 | BindingData bindingData; |
| 1078 | if (Render(renderContext, context, bindingData)) |
| 1079 | { |
| 1080 | context->Draw(output, renderContext.Buffers->GBuffer0); |
| 1081 | return; |
| 1082 | } |
| 1083 | |
| 1084 | PROFILE_GPU_CPU("Global SDF Debug"); |
| 1085 | const Float2 outputSize(output->Size()); |
| 1086 | { |
| 1087 | Data data; |
| 1088 | data.ViewWorldPos = renderContext.View.Position; |
| 1089 | data.ViewNearPlane = renderContext.View.Near; |
| 1090 | data.ViewFarPlane = renderContext.View.Far; |
| 1091 | for (int32 i = 0; i < 4; i++) |
| 1092 | data.ViewFrustumWorldRays[i] = Float4(renderContext.List->FrustumCornersWs[i + 4], 0); |
| 1093 | data.GlobalSDF = bindingData.Constants; |
| 1094 | context->UpdateCB(_cb0, &data); |
| 1095 | context->BindCB(0, _cb0); |
| 1096 | } |
| 1097 | context->BindSR(0, bindingData.Texture ? bindingData.Texture->ViewVolume() : nullptr); |
| 1098 | context->BindSR(1, bindingData.TextureMip ? bindingData.TextureMip->ViewVolume() : nullptr); |
| 1099 | context->SetState(_psDebug); |
| 1100 | context->SetRenderTarget(output->View()); |
| 1101 | context->SetViewportAndScissors(outputSize.X, outputSize.Y); |
| 1102 | context->DrawFullscreenTriangle(); |
| 1103 | } |
| 1104 | |
| 1105 | void GlobalSignDistanceFieldPass::GetCullingData(BoundingBox& bounds) const |
| 1106 | { |
nothing calls this directly
no test coverage detected