Merge pull request #2314 from js6i/gpu-crash

Remove spvDescriptor wrapper in spvDescriptorArray
This commit is contained in:
Hans-Kristian Arntzen 2024-04-29 10:17:43 +02:00 committed by GitHub
commit 71fe131ed0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 33 additions and 33 deletions

View File

@ -14,14 +14,14 @@ struct spvDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
struct SSBO

View File

@ -29,14 +29,14 @@ struct spvBufferDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
template<typename T>

View File

@ -14,14 +14,14 @@ struct spvDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
struct SSBO

View File

@ -15,14 +15,14 @@ struct spvDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
template <typename ImageT>

View File

@ -57,14 +57,14 @@ struct spvBufferDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
template<typename T>

View File

@ -14,14 +14,14 @@ struct spvDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
struct SSBO

View File

@ -29,14 +29,14 @@ struct spvBufferDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
template<typename T>

View File

@ -14,14 +14,14 @@ struct spvDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
struct SSBO

View File

@ -15,14 +15,14 @@ struct spvDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
template <typename ImageT>

View File

@ -57,14 +57,14 @@ struct spvBufferDescriptor
template<typename T>
struct spvDescriptorArray
{
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(ptr)
spvDescriptorArray(const device spvDescriptor<T>* ptr) : ptr(&ptr->value)
{
}
const device T& operator [] (size_t i) const
{
return ptr[i].value;
return ptr[i];
}
const device spvDescriptor<T>* ptr;
const device T* ptr;
};
template<typename T>

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("");
}