Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ef1eed3

Browse filesBrowse files
AngelOnFira17cupsofcoffeeozkriff
authored
N15: Rust GPU (rust-gamedev#351)
* Added Rust GPU October content * Resolved comments from @termhn * Fixed code block issue from @17cupsofcoffee * Update content/posts/newsletter-015/index.md Co-authored-by: Joe Clay <27cupsofcoffee@gmail.com> * N15: rust-gpu: Fix repo link * N15: rust-gpu: Style&fmt tweaks & example code Co-authored-by: Joe Clay <27cupsofcoffee@gmail.com> Co-authored-by: Andrey Lesnikov <ozkriff@gmail.com>
1 parent c1e1f6e commit ef1eed3
Copy full SHA for ef1eed3

File tree

Expand file treeCollapse file tree

2 files changed

+62
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+62
-0
lines changed

‎content/posts/newsletter-015/index.md

Copy file name to clipboardExpand all lines: content/posts/newsletter-015/index.md
+62Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,68 @@ on the module's [repository][Proton-Media-Converter-Github]
10241024
[Proton-Github]: https://github.com/ValveSoftware/Proton
10251025
[Proton-Media-Converter-Github]: https://github.com/ValveSoftware/Proton/tree/proton_5.13/media-converter
10261026

1027+
### [Rust GPU v0.1][rustgpu-v0.1]
1028+
1029+
![Rust GPU Sky](rustgpu.jpg)
1030+
_Sky example in Rust GPU_
1031+
1032+
[Rust GPU][rustgpu] is a project backed by [Embark Studios][embark]
1033+
to make Rust a first-class language and ecosystem for building GPU code.
1034+
1035+
Although still in very early stages of development,
1036+
[Rust GPU released v0.1 in October][rustgpu-v0.1],
1037+
and has already garnered over 2000 stars on Github.
1038+
Currently, compiling and running very simple shaders
1039+
works, and a significant portion of the core library also compiles. However,
1040+
many things aren't implemented yet: for example, while-loops and if-statements
1041+
work, but for-loops, iterators, and match/switch aren't supported yet! That
1042+
means that while being technically usable, Rust GPU is far from being
1043+
production-ready.
1044+
1045+
Motivation behind the project:
1046+
1047+
> Historically in games, GPU programming has been done through writing either
1048+
> HLSL, or to a lesser extent GLSL. These are simple programming languages that
1049+
> have evolved along with rendering APIs over the years. However, as game engines
1050+
> have evolved, these languages have failed to provide mechanisms for dealing with
1051+
> large codebases, and have generally stayed behind the curve compared to other
1052+
> programming languages.
1053+
>
1054+
> In part this is because it's a niche language for a niche market, and in part
1055+
> this has been because the industry as a whole has sunk quite a lot of time and
1056+
> effort into the status quo. While over-all better alternatives to both languages
1057+
> exist, none of them are in a place to replace HLSL or GLSL. Either because they
1058+
> are vendor locked, or because they don't support the traditional graphics
1059+
> pipeline. Examples of this include CUDA and OpenCL. And while attempts have been
1060+
> made to create language in this space, none of them have gained any notable
1061+
> traction in the gamedev community.
1062+
1063+
The code for the sky example above:
1064+
1065+
```rust
1066+
#[spirv(entry = "fragment")]
1067+
pub fn main_fs(input: Input<Vec4>, mut output: Output<Vec4>) {
1068+
let dir: Vec3 = input.load().truncate();
1069+
let cs_pos = Vec4(dir.0, -dir.1, 1.0, 1.0);
1070+
let ws_pos = {
1071+
let p = clip_to_world.mul_vec4(cs_pos);
1072+
p.truncate() / p.3
1073+
};
1074+
let dir = (ws_pos - eye_pos).normalize();
1075+
let color = sky(dir, sun_pos); // evaluate Preetham sky model
1076+
output.store(color.extend(0.0))
1077+
}
1078+
```
1079+
1080+
_Discussions:
1081+
[/r/rust](https://reddit.com/r/rust/comments/jg056t/introducing_rustgpu_v01),
1082+
[Hacker News](https://news.ycombinator.com/item?id=24858172),
1083+
[Twitter](https://twitter.com/repi/status/1319274584915365888)_
1084+
1085+
[rustgpu]: https://github.com/EmbarkStudios/rust-gpu
1086+
[rustgpu-v0.1]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.1
1087+
[embark]: https://www.embark-studios.com/
1088+
10271089
## Popular Workgroup Issues in Github
10281090

10291091
<!-- Up to 10 links to interesting issues -->
315 KB
Loading

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.