Graphics Reference
In-Depth Information
Figure 9.18. Compute shader phase two.
{
rawNormals[l] [0] = normalize(cross
(
corners[0][0] - corners[l][0] ,
corners[l] [1] - corners[l][0]
));
}
else if((GTid.x == 0) && (GTid.y == 15))
{
rawNormals[0] [1] = normalize(cross
(
corners[l][1] - corners[0][1],
corners[0][0] - corners[0][1]
));
}
else if((GTid.x == 15) && (GTid.y == 15))
{
rawNormals[l][1] = normalize(cross
(
corners[l][0] - corners[l][1] ,
corners[0][l] - corners[l][l]
));
}
else
{
// This is just one of the other threads, so let it
// load in its sample into shared memory
groupResults[GI] = texHeightMap.Load( uint3( DTid.xy, 0 ) ) .r ;
}
// Block until all the data is ready
GroupMemoryBarrierWithGroupSync();
Listing 9.13. Phase two of the compute shader.
Search WWH ::




Custom Search