Skip to content

Make the doc so that it explains Rust-GPU as something in itself, not by comparing to other GPU languages (like GLSL) #248

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

Open
Turtyo opened this issue May 6, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@Turtyo
Copy link

Turtyo commented May 6, 2025

I'll start of by saying that I am familiar with Rust, know a bit about how GPU work but have not programmed on GPU ever before, as that can explain some of the remarks I'm about to make.

My problem

I was reading through The Dev guide on writing shaders. I know there are other issues describing the fact that the doc is old / kinda obsolete, but I wanted to touch on something else.

The doc seems to make a lot of assumptions on previous knowledge of those reading said doc, this is apparent in multiple places:

  • some terms of SPIRV are not really explained. I know there are a few links to the SPIRV doc, but that doesn't really tell me what those are used for, in particular the spirv_headers
  • comparison to terms of OpenGL, DX, glsl

In particular on this second point, this is nice for people that have knowledge of those other languages; but for people like me that do not have this knowledge, it does not suffice as an explanation. For example, when explaining the flat keyword:
"The flat attribute corresponds to the flat keyword in glsl - in other words, the data is not interpolated across the triangle when invoking the fragment shader."
I can kinda understand what that means, but it's a bit succinct.

Some other keywords are explained less than this:
"The invariant attribute corresponds to the invariant keyword in glsl. It can only be applied to output variables."
This doesn't tell me much about what that is.

Now, I understand that this is very much a work in progress, and that for early adopters previous knowledge might be required to be able to get into it. However, on the website for rust-gpu, one of the first paragraphs states:
"There is no longer a need to learn a GPU-specific programming language. You can write both CPU and GPU code in Rust, leveraging your existing Rust knowledge and maintaining a consistent development experience"
With that goal in mind, i think it would be good to write the doc in a way that doesn't assume previous knowledge of other GPU languages. Of course, keeping the comparison with other GPU languages is a good thing, more information on that is not a bad thing.

Ideas

  • Explain some terms on their own, not through comparison only
  • For shaders it would be nice to have images (to be able to see the influence of one thing or another in the code)
  • Adding more links to external resources where needed (as writing doc can be time consuming, and if it's already explained somewhere else...)

I have given a few examples, but I can provide the complete list of places I think could be improved if that is something the people working on this are interested in.

If this is more of a case of "it's too early for people without previous knowledge to start using", then feel free to close the issue, but I would very much like to try to use on my own projects (namely a ray tracer I wrote a year back and that i would like to use GPU on).

@Turtyo Turtyo added the enhancement New feature or request label May 6, 2025
@Turtyo Turtyo changed the title Make the doc so that it explains Rust-GPU as something in itself, not by comparing to GLSL Make the doc so that it explains Rust-GPU as something in itself, not by comparing to other GPU languages (like GLSL) May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant