-
Notifications
You must be signed in to change notification settings - Fork 269
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
Metal fix #6413
Metal fix #6413
Conversation
tools/gfx/metal/metal-device.cpp
Outdated
@@ -404,7 +404,7 @@ Result DeviceImpl::createTextureResource( | |||
break; | |||
} | |||
|
|||
bool isArray = desc.arraySize > 0; | |||
bool isArray = desc.arraySize > 1; |
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.
This was discussed when it was initially submitted.
Please see the discussion:
#4331 (comment)
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.
@skallweitNV for an opinion.
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 wonder why this is needed? What issue is this fixing?
Are there no 1-element texture arrays in metal?
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 fix this issue on SGL side. So no fix needed here.
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.
The issue I'm trying to fix is that SGL presume that desc.arraySize == 1
is a non-array texture, however, slang-gfx assume this is a texture array with array size of 1. Those assumption conflicts.
In the new commit, I fix an obvious bug in metal. |
FYI @skallweitNV the same issue is also in slang-rhi. |
In newTextureView, levelRange should represent the mipmap level range, while sliceRange should represent the texture layer range for texture array. But the implement inverse those two wrongly.
8db65b6
to
1e22f53
Compare
Fix the issue in creating texture view in metal.
In newTextureView, levelRange should represent the mipmap level range,
while sliceRange should represent the texture layer range for texture
array. But the implementation inverses those two wrongly.
Fix the issue when emitting read only texture_buffer<>
texture_buffer doesn't support access::sample, we should emit access::read when it's read only buffer.