| 703 | } |
| 704 | |
| 705 | void BakingLab::RenderAA() |
| 706 | { |
| 707 | PIXEvent pixEvent(L"MSAA Resolve + Temporal AA"); |
| 708 | |
| 709 | ID3D11DeviceContext* context = deviceManager.ImmediateContext(); |
| 710 | |
| 711 | ID3D11RenderTargetView* rtvs[1] = { colorResolveTarget.RTView }; |
| 712 | |
| 713 | context->OMSetRenderTargets(1, rtvs, nullptr); |
| 714 | |
| 715 | const uint32 SampleRadius = static_cast<uint32>((AppSettings::FilterSize / 2.0f) + 0.499f); |
| 716 | ID3D11PixelShader* pixelShader = resolvePS[AppSettings::MSAAMode]; |
| 717 | context->PSSetShader(pixelShader, nullptr, 0); |
| 718 | context->VSSetShader(resolveVS, nullptr, 0); |
| 719 | |
| 720 | resolveConstants.Data.TextureSize = Float2(float(colorTargetMSAA.Width), float(colorTargetMSAA.Height)); |
| 721 | resolveConstants.Data.SampleRadius = SampleRadius; |
| 722 | resolveConstants.Data.EnableTemporalAA = AppSettings::EnableTemporalAA && AppSettings::ShowGroundTruth == false; |
| 723 | resolveConstants.ApplyChanges(context); |
| 724 | resolveConstants.SetPS(context, 0); |
| 725 | |
| 726 | ID3D11ShaderResourceView* srvs[4] = { colorTargetMSAA.SRView, velocityTargetMSAA.SRView, |
| 727 | prevFrameTarget.SRView, postProcessor.AdaptedLuminance() }; |
| 728 | context->PSSetShaderResources(0, 4, srvs); |
| 729 | |
| 730 | ID3D11SamplerState* samplers[1] = { samplerStates.LinearClamp() }; |
| 731 | context->PSSetSamplers(0, 1, samplers); |
| 732 | |
| 733 | ID3D11Buffer* vbs[1] = { nullptr }; |
| 734 | UINT strides[1] = { 0 }; |
| 735 | UINT offsets[1] = { 0 }; |
| 736 | context->IASetVertexBuffers(0, 1, vbs, strides, offsets); |
| 737 | context->IASetInputLayout(nullptr); |
| 738 | context->IASetIndexBuffer(nullptr, DXGI_FORMAT_R16_UINT, 0); |
| 739 | context->Draw(3, 0); |
| 740 | |
| 741 | rtvs[0] = nullptr; |
| 742 | context->OMSetRenderTargets(1, rtvs, nullptr); |
| 743 | |
| 744 | srvs[0] = srvs[1] = srvs[2] = srvs[3] = nullptr; |
| 745 | context->PSSetShaderResources(0, 4, srvs); |
| 746 | |
| 747 | context->CopyResource(prevFrameTarget.Texture, colorResolveTarget.Texture); |
| 748 | } |
| 749 | |
| 750 | void BakingLab::RenderBackgroundVelocity() |
| 751 | { |
nothing calls this directly
no test coverage detected