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
x/mobile/gl: change TexSubImage2D signature to allow providing a byte offset via data parameter #36355
Comments
Change https://golang.org/cl/213077 mentions this issue: |
Looks like |
@hajimehoshi In https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml, it states very clearly that:
I'm not seeing an equivalent note present at https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexSubImage2D.xhtml. In the original issue, do I understand correctly that you were referring to this part of
|
Ah good point. My current understanding is that meanings of the null data are different between To satisfy all |
I'm not confident but passing 0 (nil) accounts for the most usages of |
ping |
I really want this feature. @dmitshur I was wondering if you are OK with passing |
@hajimehoshi Thanks for working on this.
I've talked with @hyangah and we're willing to consider breaking API changes to To me, this seems like such a case, because the current @hajimehoshi Given this, do you have a preference on whether we should proceed with adding support only for If we consider making a change, we should determine which of |
I'm fine with breaking the API :-) but there is a way not to break the API. The idea is creating a new API like
Another option would be passing BTW, I'm not sure whether even the current implementation is safe: what would happen if GC collects the given slice before GPU finishes the process? |
@dmitshur So, what do you think? IMO, change the type from |
I agree with that rationale for preferring changing type to
I understand the current implementation is safe because it sets
|
This CL enables use of a bound buffer at TexSubImage2D by allowing nil (0) data, which indicates the head of the bound buffer. In the long run, we need to be able to pass non-0 integer to not only TexSubImage2D but also other functions like TexImage2D. As we might change the API, let's revisit this issue later. Fixes golang/go#36355 Change-Id: I66f6650b10fca9a346cfa6eba246ea9286ed3a85 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/213077 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This CL enables use of a bound buffer at TexSubImage2D by allowing nil (0) data, which indicates the head of the bound buffer. In the long run, we need to be able to pass non-0 integer to not only TexSubImage2D but also other functions like TexImage2D. As we might change the API, let's revisit this issue later. Fixes golang/go#36355 Change-Id: I66f6650b10fca9a346cfa6eba246ea9286ed3a85 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/213077 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Originally,
glTexSubImage2D
can take either a pointer or an integer asdata
(http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage2D.xhtml). A pointer represents a pointer to a byte array, while an integer represents an offset of the current bound pixel buffer object. When using PBO, the latter way is required but the current Go mobile implementation does not allow this. I propose to enable to pass an integer toTexSubImage2D
as a data parameter.The text was updated successfully, but these errors were encountered: