Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling DXR shaders to compile with both experimental/official DXR HLSL #412

Merged
merged 3 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Reverting float2 change
  • Loading branch information
Christopher Wallis committed Jun 29, 2018
commit db36641a2870f6366da9a16594f6dd2fc767b1b9
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool IsInsideViewport(float2 p, Viewport viewport)
[shader("raygeneration")]
void MyRaygenShader()
{
float2 lerpValues = DispatchRaysIndex().xy / DispatchRaysDimensions().xy;
float2 lerpValues = (float2)DispatchRaysIndex().xy / DispatchRaysDimensions().xy;

// Orthographic projection since we're raytracing in screen space.
float3 rayDir = float3(0, 0, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ void D3D12RaytracingProceduralGeometry::BuildBotomLevelASInstanceDescs(BLASPtrTy
XMMATRIX mScale = XMMatrixScaling(fWidth.x, fWidth.y, fWidth.z);
XMMATRIX mTranslation = XMMatrixTranslationFromVector(vBasePosition);
XMMATRIX mTransform = mScale * mTranslation;
StoreXMMatrixAsTransform3x4(static_cast<float*>(instanceDesc.Transform), mTransform);
StoreXMMatrixAsTransform3x4(static_cast<float*>(instanceDesc.Transform[0]), mTransform);
}

// Create instanced bottom-level AS with procedural geometry AABBs.
Expand All @@ -889,7 +889,7 @@ void D3D12RaytracingProceduralGeometry::BuildBotomLevelASInstanceDescs(BLASPtrTy

// Move all AABBS above the ground plane.
XMMATRIX mTranslation = XMMatrixTranslationFromVector(XMLoadFloat3(&XMFLOAT3(0, c_aabbWidth/2, 0)));
StoreXMMatrixAsTransform3x4(static_cast<float*>(instanceDesc.Transform), mTranslation);
StoreXMMatrixAsTransform3x4(static_cast<float*>(instanceDesc.Transform[0]), mTranslation);
}
UINT64 bufferSize = static_cast<UINT64>(instanceDescs.size() * sizeof(instanceDescs[0]));
AllocateUploadBuffer(device, instanceDescs.data(), bufferSize, &(*instanceDescsResource), L"InstanceDescs");
Expand Down