1950935464149483683
This commit is contained in:
1 parent
419b415386
commit
bb4a46a847
5 files changed
+180
-3
No files matched your search
+63
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: "@NOTimothyLottes SPIR-V."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/AgileJebrim/status/1950936023447302584"
|
||||
author: "Jebrim"
|
||||
handle: AgileJebrim
|
||||
post_id: "1950936023447302584"
|
||||
date: 2025-07-31
|
||||
archived: 2026-08-25
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes SPIR-V."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1950935464149483683"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/AgileJebrim/status/1950936023447302584
|
||||
- Author: Jebrim (@AgileJebrim)
|
||||
- Posted: 2025-07-31 15:06:09
|
||||
|
||||
## Branch
|
||||
|
||||
**1/**
|
||||
|
||||
@NOTimothyLottes SPIR-V. I’ve given up on trying to massage frontend compilers to do exactly what I want. I’m just letting others write in whatever shader language they want and then taking the SPIR-V it generates and reoptimizing it the way I want it.
|
||||
|
||||
**2/**
|
||||
|
||||
@NOTimothyLottes One of the motivating factors is the fact that people already have a bunch of existing code, so the less work needed on their part to rewrite it, the better.
|
||||
|
||||
**3/**
|
||||
|
||||
@AgileJebrim If IHV compilers all handled well the case where the SPIR-V skips most SSA and leverages OpLoad/Store to global shader data (as in registers not memory), it might be a lot more tractable to go direct to SPIR-V.
|
||||
|
||||
**4/**
|
||||
|
||||
@NOTimothyLottes I’m forcing the case where each invocation has access to a full 256 registers, which should hopefully limit the whole SSA/register spill problem. I haven’t tried intentionally breaking SSA though. Even if I did, there’s no way such UB would ever be certifiable.
|
||||
|
||||
**5/**
|
||||
|
||||
@AgileJebrim I don't know of any case where 256 registers had acceptable performance. And that includes IHV hand assembly. Full unrolling on GCN needed at least 2 waves/SIMD (128 regs max). And I personally target around 64 for anything going through a compiler.
|
||||
|
||||
**6/**
|
||||
|
||||
@AgileJebrim Note on some newer AMD GPUs they increased the regfile by 50% I think, which would be a 96 max reg target
|
||||
|
||||
**7/**
|
||||
|
||||
@AgileJebrim Some of the larger problems with compilers is common sub-expression elimination. Meaning they will take out intentional recoputation or reloads and add register pressure. Often one has to fake a different value by ORing to a dynamic loaded zero (not known at compiler time)
|
||||
|
||||
**8/**
|
||||
|
||||
@AgileJebrim Meaning at medium levels of complexity the compilers are always going way over the register budget you'd target with hand written ASM. SSA ensures this. There are no aliasing hints in the IR.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2025-07-31-been-on-the-fence-on-writing-shader-interfaces-in]]
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: "@NOTimothyLottes What's the top \"something else\"? I've been out of the space for a while."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/olson_dan/status/1951144195843928435"
|
||||
author: "Dan Olson"
|
||||
handle: olson_dan
|
||||
post_id: "1951144195843928435"
|
||||
date: 2025-08-01
|
||||
archived: 2026-08-25
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes What's the top \"something else\"? I've been out of the space for a while."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1950935464149483683"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/olson_dan/status/1951144195843928435
|
||||
- Author: Dan Olson (@olson_dan)
|
||||
- Posted: 2025-08-01 04:53:21
|
||||
|
||||
## Branch
|
||||
|
||||
**1/**
|
||||
|
||||
@NOTimothyLottes What's the top "something else"? I've been out of the space for a while.
|
||||
|
||||
**2/**
|
||||
|
||||
@olson_dan Wanting to build something that effectively loads/stores a 'cart' file which contains all the 'code+data' of the game in a restartable package. The code cannot be GLSL because I'm not going to link in a huge compiler. Leaves something that generates SPIR-V on the fly. New lang
|
||||
|
||||
**3/**
|
||||
|
||||
@NOTimothyLottes @olson_dan For a long time i have contemplated writing a small GLSL->SPIR-V compiler. I think you could get away with something very simple, if you are conservative with your language use.
|
||||
|
||||
**4/**
|
||||
|
||||
@EskilSteenberg @olson_dan Have a crazy idea for GPU shader dev inspired by a C64 SID tracker where you have a 'pattern' for the 'instrument' which shows SID fx changing over time, along with the standard multi-channel pattern nestily using the instrument ...
|
||||
|
||||
**5/**
|
||||
|
||||
@EskilSteenberg @olson_dan ... Effectively a macro assembly language style thing where defines can be played back interleaved for things like ILP or loop unrolling etc. But programmer controlling interleaving, and register offsets, etc. Then ultimately output to SPIR-V direct (no GLSL step).
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2025-07-31-been-on-the-fence-on-writing-shader-interfaces-in]]
|
||||
+7
-2
@@ -14,7 +14,8 @@ tags:
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@onatt0 @EskilSteenberg @olson_dan So far the plan is to have the data read/write from the GPU, but still use the CPU to do the SPIR-V generation from said data."
|
||||
in_reply_to: "1951591243328135279"
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1951591243328135279"
|
||||
---
|
||||
|
||||
## Source
|
||||
@@ -23,8 +24,12 @@ in_reply_to: "1951591243328135279"
|
||||
- Author: NOTimothyLottes (@NOTimothyLottes)
|
||||
- Posted: 2025-08-02 13:36:07
|
||||
|
||||
## Thread
|
||||
## Branch
|
||||
|
||||
**1/**
|
||||
|
||||
@onatt0 @EskilSteenberg @olson_dan So far the plan is to have the data read/write from the GPU, but still use the CPU to do the SPIR-V generation from said data.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2025-07-31-been-on-the-fence-on-writing-shader-interfaces-in]]
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: "Been on the fence on writing shader interfaces in GLSL vs something else that translates to SPIR-V."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/NOTimothyLottes/status/1950935464149483683"
|
||||
author: "NOTimothyLottes"
|
||||
handle: NOTimothyLottes
|
||||
post_id: "1950935464149483683"
|
||||
date: 2025-07-31
|
||||
archived: 2026-08-25
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "Been on the fence on writing shader interfaces in GLSL vs something else that translates to SPIR-V."
|
||||
in_reply_to: ""
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/NOTimothyLottes/status/1950935464149483683
|
||||
- Author: NOTimothyLottes (@NOTimothyLottes)
|
||||
- Posted: 2025-07-31 15:03:55
|
||||
|
||||
## Thread
|
||||
|
||||
**1/**
|
||||
|
||||
Been on the fence on writing shader interfaces in GLSL vs something else that translates to SPIR-V. Most GLSL mixed with defines can just direct port to other platforms. However these days I have hundreds of lines of macros to transform GLSL closer to assembly.
|
||||
|
||||
Branches: [[archive/threads/NOTimothyLottes/2025-07-31-been-on-the-fence-on-writing-shader-interfaces-in/2025-07-31-AgileJebrim-spir-v-ive-given-up-on-trying-to-massage-frontend]], [[archive/threads/NOTimothyLottes/2025-07-31-been-on-the-fence-on-writing-shader-interfaces-in/2025-08-01-olson_dan-whats-the-top-something-else-ive-been-out-of-the]]
|
||||
|
||||
**2/**
|
||||
|
||||
Meaning I write using macros that are mostly a 1:1 mapping to AMDs GCN/RDNA ISA. With workarounds for missing stuff. SPIR-V output is an intimidating level of complex verbosity. More so when navigating frequent type bit aliasing (float, int, packed 16-bit float and int).
|
||||
|
||||
**3/**
|
||||
|
||||
@NOTimothyLottes Sounds like an RDNA->SPIRV asm converter tool would be the way to go
|
||||
|
||||
**4/**
|
||||
|
||||
@JBrooksBSI I part tried to GLSL once. Using a global uint4 array as registers. But the wrapping of bit aliasing typecasts around operations is loaded with compiler perf bugs. Esp with packed 16-bit. So making it usable in practice is quite hard.
|
||||
|
||||
**5/**
|
||||
|
||||
@NOTimothyLottes What I do for console dev is write RDNA2 asm on PS5 (via wrapped shader intrinsics).
|
||||
|
||||
On Xbox I have the wrappers implement C versions of the intrinsics (or HLSL intrinsics where available).
|
||||
|
||||
This is a technique I have been using since 2006, for PS3 SPU coding:
|
||||
|
||||

|
||||
|
||||
**6/**
|
||||
|
||||
@JBrooksBSI Eventually I ended up the same way (writing via instruction defines). Originally when I did FXAA it was a 1:1 line mapping to NV ISA. But without factoring through a define. But it's really the custom register allocation that I wish was universally expressible today.
|
||||
@@ -51,9 +51,9 @@ tags:
|
||||
- [[archive/threads/NOTimothyLottes/2025-04-30-3-i-got-side-tracked-by-building-a-language-that]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-04-30-i-laugh-when-people-say-c-is-like-assembly-they]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-07-23-nobody-self-includes-with-defines-to-reorder-c]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-07-31-been-on-the-fence-on-writing-shader-interfaces-in]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-07-31-people-claim-assembly-is-hard]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-08-01-at-least-for-my-next-at-home-project-i-think-the]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-08-02-so-far-the-plan-is-to-have-the-data-read-write]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-10-10-thread-about-this-from-rfleury-https-www-rfleury]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-10-13-short-talk-on-how-i-do-cpu-side-debugging-without]]
|
||||
- [[archive/threads/NOTimothyLottes/2025-11-17-i-wish-everyone-would-just-adopt-reversed-with]]
|
||||
|
||||
Reference in new issue
Block a user