MSL: Remove pointer wrapper stored in spvDescriptorArray.

This works around what looks like a compiler bug which can cause GPU crashes.
This commit is contained in:
Jan Sikorski 2024-04-18 09:13:29 +02:00
parent cb956675fd
commit 298c2315f5

View File

@ -7419,14 +7419,14 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("struct spvDescriptorArray");
begin_scope();
statement("spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)");
statement("spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)");
begin_scope();
end_scope();
statement("const device T& operator [] (size_t i) const");
begin_scope();
statement("return ptr[i].value;");
statement("return ptr[i];");
end_scope();
statement("const device spvDescriptor<T>* ptr;");
statement("const device T* ptr;");
end_scope_decl();
statement("");
}