Initially taken by Niko Matsakis and lightly edited by Ryan Levick
- Introductions
- Cargo inside large build systems
- FFI
- Foundations and financial support
| /* So how does this work? | |
| I'm using ANSI escape sequences to control the behavior of the terminal while | |
| cat is outputting the text. I deliberately place these control sequences inside | |
| comments so the C++ compiler doesn't try to treat them as code.*/ | |
| //[2K[2D[A[2K[A[2K[A[2K[A[2K[A | |
| /*The commands in the fake code comment move the cursor to the left edge and | |
| clear out the line, allowing the fake code to take the place of the real code. | |
| And this explanation uses similar commands to wipe itself out too. */ | |
| //[2K[2D[A[2K[A[2K[A[2K[A | |
| #include <cstdio> |
| #include <glm/glm.hpp> | |
| using namespace glm; | |
| struct DDACursor { | |
| vec3 mask; | |
| vec3 mapPos; | |
| vec3 rayStep; | |
| vec3 rayDir; | |
| vec3 rayPos; | |
| vec3 sideDist; |
| const std = @import("std"); | |
| const assert = std.debug.assert; | |
| const Allocator = std.mem.Allocator; | |
| const Io = std.Io; | |
| pub fn main() !void { | |
| var debug_allocator: std.heap.DebugAllocator(.{}) = .init; | |
| const gpa = debug_allocator.allocator(); | |
| //const gpa = std.heap.smp_allocator; |
This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/
the command zig run my_code.zig will compile and immediately run your Zig
program. Each of these cells contains a zig program that you can try to run
(some of them contain compile-time errors that you can comment out to play
with)
| In shader programming, you often run into a problem where you want to iterate an array in memory over all pixels in a compute shader | |
| group (tile). Tiled deferred lighting is the most common case. 8x8 tile loops over a light list culled for that tile. | |
| Simplified HLSL code looks like this: | |
| Buffer<float4> lightDatas; | |
| Texture2D<uint2> lightStartCounts; | |
| RWTexture2D<float4> output; | |
| [numthreads(8, 8, 1)] |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
Find the Discord channel in which you would like to send commits and other updates
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!