You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The variable remap stuff was never really meant to remap names other than the weird GLSL scenarios where it's meaningful, i.e. rename variables to remap to builtins to poke at specific extensions. Do you have a concrete use case where remapping variables would make sense in MSL? Remapping the names in these places won't work that well I think since both the declaration and any uses of the variable would have to know about the name, but it's probably solvable given some effort.
I personally use it in two situations: the first... to parse Texture<float> > Texture<half> for variables with a RelaxedPrecision decorator, so it passes SPIR-V validation. The second... to remap a wrapper for the atomics issue in MSL emission where certain decorated variables are remapped into atomic<type>. I generally find it super useful to bridge the expressiveness gap between HLSL, SPIR-V, and MSL sometimes!
set_variable_type_remap_callback
does not work on a MSL compiler becauseremap_variable_type_name
is largely absent in spriv_msl.cpp.Two examples of where it's absent:
In
void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
The image type emission should look more like this:
In
string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const string &qualifier)
The last few lines of that method should look more like this:
The call to the remap callback is largely absent from whenever CompilerMSL overrides CompilerGLSL.
The text was updated successfully, but these errors were encountered: