#include "glspirv.h"
#include "errors.h"
#include "shaderobj.h"
+#include "mtypes.h"
#include "compiler/nir/nir.h"
#include "compiler/spirv/nir_spirv.h"
prog->_LinkedShaders[shader_type] = linked;
prog->data->linked_stages |= 1 << shader_type;
}
+
+ int last_vert_stage =
+ util_last_bit(prog->data->linked_stages &
+ ((1 << (MESA_SHADER_GEOMETRY + 1)) - 1));
+
+ if (last_vert_stage)
+ prog->last_vert_prog = prog->_LinkedShaders[last_vert_stage - 1]->Program;
}
nir_shader *
}
const struct spirv_to_nir_options spirv_options = {
+ .lower_workgroup_access_to_offsets = true,
.caps = ctx->Const.SpirVCapabilities
};
prog->Name);
nir_validate_shader(nir);
+ NIR_PASS_V(nir, nir_copy_prop);
+
+ /* Split member structs. We do this before lower_io_to_temporaries so that
+ * it doesn't lower system values to temporaries by accident.
+ */
+ NIR_PASS_V(nir, nir_split_var_copies);
+ NIR_PASS_V(nir, nir_split_per_member_structs);
+
return nir;
}