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
Don't upload texture if locked using TEXTURELOCK_READ #6003
Conversation
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 can completely remove _lockedLevel
as it's unused after your changes.
Definitely - but I think it could still be put to good use as described in #6004, so depending on what the PC team thinks about that, I may add more to this PR. |
TBH the team had internally mumbled wanting to completely rewrite the texture API, but this is often a pipe-dream. Breaking backwards compatibility is very painful for us and our users. I love this PR and the issue you created with explanation. It is well thought out and a clear improvement to the API - thanks so much! |
related to #4237 |
Ha, I actually forgot about this! I guess this API has been on my mind for a while 😄 |
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.
Nice PR - approving (although agree with the feedback from @mvaligursky)
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.
Nice, thanks!
I'll probably follow up (soon-ish) with a PR that implements my proposal in #6004; it may be easier to consider/discuss when you see a concrete implementation. |
The API docs suggest that you can call
texture.lock()
with amode
of eitherTEXTURELOCK_READ
orTEXTURELOCK_WRITE
, but in this option doesn't do anything.This is a small change so that a lock that's opened with
TEXTURELOCK_READ
will not calltexture.upload()
when unlocked. It also uses the mode to check the state, instead of overloadingtexture._lockedLevel
for this purpose.I also have some related questions about how we should handle mip updates via API - please see #6004