Open Ollhax opened 6 days ago
You can use this declaration in your shader file before we added it to the builtin library:
__generic<let sampleCount:int=0, let format:int=0>
typealias Sampler2DShadow = _Texture<
float,
__Shape2D,
0, // isArray
0, // isMS
sampleCount,
0, // access
1, // isShadow
1, // isCombined
format
>;
Note that _Texture
is an internal type whose declaration can change in the future, so this is only intended as a temporary workaround.
You can use this declaration in your shader file before we added it to the builtin library:
__generic<let sampleCount:int=0, let format:int=0> typealias Sampler2DShadow = _Texture< float, __Shape2D, 0, // isArray 0, // isMS sampleCount, 0, // access 1, // isShadow 1, // isCombined format >;
Note that
_Texture
is an internal type whose declaration can change in the future, so this is only intended as a temporary workaround.
Thank you, that worked splendidly!
I'm trying to do shadowmap rendering for OpenGL and so far I've been relying on the combined samplers that were introduced here, but it doesn't seem like there's one for shadow samplers. There's a SampleCmp function to Sampler2D, but it doesn't appear to work. Basically what I'd need is some way to generate a sampler2DShadow instead of sampler2D - perhaps there should be a Sampler2DShadow variant of Sampler2D?