Skip to content

Commit afd7014

Browse files
committed
N15: rust-gpu: Move up
1 parent 529e035 commit afd7014

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

content/posts/newsletter-015/index.md

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,68 @@ Join [Building Blocks's Discord server](https://discord.gg/CnTNjwb).
935935
[building-blocks-v0-1]: https://github.com/bonsairobo/building-blocks/releases/tag/v0.1.0
936936
[building-blocks-v0-2]: https://github.com/bonsairobo/building-blocks/releases/tag/v0.2.0
937937

938+
### [Rust GPU v0.1][rustgpu-v0.1]
939+
940+
![Rust GPU Sky](rustgpu.jpg)
941+
_Sky example in Rust GPU_
942+
943+
[Rust GPU][rustgpu] is a project backed by [Embark Studios][embark]
944+
to make Rust a first-class language and ecosystem for building GPU code.
945+
946+
Although still in very early stages of development,
947+
[Rust GPU released v0.1 in October][rustgpu-v0.1],
948+
and has already garnered over 2000 stars on Github.
949+
Currently, compiling and running very simple shaders
950+
works, and a significant portion of the core library also compiles. While things
951+
like if-statements and while-loops are working, many things aren't implemented yet.
952+
For example, for-loops, iterators and match/switch aren't supported yet. That
953+
means that while being technically usable, Rust GPU is far from being
954+
production-ready.
955+
956+
The motivation behind the project:
957+
958+
> Historically in games, GPU programming has been done through writing either
959+
> HLSL, or to a lesser extent GLSL. These are simple programming languages that
960+
> have evolved along with rendering APIs over the years. However, as game engines
961+
> have evolved, these languages have failed to provide mechanisms for dealing with
962+
> large codebases, and have generally stayed behind the curve compared to other
963+
> programming languages.
964+
>
965+
> In part this is because it's a niche language for a niche market, and in part
966+
> this has been because the industry as a whole has sunk quite a lot of time and
967+
> effort into the status quo. While over-all better alternatives to both languages
968+
> exist, none of them are in a place to replace HLSL or GLSL. Either because they
969+
> are vendor locked, or because they don't support the traditional graphics
970+
> pipeline. Examples of this include CUDA and OpenCL. And while attempts have been
971+
> made to create language in this space, none of them have gained any notable
972+
> traction in the gamedev community.
973+
974+
The code for the sky example above:
975+
976+
```rust
977+
#[spirv(entry = "fragment")]
978+
pub fn main_fs(input: Input<Vec4>, mut output: Output<Vec4>) {
979+
let dir: Vec3 = input.load().truncate();
980+
let cs_pos = Vec4(dir.0, -dir.1, 1.0, 1.0);
981+
let ws_pos = {
982+
let p = clip_to_world.mul_vec4(cs_pos);
983+
p.truncate() / p.3
984+
};
985+
let dir = (ws_pos - eye_pos).normalize();
986+
let color = sky(dir, sun_pos); // evaluate Preetham sky model
987+
output.store(color.extend(0.0))
988+
}
989+
```
990+
991+
_Discussions:
992+
[/r/rust](https://reddit.com/r/rust/comments/jg056t/introducing_rustgpu_v01),
993+
[Hacker News](https://news.ycombinator.com/item?id=24858172),
994+
[Twitter](https://twitter.com/repi/status/1319274584915365888)_
995+
996+
[rustgpu]: https://github.com/EmbarkStudios/rust-gpu
997+
[rustgpu-v0.1]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.1
998+
[embark]: https://www.embark-studios.com/
999+
9381000
### [gfx-rs]
9391001

9401002
gfx-rs support for D3D has been improved. [@kvark] landed a few critical fixes
@@ -1270,68 +1332,6 @@ on the module's [repository][Proton-Media-Converter-Github]
12701332
[Proton-Github]: https://github.com/ValveSoftware/Proton
12711333
[Proton-Media-Converter-Github]: https://github.com/ValveSoftware/Proton/tree/proton_5.13/media-converter
12721334

1273-
### [Rust GPU v0.1][rustgpu-v0.1]
1274-
1275-
![Rust GPU Sky](rustgpu.jpg)
1276-
_Sky example in Rust GPU_
1277-
1278-
[Rust GPU][rustgpu] is a project backed by [Embark Studios][embark]
1279-
to make Rust a first-class language and ecosystem for building GPU code.
1280-
1281-
Although still in very early stages of development,
1282-
[Rust GPU released v0.1 in October][rustgpu-v0.1],
1283-
and has already garnered over 2000 stars on Github.
1284-
Currently, compiling and running very simple shaders
1285-
works, and a significant portion of the core library also compiles. While things
1286-
like if-statements and while-loops are working, many things aren't implemented yet.
1287-
For example, for-loops, iterators and match/switch aren't supported yet. That
1288-
means that while being technically usable, Rust GPU is far from being
1289-
production-ready.
1290-
1291-
The motivation behind the project:
1292-
1293-
> Historically in games, GPU programming has been done through writing either
1294-
> HLSL, or to a lesser extent GLSL. These are simple programming languages that
1295-
> have evolved along with rendering APIs over the years. However, as game engines
1296-
> have evolved, these languages have failed to provide mechanisms for dealing with
1297-
> large codebases, and have generally stayed behind the curve compared to other
1298-
> programming languages.
1299-
>
1300-
> In part this is because it's a niche language for a niche market, and in part
1301-
> this has been because the industry as a whole has sunk quite a lot of time and
1302-
> effort into the status quo. While over-all better alternatives to both languages
1303-
> exist, none of them are in a place to replace HLSL or GLSL. Either because they
1304-
> are vendor locked, or because they don't support the traditional graphics
1305-
> pipeline. Examples of this include CUDA and OpenCL. And while attempts have been
1306-
> made to create language in this space, none of them have gained any notable
1307-
> traction in the gamedev community.
1308-
1309-
The code for the sky example above:
1310-
1311-
```rust
1312-
#[spirv(entry = "fragment")]
1313-
pub fn main_fs(input: Input<Vec4>, mut output: Output<Vec4>) {
1314-
let dir: Vec3 = input.load().truncate();
1315-
let cs_pos = Vec4(dir.0, -dir.1, 1.0, 1.0);
1316-
let ws_pos = {
1317-
let p = clip_to_world.mul_vec4(cs_pos);
1318-
p.truncate() / p.3
1319-
};
1320-
let dir = (ws_pos - eye_pos).normalize();
1321-
let color = sky(dir, sun_pos); // evaluate Preetham sky model
1322-
output.store(color.extend(0.0))
1323-
}
1324-
```
1325-
1326-
_Discussions:
1327-
[/r/rust](https://reddit.com/r/rust/comments/jg056t/introducing_rustgpu_v01),
1328-
[Hacker News](https://news.ycombinator.com/item?id=24858172),
1329-
[Twitter](https://twitter.com/repi/status/1319274584915365888)_
1330-
1331-
[rustgpu]: https://github.com/EmbarkStudios/rust-gpu
1332-
[rustgpu-v0.1]: https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.1
1333-
[embark]: https://www.embark-studios.com/
1334-
13351335
## Popular Workgroup Issues in Github
13361336

13371337
<!-- Up to 10 links to interesting issues -->

0 commit comments

Comments
 (0)