How To: Create a Domain Shader

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

A domain shader is the third of three stages that work together to implement tessellation. The inputs for the domain-shader stage come from a hull shader. This topic shows how to create a domain shader.

A domain shader transforms surface geometry (created by the fixed-function tessellator stage) using hull shader output-control points, hull shader output patch-constant data, and a single set of tessellator uv coordinates.

Ff476336.wedge(en-us,VS.85).gifTo create a domain shader

  1. Design a domain shader. See How To: Design a Domain Shader.
  2. Compile the shader code.
  3. Create a domain-shader object using ID3D11Device::CreateDomainShader.
    
    
    HRESULT CreateDomainShader(
      const void *pShaderBytecode, // 
      SIZE_T BytecodeLength, // 
      ID3D11ClassLinkage *pClassLinkage, // 
      ID3D11DomainShader **ppDomainShader
    );
    
    
    
  4. Initialize the pipeline stage using ID3D11DeviceContext::DSSetShader.
    
    
    void DSSetShader(
      ID3D11DomainShader *pDomainShader, // 
      ID3D11ClassInstance *const *ppClassInstances,
      UINT NumClassInstances
    );
    
    
    

A domain shader must be bound to the pipeline if a hull shader is bound. In particular, it is not valid to directly stream out hull shader control points with the geometry shader.

Related topics

Tessellation Overview

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

© 2013 Microsoft. All rights reserved.