Previously, we would generate parentheses proactively when generating
binary ops, however, this leads to uglier code and hits warnings in
compilers when used as a conditional.
Add CompilerMSL emit_instruction() and emit_glsl_op() functions
to handle MSL-specific operation and function definitions.
Remove CompilerMSL emit_msl_defines() function.
Use entry point name if no function name provided.
When flattening in/out structs, qualify member names with struct name.
Fix issue when determining declared size of struct types.
Refactor use of m_ name prefix.
Identify header defines in MSL code.
- adds some common macros that correct for intrinsic differences
- adds some inline functions to adapt for GLSL terms
- injects structure member names when the original SPV has been stripped - there is another way to use the correct temporarily assigned member name, but using m_<id> based on the inside SPV code yields metal code that more correctly maps to the original SPV opcodes/slots.
The size of an array can be a specialization constant or a spec constant
op. This complicates things quite a lot.
Reflection becomes very painful in the presence of expressions instead
of literals so add a new array which expresses this.
It is unlikely that we will need to do accurate reflection of interface
types which have specialization constant size.
SSBOs and UBOs will for now throw exception if a dynamic size is used since it
is very difficult to know the real size.
- Only consider I/O variables if part of OpEntryPoint.
- Keep a safe fallback if #entry-points is 1 to avoid potentially
breaking previously working shaders.
Add Decoration qualified_alias element.
Virualize Compiler to_name() function.
MSL use qualified_alias instead of alias when inside entry-point function.
OpName is only for debug information, so we must be very careful that
we do not reuse the same name for different variables.
This was previously done for local variables, but this commit extends
this to global variables as well.
Reformats the entire codebase. Better to do it now than later.
Adds .clang-format and a convenience script format_all.sh which formats
everything automatically.
Add virtual CompilerGLSL emit_sampled_image_op function for OpSampledImage.
Under MSL, set sampler ID for local OpSampledImage objects and extract it when emitting sampler.