-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hashing of assets #468
base: master
Are you sure you want to change the base?
Hashing of assets #468
Conversation
@devshgraphicsprogramming Could you take a look at the implementation of the new methods in |
Also i have not seen any mention of |
not fully developed yet |
return compatible(_other); | ||
} | ||
|
||
|
||
bool canBeRestoredFrom(const IAsset* _other) const override | ||
{ | ||
auto* other = static_cast<const ICPUAccelerationStructure*>(_other); | ||
_NBL_TODO(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because canBeRestoredFrom
is incomplete im not sure which fields to compare in compatible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats fine, as long as you make a compatible_impl()
with an _NBL_TODO
E_TYPE getAssetType() const override | ||
{ | ||
return ET_COMMAND_BUFFER; | ||
return AssetType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though this entire class is incomplete, ive changed the getAssetType to look similar to other IAsset derived classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably nuke that entire class/header, we intend to have a GPU-Task-Graph instead to deal with synchronisation/layout transitions later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have messed up some things by hashing immutable fields in classes without any other members
bool equals(const IAsset* _other) const override | ||
{ | ||
auto* other = static_cast<const ICPUBuffer*>(_other); | ||
return compatible(other) && (m_creationParams.usage.value == other->m_creationParams.usage.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcmp the two buffers or compare the void* data;
of the two buffers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you want to compare usage in compatible_impl
probably
and please compare pointers not contents, will be much much faster and more accurate
P.S. you also want to turn equals
into equals_impl
pattern too
btw can you make |
We can also probably nuke //! Checks if the object is either not dummy or dummy but in some cache for a purpose
inline bool isInValidState() { return !isDummyObjectForCacheAliasing /* || !isCached TODO*/; } from P.S. and a bunch of other things, basically anything not used after implementing https://discord.com/channels/593902898015109131/1078226704092381194/1083069244650045600 |
bool canBeRestoredFrom(const IAsset* _other) const override | ||
{ | ||
auto* other = static_cast<ICPUBufferView*>(_other); | ||
auto* other = static_cast<const ICPUBufferView*>(_other); | ||
return compatible(other) && m_buffer->canBeRestoredFrom(other->m_buffer.get()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superceded by https://discord.com/channels/593902898015109131/1078226704092381194/1083069244650045600 |
a07e79f
to
ffbd843
Compare
##Description
Adds new methods to
IAsset
interface as a prerequisite for asset converter v2IAssets derived classes
A list of classes that need their implementation of
hash
,compare
,canBeRestoredFrom
written/changed