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

[glsl-out] Feature to generate samplerExternalOES instead of sampler2D #4528

Open
i509VCB opened this issue Aug 29, 2022 · 3 comments
Open
Labels
area: naga back-end Outputs of naga shader conversion help required We need community help to make this happen. lang: GLSL OpenGL Shading Language naga Shader Translator type: enhancement New feature or request

Comments

@i509VCB
Copy link
Contributor

i509VCB commented Aug 29, 2022

samplerExternalOES is defined in https://registry.khronos.org/OpenGL/extensions/OES/OES_EGL_image_external.txt

This sampler is needed if the texture from an EGLImage that could be backed by external memory such as AHardwareBuffer or dmabuf.

This is related to the work to enable #2320

@cwfitzgerald cwfitzgerald added kind: feature help required We need community help to make this happen. area: naga back-end Outputs of naga shader conversion lang: GLSL OpenGL Shading Language labels Aug 29, 2022
@jimblandy
Copy link
Member

Does this correspond to the texture_external type in WGSL? Naga hasn't implemented that yet.

@i509VCB
Copy link
Contributor Author

i509VCB commented Nov 23, 2022

I guess it will correspond to the texture_external type for gles3.

@cwfitzgerald cwfitzgerald transferred this issue from gfx-rs/naga Oct 25, 2023
@cwfitzgerald cwfitzgerald added the naga Shader Translator label Oct 25, 2023
@zmerp
Copy link
Contributor

zmerp commented Feb 1, 2024

I would really like to see this implemented. I've tried to look into bypassing naga in the wgpu_hal glsl backend, but it's not trivial, the hack is more effort than it is worth. The solution of course would be to support texture_external in naga. For now I will work around this by executing a passthrough shader using raw opengl before passing the non-external textures to wgpu; this doesn't sound like a big deal but this has to run on VR mobile hardware where every draw call incurs in a performance hit.

@teoxoy teoxoy added type: enhancement New feature or request and removed kind: feature labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion help required We need community help to make this happen. lang: GLSL OpenGL Shading Language naga Shader Translator type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants