Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2021-05-21 14:03:05 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2021-05-21 14:46:33 +0300
commit99ae0d32e92a8746acce1e7131cb00c646ff1050 (patch)
treed2459f94c5cc5862bbddcf1e087fc604977e5a39 /spirv_msl.hpp
parenta64ddcdd4901c2a4cb125c3bf276755f3342f742 (diff)
MSL: Handle array with component when we cannot rely on user() attrib.
In these cases, we emit one variable per location, and so we must flatten stuff.
Diffstat (limited to 'spirv_msl.hpp')
-rw-r--r--spirv_msl.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/spirv_msl.hpp b/spirv_msl.hpp
index 95e0c966..61f54be1 100644
--- a/spirv_msl.hpp
+++ b/spirv_msl.hpp
@@ -799,8 +799,12 @@ protected:
{
struct LocationMeta
{
+ uint32_t base_type_id = 0;
uint32_t num_components = 0;
- uint32_t ib_index = ~0u;
+ bool flat = false;
+ bool noperspective = false;
+ bool centroid = false;
+ bool sample = false;
};
std::unordered_map<uint32_t, LocationMeta> location_meta;
bool strip_array = false;
@@ -815,6 +819,9 @@ protected:
SPIRType &ib_type, SPIRVariable &var, InterfaceBlockMeta &meta);
void add_plain_variable_to_interface_block(spv::StorageClass storage, const std::string &ib_var_ref,
SPIRType &ib_type, SPIRVariable &var, InterfaceBlockMeta &meta);
+ bool add_component_variable_to_interface_block(spv::StorageClass storage, const std::string &ib_var_ref,
+ SPIRVariable &var, const SPIRType &type,
+ InterfaceBlockMeta &meta);
void add_plain_member_variable_to_interface_block(spv::StorageClass storage, const std::string &ib_var_ref,
SPIRType &ib_type, SPIRVariable &var, uint32_t index,
InterfaceBlockMeta &meta);