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

GLES explicit bindings #105

Merged
merged 6 commits into from
Apr 6, 2024
Merged

GLES explicit bindings #105

merged 6 commits into from
Apr 6, 2024

Conversation

kvark
Copy link
Owner

@kvark kvark commented Apr 1, 2024

Every backend has specifics on how the bindings are treated. But all of them eventually need to ensure the naga::Module bindings are filled up, and this process is backend-independent. Now it's done in a separate function.
With all the improvements to GLES, it's now able to run the "particle" example on desktop:

RUSTFLAGS="--cfg gles" CARGO_TARGET_DIR=./target-gl cargo run --example particle

particles-gles

TODO: check how it works with Zed

@kvark kvark marked this pull request as draft April 3, 2024 04:11
@kvark kvark marked this pull request as ready for review April 3, 2024 07:08
@kvark kvark changed the title Share the binding population logic between backends GLES explicit bindings Apr 3, 2024
@kvark kvark force-pushed the vertex branch 5 times, most recently from 1aa6f38 to 8e3edf5 Compare April 4, 2024 06:02
@kvark
Copy link
Owner Author

kvark commented Apr 6, 2024

Was debugging Zed on GLES, and it's quite tough. The tools for GLES on Linux are quite poor.
RenderDoc shows stuff that should be working, but the driver thinks otherwise.
Specifically, I'm seeing that, for each vertex in the quad, the clip distances generated from VS are roughly from 0 to 600. However, inside the pixel shaders they come out negative in the Y component specifically.

I'm believe I'm just seeing a driver bug here (on the AMD 6850U). Actually, a more reasonable explanation could be that I'm doing something wrong with the shared CPU-GPU memory. It behaves more deterministically under RenderDoc.

See clip distances
Screenshot_20240406_004650
See the interpolated clip distances, normalized from (-500,500) range:
Screenshot_20240406_004740
Notably, all of them are good except for Y component, which is below 0.5, which means negative.

It's behaving exactly as if the content_mask.size.x == 0.0

@kvark kvark merged commit 810ec59 into main Apr 6, 2024
5 checks passed
@kvark kvark deleted the vertex branch April 6, 2024 23:23
mikayla-maki added a commit to zed-industries/zed that referenced this pull request Apr 10, 2024
Release Notes:
- N/A

Picks up kvark/blade#105,
kvark/blade#97, and more

Switches the presentation to be non-blocking, which will improve the
latency slightly.

Allows to start playing with GLES backend, e.g.
```bash
cd crates/gpui
RUSTFLAGS="--cfg gles" CARGO_TARGET_DIR=./target-gl cargo run --example hello_world
```

It doesn't currently render properly due to an issue that needs
investigation, see
kvark/blade#105 (comment)
But at least it's a start

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
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.

1 participant