Skip to content
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

APPLE: Texture and buffer writability in Metal/HGI along with settings where appropriate #2042

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

slingthor
Copy link
Contributor

@slingthor slingthor commented Sep 15, 2022

Description of Change(s)

Allows HGI to define readonly buffers and textures
Allow HGIMetal to consume readonly buffers and textures
Take advantage of that in the resource binder and as well in hdx where we manually set up resources
Sets buffers we don't index into to live in constant space, and pass them as const reference instead of as a pointer in device space on Metal

  • I have submitted a signed Contributor License Agreement

@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-7640

@@ -130,6 +131,7 @@ struct HgiTextureBindDesc
HgiBindResourceType resourceType;
uint32_t bindingIndex;
HgiShaderStage stageUsage;
bool readOnly;
Copy link
Contributor

@creijon creijon Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In shadersection we use _writable while here we use readOnly. For consistency shouldn't they be the same?

Copy link
Contributor

@creijon creijon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure that the readOnly flag is initialised in every instance of the HgiBufferBindDesc creation. There's a few instances in flatNormals.cpp, quadrangulate.cpp, resourceBinder.cpp, smoothNormals.cpp, subdivision.cpp, boundingBoxTask.cpp, that need to be covered.

Also the comparator in resourceBindings.cpp needs to include a test for the flag.

@slingthor
Copy link
Contributor Author

PR updated! Will be sharing some metrics on MacOS as well

@pixar-oss pixar-oss merged commit c2f34be into PixarAnimationStudios:dev Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants