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

Android emulator surface issue #3972

Closed
dm67x opened this issue Jul 24, 2023 · 9 comments
Closed

Android emulator surface issue #3972

dm67x opened this issue Jul 24, 2023 · 9 comments
Labels
type: bug Something isn't working

Comments

@dm67x
Copy link

dm67x commented Jul 24, 2023

Hi,

I try to run wgpu program on Android using an emulator but it didn't work.

image

Btw, it's working on a real device.
Did I miss something or is it normal?

Thanks!

@teoxoy teoxoy added type: bug Something isn't working platform: android Issues with integration with android labels Aug 1, 2023
@teoxoy
Copy link
Member

teoxoy commented Aug 1, 2023

Could you share the whole log as text? It would also make it easier for others to find the issue.

@teoxoy teoxoy removed the platform: android Issues with integration with android label Aug 1, 2023
@dm67x
Copy link
Author

dm67x commented Aug 5, 2023

Of course, logs.txt

@teoxoy
Copy link
Member

teoxoy commented Aug 7, 2023

The error looks similar to #2101 & #2384.

Could you try to run it only with the GL backend enabled (change Backends::all() to Backends::GL)?

@jinleili
Copy link
Contributor

Using wgpu::Backends::all() works fine on Android phones (OnePlus Ace Pro, Android 13) because device_type are all IntegratedGpu, and the picking order will pick the Vulkan backend:

AdapterInfo { name: "Adreno (TM) 730", vendor: 20803, device: 117637122, device_type: IntegratedGpu, driver: "Qualcomm Technologies Inc. Adreno Vulkan Driver", driver_info: "Driver Build: ee4b625, I41c6f366e1, 1676536850\nDate: 02/16/23\nCompiler Version: EV031.36.08.19\nDriver Branch: \n", backend: Vulkan }

AdapterInfo { name: "Adreno (TM) 730", vendor: 20803, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }

However, in the emulator, the device_type for the Vulkan backend is Cpu, so it will only pick the GL backend:

AdapterInfo { name: "SwiftShader Device (LLVM 10.0.0)", vendor: 6880, device: 49374, device_type: Cpu, driver: "?", driver_info: "?", backend: Vulkan }

AdapterInfo { name: "Android Emulator OpenGL ES Translator (Apple M1 Max)", vendor: 4203, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }

Using wgpu::Backends::GL works fine on Android phones, but it throws an error in the emulator:

eglMakeCurrent: 0x7ab3fc7780: ver 3 0 (tinfo 0x7b498defe0)
2023-08-12 15:09:48.677 10220-10220 wgpu::backend::direct   name.jinleili.wgpu.debug             E  Handling wgpu errors as fatal by default
2023-08-12 15:09:48.677 10220-10220 log_panics              name.jinleili.wgpu.debug             E  thread '<unnamed>' panicked at 'wgpu error: Validation Error
Caused by:
		In Device::create_render_pipeline
		Error matching ShaderStages(VERTEX) shader requirements against the pipeline 
		Shader uses 2 inter-stage components above the limit of 0

': /Users/lijinlei/Rust/forks/wgpu/wgpu/src/backend/direct.rs:3095

@dm67x
Copy link
Author

dm67x commented Aug 15, 2023

@teoxoy yes it's working when I changed it to the OpenGL backend.

@teoxoy
Copy link
Member

teoxoy commented Aug 16, 2023

This is most likely a dupe of #2384.

Well that sucks. Both Instance and Surface in wgpu are for all of the active backends, simlultaneously. It looks like the Vulkan surface was created here, and it's blocking EGL surface.

from #2384 (comment)

@dm67x
Copy link
Author

dm67x commented Aug 17, 2023

@teoxoy what should I do with this issue? Should I close it?

@teoxoy
Copy link
Member

teoxoy commented Aug 18, 2023

I think we can close it for now.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2023
@teoxoy
Copy link
Member

teoxoy commented Aug 18, 2023

Using wgpu::Backends::GL works fine on Android phones, but it throws an error in the emulator:

eglMakeCurrent: 0x7ab3fc7780: ver 3 0 (tinfo 0x7b498defe0)
2023-08-12 15:09:48.677 10220-10220 wgpu::backend::direct   name.jinleili.wgpu.debug             E  Handling wgpu errors as fatal by default
2023-08-12 15:09:48.677 10220-10220 log_panics              name.jinleili.wgpu.debug             E  thread '<unnamed>' panicked at 'wgpu error: Validation Error
Caused by:
		In Device::create_render_pipeline
		Error matching ShaderStages(VERTEX) shader requirements against the pipeline 
		Shader uses 2 inter-stage components above the limit of 0

': /Users/lijinlei/Rust/forks/wgpu/wgpu/src/backend/direct.rs:3095

@jinleili the limit being 0 in the emulator doesn't sound right. Could you open a new issue for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants