summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2023-05-10 12:46:35 +0200
committerHans-Kristian Arntzen <post@arntzen-software.no>2023-05-10 12:46:35 +0200
commit193ca867cad5fbc367775f785fcbc18134a040d7 (patch)
treec88844d642524417e0fa4e1c38477baa65d1acf9
parent88790d314518d183661870c23934db2b91c2ced9 (diff)
downloadSPIRV-Cross-193ca867cad5fbc367775f785fcbc18134a040d7.tar.gz
SPIRV-Cross-193ca867cad5fbc367775f785fcbc18134a040d7.tar.bz2
SPIRV-Cross-193ca867cad5fbc367775f785fcbc18134a040d7.zip
MSL: Don't hit array copy path for pointer to array.
Pointee type of load and store pointers must be a top-level array type.
-rw-r--r--spirv_glsl.cpp2
-rw-r--r--spirv_msl.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp
index 2575c507..e0311167 100644
--- a/spirv_glsl.cpp
+++ b/spirv_glsl.cpp
@@ -7752,7 +7752,7 @@ bool CompilerGLSL::expression_is_constant_null(uint32_t id) const
bool CompilerGLSL::expression_is_non_value_type_array(uint32_t ptr)
{
auto &type = expression_type(ptr);
- if (type.array.empty())
+ if (!type_is_top_level_array(get_pointee_type(type)))
return false;
if (!backend.array_is_value_type)
diff --git a/spirv_msl.cpp b/spirv_msl.cpp
index f2b74d5a..64f1e4bb 100644
--- a/spirv_msl.cpp
+++ b/spirv_msl.cpp
@@ -9603,7 +9603,7 @@ bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs)
{
// We only care about assignments of an entire array
auto &type = expression_type(id_rhs);
- if (type.array.size() == 0)
+ if (!type_is_top_level_array(get_pointee_type(type)))
return false;
auto *var = maybe_get<SPIRVariable>(id_lhs);