Graphics Reference
In-Depth Information
(
*m_pComputeShaderEffect
, d.Width / 16
, d.Height / 16
, 1
, m_pRendererll->m_pParamMgr
);
// Bind the output to the hull shader
m_pRendererll->m_pParamMgr->SetShaderResourceParameter
( L"texLODLookup", m_pLodLookupTexture );
Listing 9.18. Executing the compute shader.
The code after the Dispatch() call in Listing 9.18 is particularly important. Without
this being executed, the UAV will still be bound to the pipeline referencing the 2D output
texture; Direct3D will then keep it from also being bound as an input to the hull shader,
since it is illegal to have a resource set to be both an input and output at the same time!
Figure 9.22. Naive Distance Based LOD 32,500
Figure 9.23. Compute Shader Based LOD 22,232
Triangles generated, 76% rasterized.
triangles generated, 77% rasterized.
Search WWH ::




Custom Search