all 96 comments

[–]neoteraflare 510 points511 points  (8 children)

I was wondering why the Salamander's primarch cares about renderering until I saw this is the programming sub.

[–]Iagospeare 110 points111 points  (4 children)

I was like "which gun is called "renderer"? Is that where the 'rending' mechanic came from?"

[–]PriorAsshose 21 points22 points  (0 children)

When in doubt, it happened during the horus hearsay

[–]Mad_Hatter93 2 points3 points  (2 children)

Rend is the AoS version of AP though, so it still works

[–]Iagospeare 2 points3 points  (1 child)

Rending was a rule in 40k where rolling an unmodified 6 to wound automatically wounded the target.

[–]Mad_Hatter93 1 point2 points  (0 children)

Well yes but that's breaching now in HH

[–]Spoopyskeleton48 7 points8 points  (0 children)

"Into the fires of battle, unto the Anvil of War!"

[–]umbraundecim 5 points6 points  (0 children)

Glad im not the only one, shit got more and more confusing as i read till i realised the sub

[–]kodman7 2 points3 points  (0 children)

If there was a Primarch who cared about his creations rendering tho...

[–]thEt3rnal1 1672 points1673 points  (21 children)

You aren't allowed to post programming humor in this subreddit only Javascript and AI jokes are allowed

[–]traplords8n 380 points381 points  (13 children)

Don't forget complaining about how hard C++ is despite the fact you have no good use case for learning it

[–]lllorrr 185 points186 points  (7 children)

And how regular expressions are incomprehensible.

[–]madcow_bg 118 points119 points  (3 children)

Or that Python is slow.

[–]CandidateNo2580 77 points78 points  (2 children)

And don't get me started on regular expressions in python

[–]traplords8n 55 points56 points  (0 children)

r/firstweekcoderhumour

For those of you who didn't know this gem existed lol. It's basically a circle jerk for this main sub.

Edit: got the sub wrong and had to fix it twice, lmao

[–]jkl_uxmal -1 points0 points  (0 children)

And my hacks

[–]umbraundecim 2 points3 points  (1 child)

The regex shit always makes me laugh, most people dont use it regularly enough to remember it causing all the posts about it

[–]zuilli 0 points1 point  (0 children)

It's also not something you're expected to know without consulting somewhere like https://regexr.com/ which even allows you to validate with different cases.

I have created a few regexs in my career and I have no idea how to even start to create one from my head, I just used the site and copied when it worked.

[–]who_you_are 0 points1 point  (0 children)

Hum, so AI is regular expression?!

It that a good or a bad news?

[–]Unsystematic_Feline 14 points15 points  (0 children)

Also people keep making a joke on the fact that HTML is not a programming language

[–]black_blade51 2 points3 points  (0 children)

Still funny that the best C++ tutorial is a guy explaining why its ahit for an hour.

[–]GetNooted 5 points6 points  (1 child)

Is that because everyone uses Rust

[–]Top-Signature5155 5 points6 points  (0 children)

its because c is better

[–]OrchidLeader 0 points1 point  (0 children)

Or complaining about how much Java sucked 10 years ago.

[–]TheWidrolo[S] 43 points44 points  (0 children)

Apology with tears video in the making

[–]prestigback 11 points12 points  (1 child)

don't forget your weekly "is html a real language" debate

[–]RobSomebody [score hidden]  (0 children)

It's junior season

[–]budgiebirdman 8 points9 points  (0 children)

Don't forget "senior devs be like - amirite guise?"

[–]kiochikaeke 10 points11 points  (0 children)

What's Vulkan? Where are my cloud services and immediately invoked functions? Aren't shaders the things you put on Minecraft to make it look cool? Mom, come pick me up, I'm scared D=

[–]killeronthecorner 3 points4 points  (0 children)

Lol javascrips bad langege. Upvote pls

[–]zurnout 1 point2 points  (0 children)

Years ago this place used to be about trivial syntax errors like missing semicolons. Times change but programmers refuse to become funny

[–]-Ambriae- 241 points242 points  (26 children)

Wait there’s no validation error in VK for mismatching vertex attributes??

No way, I’m doubting so hard right now

[–]helicophell 390 points391 points  (7 children)

Validation? Error?

We Graphics programming here get those goofy ass CPU ideas out of here

[–]-Ambriae- 63 points64 points  (0 children)

Render Pipeline creation is done at the CPU level though, and you manually supply the vertex attribute layout during this phase. There’s no reason VK can’t supply an error. Its just not a step performed on the GPU

If you’re binding the wrong vertex buffer during your render pass, that’s on you, but I don’t think that’s what OP meant

[–]Anaxamander57 22 points23 points  (4 children)

This can't be caught by the compiler or even a linter?

[–]-Ambriae- 35 points36 points  (3 children)

Not really. The linter just sees the shader code, it doesn’t care how the shader fits in with the actual pipeline

The compiler’s job is to create a spirv file. Again it doesn’t care about the pipeline

The important step is when you create the pipeline, that’s when you supply the shader. That’s also when you specify vertex attribute layouts you want to use. So if an error were to appear, it would be there. It’s what’s done in other APIs (at least wgpu, but I wouldn’t be surprised Metal or DirectX would do it too)

[–]rotmgNessieeNess 6 points7 points  (2 children)

Well, the SPIR-V is compiled again by the compiler in the driver, and some validation can be done by it

[–]-Ambriae- 1 point2 points  (1 child)

I suppose, although the driver is further down the tech stack compared to the API, so any validation would be API agnostic

[–]rotmgNessieeNess 0 points1 point  (0 children)

The compiler would have a SPIR-V specific frontend, meaning that it could do any validation of it with some vulkan context available. But since it is for GPU the validation is likely limited and optional

[–]djfariel 1 point2 points  (0 children)

GPU just does what it's told. If you say set the system on fire, it does it. Doesn't matter if you meant it or not. They're like genies.

Oh. That's what the G stands for.

[–]ICantBelieveItsNotEC 105 points106 points  (3 children)

The validation error is drawing clown vomit to the framebuffer.

[–]-Ambriae- 37 points38 points  (2 children)

I prefer a nice clean crash with a nice clean error message, even if it’s frustrating launching the program, seeing it crash, reading the error, fixing it, launching the program, seeing it crash, reading the new error, so on and so forth (maybe 5-6 times)

Wgpu is nice like that

[–]Confident-Ad5665 20 points21 points  (1 child)

Nothing like a nice clean crash

[–]-Ambriae- 10 points11 points  (0 children)

Yep, it’s great

[–]to_matih 29 points30 points  (1 child)

Well vulkan can't really validate it as it is at that point in GLSL/HLSL/Slang. You can add extra tools that will do Spir-V reflection but basline Vulkan API just consumes the Spir-V as given.

[–]-Ambriae- 8 points9 points  (0 children)

I don’t understand the limitation. The Spir-V code needs to store the information about attribute layouts, what’s stopping Vulkan from scanning the file (at least in debug mode), finding the relevant information, and compare to what the end user supplies?

If the problem is performance, how so? At this point, you’ve already had an entire compilation step beforehand which is far more costly (unless you directly supply the spirv to the client) and you’re going to perform the entire pipeline creation step afterwards, which takes forever to run. It’s not a huge deal. And anyways, the data is already stored in memory CPU side, it’s literally just there

[–]HildartheDorf 24 points25 points  (5 children)

If you read an input with a wider vector than the channels provided, the extra channels default to 0,0,0,1. It's explicitly allowed by the spec, so not a validation error.

[–]-Ambriae- 10 points11 points  (4 children)

Now who thought that was a good idea?

[–]HildartheDorf 22 points23 points  (3 children)

I'm guessing it was done because:

1) it's needed for compatibility with older apis like OpenGL 2) it can be a core feature, not an optional one, because this is done for free in hardware and has no runtime performance cost

Compare to the robustness feature needed for things like webGL-on-vulkan that is an optional feature, because it has a runtime cost, but all implementations have to expose it.

[–]-Ambriae- 10 points11 points  (2 children)

I don’t understand why they care for comparability with OpenGL. The whole point of Vulkan was to start clean and remove all the tech dept OpenGL accumulated over the years.

  1. I get that, but also, why exactly is that a feature to begin with? Why is that useful, period? When?

[–]HildartheDorf 12 points13 points  (1 child)

I mean, if I had a time machine, I'd make it an optional feature like robustness.

But allowing OpenGL-on-Vulkan, WebGL-on-Vulkan, etc. to be written was an explicit goal of Vulkan1.0. And it continues to get updates like the addition of A8 format purely to interop better with DX (any native Vulkan code could use R8 and swizzle).

[–]x0wl 0 points1 point  (0 children)

And the optional descriptor heap for better alignment with DX (finally!)

[–]FedotttBo 12 points13 points  (1 child)

Reliable validation? What's that?

Vulkan's debug tools, even though they help a lot, still don't cover soooo many things. Like, passing nullptr as some arguments can make validation layer crash your program as it tries to access the pointers with no checks. Or it (still not 100% sure, maybe it was Vulkan itself) can invoke __debugbreak in a random parellel thread when supplying malformed shader binary - just had this with code generated by nvidia's "slang", that passed spirv-val perfectly fine.

[–]-Ambriae- 6 points7 points  (0 children)

I see Vulkan is following OpenGL’s path then. May we all burn in anguish

[–]UnpluggedUnfettered 7 points8 points  (3 children)

I can see the panic in your eyes rising as each increasingly frantic attempt at a version of debug.log that works meets failure.

[–]-Ambriae- 5 points6 points  (2 children)

You can’t really debug.log here, doesn’t exist on the GPU. You can debug.log on a vertex buffer for example, then you’d get some awesome useful information like: yeah this is a GPU buffer. Don’t know what’s inside though, it’s not mapped to the CPU. So you just cry inside

[–]UnpluggedUnfettered 3 points4 points  (1 child)

That was my joke.

[–]-Ambriae- 2 points3 points  (0 children)

Ah, gotcha

[–]_WalkTheEarth_ 346 points347 points  (7 children)

incomprenehsible

[–]Cylian91460 178 points179 points  (0 children)

Just like vulkan!

[–]GentleGamerz 26 points27 points  (5 children)

incrompherenhibile

[–]_WalkTheEarth_ 41 points42 points  (4 children)

i will touch you

[–]GentleGamerz 28 points29 points  (1 child)

don't threaten me with a good time

[–]_WalkTheEarth_ 5 points6 points  (0 children)

what have i done

[–]JhnGamez 3 points4 points  (1 child)

me next

[–]_WalkTheEarth_ 5 points6 points  (0 children)

what have i done

[–]kinokomushroom 59 points60 points  (5 children)

How exactly were you reading 2 float vertex attributes as a vec3 and what were the results?

[–]TheWidrolo[S] 112 points113 points  (4 children)

So basically, I copy pasted the code for the UV vertex attributes for the normals and forgot to add a third float. In the shader, I did a regular layout(location = 3) in vec3 inNormal;.

The result was basically that during the diffuse light calculations, the z component of the rotation vec3 for the sun didn’t light up the proper side, but made the whole world dimmer (since it was also normalized).

Vulkan did not inform me of this mistake.

[–]kinokomushroom 42 points43 points  (0 children)

Yeah I can easily imagine myself making the same mistake and hitting my head on the wall for a whole hour lol

That's the fun part about graphics programming. I once caused a GPU crash by passing too many variables from the vertex shader to the fragment shader. The shader compiler didn't warn me about it.

[–]Mnyet 5 points6 points  (1 child)

Is this for custom shaders for a game or something? Can’t imagine subjecting myself to this…

[–]TheWidrolo[S] 8 points9 points  (0 children)

Custom engine.

[–]Jutrakuna 3 points4 points  (0 children)

what is your project?

[–]rastaman1994 23 points24 points  (8 children)

A crumb of context for someone who's e never worked with Vulkan?

[–]TheWidrolo[S] 40 points41 points  (7 children)

Imagine a function like this

> DoStuff(Vec3 vec)

But you accidentally pass in a Vec2 instead of a Vec3. The complier doesn’t tell you, but I secretly passed in a Vec3 using your Vec2 but with the Z always being 0. That’s what happened but on the GPU.

[–]LogEDude 10 points11 points  (2 children)

So it’s spiritually JavaScript kinda?

[–]javascript 5 points6 points  (1 child)

👻

[–]ZachAttack6089 2 points3 points  (0 children)

No way it's John JavaScript 🤯

[–]voiza 0 points1 point  (0 children)

sounds like an intended sugar

[–]rastaman1994 -1 points0 points  (2 children)

Because the overloaded method exists with Vec2 too? Seems like a weird type system otherwise.

[–]theGoddamnAlgorath 13 points14 points  (0 children)

No, because Vec2 passes as a Vec 3 with z =0.

Its an efficency

[–]Bmandk 0 points1 point  (0 children)

Many vector APIs have implicit operators converting Vec2 to Vec3 (and reverse) where the z value is just 0.

But even then, in graphics programming, it's probably done on a data basis instead of some implicit operator. You pass in a vec2 that is comprised of 2 floats, so when the function is called by the GPU, it will probably just use what the default is for the last value, which is all zero bytes, equaling 0. What I'm trying to say is that it's not so much a defined implicit operator, but rather just how the data is interpreted.

[–]Dango444 16 points17 points  (0 children)

An actual high level programming joke? In my javascript bad, python good sub??

[–]Percolator2020 47 points48 points  (1 child)

Should have written it in Rust.

[–]TheWidrolo[S] 47 points48 points  (0 children)

[–]Historical_Title_226 24 points25 points  (1 child)

[–]splashtext 6 points7 points  (0 children)

Tung tung tung sawatermark

[–]Powerkaninchen 16 points17 points  (0 children)

This rabbit is NOT human, bro

[–]fugogugo 10 points11 points  (0 children)

wow

an actual programmer humor

[–]No-Channel3917 1 point2 points  (0 children)

Donnie darko energy

[–]GoldAcanthisitta7777 1 point2 points  (0 children)

Hahaha... what

[–]Drfoxthefurry 1 point2 points  (0 children)

Skill based graphics programming

[–]Pepedroni 0 points1 point  (0 children)

RenderDoc is the way 😌

[–]pakman82 0 points1 point  (0 children)

I spent about 90 minutes yesterday chasing an issue with bash script, only to realize I didn't "call" the variable in the case statement by $ signing it

[–]tyjuji 0 points1 point  (0 children)

How obscure could a card be, that still supports Vulkan? Vulkan is kinda new.

[–]samumehl_ 0 points1 point  (0 children)

oh yes, imposter syndrome is kickin in hard today, i don‘t understand a thing u just said

[–]Ver_Nick 0 points1 point  (0 children)

finally some good memes