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

allow creation of wgpu_hal textures for gles backend #3046

Merged
merged 3 commits into from
Oct 13, 2022

Conversation

i509VCB
Copy link
Contributor

@i509VCB i509VCB commented Sep 23, 2022

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Relating to #2320, this should expose enough to allow external textures to work on Linux. I will write a further explanation on the linked issue about Android and what is covered so far by that issue.

Description
Add functions to create gles textures from external objects. Specifically, from a GL texture and GL renderbuffer.

Note: This pull request will need a new glow release at some point in the future.

@i509VCB i509VCB force-pushed the gles-texture-from-raw branch 3 times, most recently from 82a7202 to 9abc9eb Compare September 27, 2022 01:15
@i509VCB i509VCB requested a review from crowlKats as a code owner September 27, 2022 01:15
@i509VCB i509VCB force-pushed the gles-texture-from-raw branch 4 times, most recently from f1c6dc3 to 28f04cf Compare September 29, 2022 02:12
@expenses
Copy link
Contributor

expenses commented Oct 3, 2022

It'd be great to be able to roll the functionality in #2609 into this! I think it'd require something like this:

pub unsafe fn texture_from_raw(
        &self,
        raw_texture: RawTexture,
        ...
)
enum RawTexture {
    Name(&str),
    WebGl(web_sys::WebGlFramebuffer)
}

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Small comments, otherwise LGTM

wgpu-hal/src/gles/device.rs Outdated Show resolved Hide resolved
wgpu-hal/src/gles/device.rs Show resolved Hide resolved
This should be enough to allow RGB external textures to work on Linux. For Android, we still need to implement logic to generate shaders with samplerOESExternal and select the correct shader depending on the type of texture being created.
@i509VCB i509VCB force-pushed the gles-texture-from-raw branch from 28f04cf to 0360e60 Compare October 13, 2022 02:51
@i509VCB i509VCB requested review from cwfitzgerald and removed request for crowlKats October 13, 2022 02:51
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

One more nit, then G2G

wgpu-hal/src/gles/device.rs Outdated Show resolved Hide resolved
@cwfitzgerald cwfitzgerald enabled auto-merge (squash) October 13, 2022 06:22
@cwfitzgerald cwfitzgerald merged commit 7aca31f into gfx-rs:master Oct 13, 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.

3 participants