!fjjkgHFcwtkREywzfk:matrix.org

Naga Shader Translator

119 Members
Embracing HLSL9 Servers

Load older messages


SenderMessageTime
20 Oct 2021
@jimb:mozilla.orgjimbLoads are special in that it matters when they're evaluated. We have special logic to bake them.18:23:55
@jimb:mozilla.orgjimbIt might be a pain for front ends...18:24:57
@kvark:matrix.orgkvarkInteresting thought!18:25:29
@jimb:mozilla.orgjimb My secret agenda is that bake_ref_count is deceptively critical to Naga's correctness, and if I had 72 hours in the day I would want to make things that are that important at least look important 18:27:09
@jimb:mozilla.orgjimbbut we've discussed that before18:27:26
@kvark:matrix.orgkvarkActually, Load isn't the only exception here. There is also ImageLoad18:28:41
@jimb:mozilla.orgjimbRight, and for the same reason18:29:42
@jimb:mozilla.orgjimb and ImageSample 18:29:53
@kvark:matrix.orgkvark No, imagesample is not in this category 18:32:01
@kvark:matrix.orgkvarkIt's pure18:32:10
@kvark:matrix.orgkvarkAnd ImageLoad is a concern only for storage images, not regular ones18:33:11
@kvark:matrix.orgkvark So if we make it a statement, it would be awkward to justify for regular textures 18:33:42
@jimb:mozilla.orgjimbOh, I see. Because they're accessing read-only resources, they're not sensitive to side-effects18:55:10
@jimb:mozilla.orgjimb * Oh, I see. Because they're accessing read-only resources, they're not sensitive to side-effects18:55:22
@kvark:matrix.orgkvarkright19:31:38
@jimb:mozilla.orgjimb
In reply to @kvark:matrix.org
I don't see the concern yet. The backend decides which expressions are baked and which aren't. It could easily check if an expression is used to index and force baking it.
Yes, this should work.
20:28:00
@jimb:mozilla.orgjimb
In reply to @jcapucho:matrix.org
Couldn't you make it an IR transformation and let the reference count do it's job?
Yes, if we did it in the IR, then everything would Just Work. But our IR isn't easy to manipulate; it's not designed for that. kvark and I decided at the outset that we'd try just handling bounds checks in the back ends, and see how it turns out.
20:29:31
@jimb:mozilla.orgjimbIf ultimately I'm able to put most of the logic in a processor, and just give the back ends a plan they can follow blindly, then I think things should be fine.20:30:08
@cwfitzgerald:matrix.orgcwfitzgeraldon the note of IR stuff, I was thinking a way of making "optimization not naga's problem" would be letting (through unsafe) shaders opt out of bounds checks on an access by access basis, then an optimizer which was generating wgsl could do the optimization and omit the bounds checks it knew to be redundant20:50:08
@cwfitzgerald:matrix.orgcwfitzgeraldit wouldn't help web elide bounds checks, but it would help native20:50:53
@cwfitzgerald:matrix.orgcwfitzgerald * on the note of IR stuff, I was thinking a way of making "optimization not naga's problem" would be letting (through unsafe) shaders opt out of bounds checks on an access by access basis, then an optimizer which was generating wgsl could do the optimization and omit the bounds checks it knew to be redundant20:51:28
@kvark:matrix.orgkvarkwhen would native need a bounds check? if you need a check, just do it yourself :)20:52:21
@cwfitzgerald:matrix.orgcwfitzgeraldyeah I mean fair :D20:52:48
@cwfitzgerald:matrix.orgcwfitzgeraldin all seriousness though that's a good point, we already have a "turn off all bounds checks" mode, and a wgsl optimizer that wanted to present safety could just add them itself20:54:22
@cwfitzgerald:matrix.orgcwfitzgerald * in all seriousness though that's a good point, we already have a "turn off all bounds checks" mode, and a wgsl optimizer that wanted to present safety could just add them itself20:54:28
@cwfitzgerald:matrix.orgcwfitzgeraldI don't think wgpu/naga is privileged for writing bounds checks, except maybe with descriptor indexing needing to side channel the array lengths in20:55:41
@cwfitzgerald:matrix.orgcwfitzgerald * I don't think wgpu/naga is privileged for writing bounds checks, except maybe with descriptor indexing needing to side channel the array lengths in20:55:49
21 Oct 2021
@jimb:mozilla.orgjimbRust 1.56 lets you specify MSRV in Cargo.toml18:24:33
@jcapucho:matrix.orgjcapuchoNow that you speak about MSRV, 1.46 is now the default for Ubuntu so we should consider upgrading (speaking about Ubuntu since that was the one with oldest toolchain)18:27:52
22 Oct 2021
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @jimb:mozilla.org
Rust 1.56 lets you specify MSRV in Cargo.toml
Ironically having an msrv to have an msrv
00:29:46

There are no newer messages yet.


Back to Room List