-
Notifications
You must be signed in to change notification settings - Fork 689
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
[spirv] Handle invalid arg for residency code. #3064
Conversation
@@ -3216,6 +3216,13 @@ SpirvInstruction *SpirvEmitter::processBufferTextureLoad( | |||
return nullptr; | |||
} | |||
|
|||
if (residencyCode && residencyCode->isRValue()) { |
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.
What happens if residencyCode
is nullptr
?
Why don't we change this condition to if (residencyCode == nullptr || residencyCode->isRValue()) {
?
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 function (SpirvEmitter::processBufferTextureLoad
) handles the Load methods. There are 2 Load methods that are defined for textures and buffer: one method that just does the load, and one method that does the load and also returns the status of the operation.
For example, for Texture2D we have these 2 methods: (spec)
Load(int,int) : Reads texture data.
Load(int,int,uint) : Reads texture data and returns status of the operation.
In the first method, residencyCode
is in fact nullptr
and it should not be an error.
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.
Got it. It would be better to add a comment to briefly explain it.
Fixes #3045