Skip to content

Add a Dummy backend #2291

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

Closed
kvark opened this issue Dec 14, 2021 · 6 comments
Closed

Add a Dummy backend #2291

kvark opened this issue Dec 14, 2021 · 6 comments
Labels
area: ecosystem Help the connected projects grow and prosper

Comments

@kvark
Copy link
Member

kvark commented Dec 14, 2021

Is your feature request related to a problem? Please describe.
Users may sometimes want to compile against wgpu some code that's never executed. In this case, they don't want to have any of the dependencies, just the API.

Describe the solution you'd like
Add a "dummy" backend (behind a feature) to wgpu-rs.

Describe alternatives you've considered
Having backend selection be done with features in wgpu and wgpu-core, so that these users can select no backends.

Additional context
#1221 (comment)

@Shatur
Copy link

Shatur commented Dec 14, 2021

Are you planning to look into this feature? I'm interested in this and would like to contribute, but I don't know wgpu architecture. But I could try if you give me some hints :)

@kvark
Copy link
Member Author

kvark commented Dec 14, 2021

I'm not planning to get to this right now, but will happily accept contribution. Just look at other wgpu/src/backend/ things and follow? You can start by copy pasting, say, the web backend and just removing implementations.

@Shatur
Copy link

Shatur commented Dec 23, 2021

@kvark how this feature should look? Features can't remove dependencies. So should we have a native-header in default features and use dummy backend if it disabled? Please, advice :)

@kvark
Copy link
Member Author

kvark commented Dec 24, 2021

We talked about this on Matrix and found no good solution. Also, this problem applies to "webgpu-headers" backend (which we need to add), not just to the dummy one.
Issue: if "dummy" is an optional feature, there is no way to disable wgpu-core dependency. If it needs to be disabled, it needs to become an optional feature itself, presumably enabled by default. This will unlikely affect any regular users (since they will get this feature by default).
However, for the use case of @Shatur this will not be enough. If there are any crates between Bevy and wgpu, they'd have to know how to disable the optional features of wgpu as well. This seems like a world of pain...

@Shatur
Copy link

Shatur commented Dec 24, 2021

Thanks for the info! Will think about a solution on Bevy side.

cwfitzgerald pushed a commit that referenced this issue Oct 25, 2023
…#2291)

* Fix invalid spirv generation in int dotprod

constants cannot be declared inside of a function block, so instead use `write_constant_null` to produce a correctly-declared constant 0.

* autogenerated test snapshots
@cwfitzgerald
Copy link
Member

We've already done this, wgpu-hal has a dummy backend.

@cwfitzgerald cwfitzgerald closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ecosystem Help the connected projects grow and prosper
Projects
None yet
Development

No branches or pull requests

3 participants