Open Programiao opened 4 years ago
I don't know that HLSL has a feature for doing this. We could probably do it with glslang using the attribute [[...]] syntax, if that's considered portable enough.
That would be handy.
could u elaborate more how to do it? Not sure if attribute [[...]] means some additional glslang options or not. Thx
Searched online but found nothing related with precision in hlsl attribute [[...]]. Appreciate any help
@g-exp I think the discussion is about implementing this feature in glslang using the attribute syntax. I don't believe it has been implemented yet.
Got it thanks for the info, and wonder any other way to set relaxed precision sampler BTW, sorry just a newbie here, do setting mediump sampler and setting mediump datatype in Texture have the same effect here, in compiler such as glslang and spirvcross?
I'm currently writing HLSL that compiles to Spir-V and then to GLSL using Spirv-Cross. I'm trying to output some of the samplers to mediump and other samplers remain highp in GLSL. I tried to use min16float as Texture type. But seems like glslang will ignore it.
Setting default precision to spirv_cross::CompilerGLSL::Options will change all samplers uniformly which doesn't work neither.
Is there a way to mark a texture sampler as relaxed precision or not in hlsl?