MCPcopy Create free account
hub / github.com/TheRealMJP/DXRPathTracer / SetViewport

Function SetViewport

SampleFramework12/v1.02/Graphics/DX12_Helpers.cpp:518–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518void SetViewport(ID3D12GraphicsCommandList* cmdList, uint64 width, uint64 height, float zMin, float zMax)
519{
520 D3D12_VIEWPORT viewport = { };
521 viewport.Width = float(width);
522 viewport.Height = float(height);
523 viewport.MinDepth = zMin;
524 viewport.MaxDepth = zMax;
525 viewport.TopLeftX = 0.0f;
526 viewport.TopLeftY = 0.0f;
527
528 D3D12_RECT scissorRect = { };
529 scissorRect.left = 0;
530 scissorRect.top = 0;
531 scissorRect.right = uint32(width);
532 scissorRect.bottom = uint32(height);
533
534 cmdList->RSSetViewports(1, &viewport);
535 cmdList->RSSetScissorRects(1, &scissorRect);
536}
537
538void CreateRootSignature(ID3D12RootSignature** rootSignature, const D3D12_ROOT_SIGNATURE_DESC1& desc)
539{

Callers 9

RenderSunShadowMapMethod · 0.85
RenderMethod · 0.85
RenderClustersMethod · 0.85
RenderForwardMethod · 0.85
RenderResolveMethod · 0.85
EndFrameFunction · 0.85
PostProcessMethod · 0.85
ConvertShadowMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected