!fjjkgHFcwtkREywzfk:matrix.org

Naga Shader Translator

237 Members
v0.14.0!9 Servers

Load older messages


SenderMessageTime
29 Feb 2024
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @atlv:matrix.org
so wgsl is stuck with weird atomics because of something that doesnt matter anymore?
no, metal still doesn't have normal buffer atomics
21:54:20
1 Mar 2024
@jasmine1717:matrix.orgjasmine1717
In reply to @cwfitzgerald:matrix.org
metal does have normal image atomics in metal 3.1
Iirc only for 32bit integers? I couldn't find support for R64Uint
02:08:04
@jasmine1717:matrix.orgjasmine1717
In reply to @elabajaba:matrix.org
tbh the shaders I want to ~~rewrite~~ not have to rewrite are using texture atomics, which afaik wgsl doesn't support
I'm working on it! DX12 is going to be a pain though, they support u64 texture atomics, but only on Rg32Uint textures... It's weird
02:08:46
@jasmine1717:matrix.orgjasmine1717Might just use buffers instead tbh, idk if image atomics would even give better perf (I intended to do both and profile)02:09:05
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @jasmine1717:matrix.org
Iirc only for 32bit integers? I couldn't find support for R64Uint
You can do load/store/cmpxchg/min/max
02:13:58
@cwfitzgerald:matrix.orgcwfitzgeraldSee page 191 of the msl spec02:14:14
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @jasmine1717:matrix.org
I'm working on it! DX12 is going to be a pain though, they support u64 texture atomics, but only on Rg32Uint textures... It's weird
That's just a generation quirk - you map a u64 texture to Rg32Uint on the cpu side, the rest of the world still thinks it's u64
02:15:29
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @jasmine1717:matrix.org
Might just use buffers instead tbh, idk if image atomics would even give better perf (I intended to do both and profile)
The benefit is if you're then using it in a slot that needs a texture, you don't need a copy
02:15:53
@jasmine1717:matrix.orgjasmine1717

The benefit is if you're then using it in a slot that needs a texture, you don't need a copy
When would you need a texture though, instead of a buffer? For my use case (nanite visbuffer), I can't think of why I would need it. And unless it's faster, it's just more wgpu work that needs to be done.

02:20:43
@jasmine1717:matrix.orgjasmine1717 *

The benefit is if you're then using it in a slot that needs a texture, you don't need a copy

When would you need a texture though, instead of a buffer? For my use case (nanite visbuffer), I can't think of why I would need it. And unless it's faster, it's just more wgpu work that needs to be done.

02:20:52
@jasmine1717:matrix.orgjasmine1717

That's just a generation quirk - you map a u64 texture to Rg32Uint on the cpu side, the rest of the world still thinks it's u64

Yeah but it's another thing wgpu will have to paper over which is annoying :(

02:21:19
@lylythechosenone:matrix.orglylythechosenone joined the room.17:41:54
@lylythechosenone:matrix.orglylythechosenonehey17:42:01
@lylythechosenone:matrix.orglylythechosenone I'm working on making a shader code generator based on naga::Modules, mostly because I'm too lazy to parse spirv. 17:42:24
@lylythechosenone:matrix.orglylythechosenoneI was wondering what type function parameters are supposed to be17:42:49
@lylythechosenone:matrix.orglylythechosenoneShould they be pointers like local variables, or just SSA values?17:43:07
@lylythechosenone:matrix.orglylythechosenoneI see two conflicting ideas on the topic19:49:17
@lylythechosenone:matrix.orglylythechosenonedynamic array index requires a pointer, and can be done on function arguments19:49:37
@lylythechosenone:matrix.orglylythechosenoneon the other hand, binary operations can be done on function arguments, and (I think) can't be done on pointers19:49:56
@lylythechosenone:matrix.orglylythechosenonefor now I'll just allocate local variables for array arguments19:56:51
@lylythechosenone:matrix.orglylythechosenoneand leave everything as SSA19:56:55
@lylythechosenone:matrix.orglylythechosenonebut I'd like a response for someone who knows what's up19:57:05
4 Mar 2024
@teoxoy:matrix.orgteoxoy
In reply to @lylythechosenone:matrix.org
Should they be pointers like local variables, or just SSA values?
They can be either.
13:02:53
@teoxoy:matrix.orgteoxoy
In reply to @lylythechosenone:matrix.org
on the other hand, binary operations can be done on function arguments, and (I think) can't be done on pointers
Yes, but you can always use Expression::Load on a pointer to get its value and use it as an operand.
13:05:48
@lylythechosenone:matrix.orglylythechosenone
In reply to @teoxoy:matrix.org
Yes, but you can always use Expression::Load on a pointer to get its value and use it as an operand.
are frontends allowed to generate binary operations with pointer operands?
16:25:52
@teoxoy:matrix.orgteoxoy
In reply to @lylythechosenone:matrix.org
are frontends allowed to generate binary operations with pointer operands?
No. The validator will error if it sees pointers as operands.
17:51:11
@atlv:matrix.orgvero jimb: can you review shader int64 PR please 🥺 20:11:57
@jimb:mozilla.orgjimb lylythechosenone: The one thing you can do with pointers, other than Load, is Access or AccessIndex. That's what's used for subscripting pointers to dynamic arrays. 20:39:52
@jimb:mozilla.orgjimb You can think of a SPIR-V OpAccessChain as a series of Naga Access and AccessIndex expressions. 20:40:25
@jimb:mozilla.orgjimb vero: Sorry for the delay. I've been trying to find time for it. 20:41:09

There are no newer messages yet.


Back to Room ListRoom Version: 5