Graphics Reference
In-Depth Information
ID3DllDeviceContext::HSSetShader()
ID3DllDeviceContext::HSSetConstantBuffers()
ID3DllDeviceContext::HSSetShaderResources()
ID3DllDeviceContext::HSSetSamplers()
In addition to the resources that can be bound to the hull shader stage by the applica-
tion, a number of other function attributes can be specified in the HLSL code. These are
also described below.
Shader Program
The hull shader program is compiled in the same way as any of the other HLSL programs. 1 4
The distinction is that the hull shader program must be preceded by the patch constant
function, and immediately preceded by a list of function-level attributes. These items must
all be located within the same HLSL file and compiled into shader byte code, along with
the main hull shader program. The resulting byte code is then used to create an instance
of the ID3DllHullShader object, which is then bound to the pipeline through the device
context.
Constant Buffers
The primary means of communicating data to the hull shader program is the constant buffer
mechanism. This operates in precisely the same way shown for the vertex shader stage. The
same the recommendations regarding the persistence of setting of constant buffers between
pipeline executions applies here.
Shader Resource Views
Another possible source of read-only data for the hull shader program is the shader re-
source views. These provide read-only access to a wide array of resources, as discussed
in Chapter 2. Resources provide a larger pool of available memory to the hull shader than
constant buffers do, but they can also potentially be slower to access.
Samplers
Once again, samplers provide a mechanism for performing filtering operations on texture
resources. The hull shader stage has access to this functionality, just as discussed for the
vertex shader.
1 4
See Chapter 6, "The High Level Shading Language," for details about how to compile and create shader
objects.
Search WWH ::




Custom Search