Original Post
Hi,
In SM4 or above, we have
Texture Object (DirectX HLSL). Here is the syntax for creating all texture objects (except multisampled objects).
Object1 [] Name;
Suppose I want to write a function that takes a Texture2D parameter. What should the syntax look like?
Depends on the surface format, Texture2D could have many declarations like
Texture2D
Texture2D
Texture2D
Texture2D etc.
It is unrealistic to write functions for all possible combinations, say
MyFunc(Texture2D tex2d)
MyFunc(Texture2D tex2d)
MyFunc(Texture2D tex2d)
MyFunc(Texture2D tex2d)
ideally, I want something like
template
MyFunc(Texture2D tex2d){}
but it gives me errror message like
error X3000: syntax error: unexpected token 'template'
any idea? thank you very much for your help.
In SM4 or above, we have
Texture Object (DirectX HLSL). Here is the syntax for creating all texture objects (except multisampled objects).
Object1 [
Suppose I want to write a function that takes a Texture2D parameter. What should the syntax look like?
Depends on the surface format, Texture2D could have many declarations like
Texture2D
Texture2D
Texture2D
Texture2D
It is unrealistic to write functions for all possible combinations, say
MyFunc(Texture2D
MyFunc(Texture2D
MyFunc(Texture2D
MyFunc(Texture2D
ideally, I want something like
template
MyFunc(Texture2D
but it gives me errror message like
error X3000: syntax error: unexpected token 'template'
any idea? thank you very much for your help.