Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ void RTAO::CreateSamplesRNG()
m_samplesGPUBuffer[i].value = XMFLOAT2(p.x * 0.5f + 0.5f, p.y * 0.5f + 0.5f);
m_hemisphereSamplesGPUBuffer[i].value = p;
}
m_numAOSamplesUploadFrames = m_deviceResources->GetBackBufferCount();
}

void RTAO::GetRayGenParameters(bool* isCheckerboardSamplingEnabled, bool* checkerboardLoadEvenPixels)
Expand Down Expand Up @@ -547,8 +548,11 @@ void RTAO::Run(
}

// Copy dynamic buffers to GPU.
UpdateConstantBuffer(frameIndex);

if (m_numAOSamplesUploadFrames)
{
UpdateConstantBuffer(frameIndex);
m_numAOSamplesUploadFrames--;
m_hemisphereSamplesGPUBuffer.CopyStagingToGpu(frameIndex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class RTAO
StructuredBuffer<AlignedHemisphereSample3D> m_hemisphereSamplesGPUBuffer;
BOOL m_isRecreateAOSamplesRequested = true;

UINT m_numAOSamplesUploadFrames = 0;
UINT m_numAORayGeometryHits;
bool m_checkerboardGenerateRaysForEvenPixels = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ void main(uint2 DTid : SV_DispatchThreadID)
{
VertexPositionNormalTextureTangent vertex;
vertex.position = 0;
vertex.normal = 0;
vertex.textureCoordinate = 0;
vertex.tangent = 0;
uint threadID = DTid.x + DTid.y * cb.p.maxPatchDim.x;
uint baseVertexID = threadID * N_GRASS_VERTICES;

Expand Down