1737493375392137233, 1736360606612038098
This commit is contained in:
1 parent
487f97e231
commit
78335c126c
9 files changed
+371
No files matched your search
+37
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "@NOTimothyLottes Except CPU still excel at branchy code, which also features a lot in gamecode."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/JameswiseA/status/1736498566649291143"
|
||||
author: "jameswise_au"
|
||||
handle: JameswiseA
|
||||
post_id: "1736498566649291143"
|
||||
date: 2023-12-17
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes Except CPU still excel at branchy code, which also features a lot in gamecode."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1736360606612038098"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/JameswiseA/status/1736498566649291143
|
||||
- Author: jameswise_au (@JameswiseA)
|
||||
- Posted: 2023-12-17 21:28:15
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@JameswiseA** ^1736498566649291143
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
Except CPU still excel at branchy code, which also features a lot in gamecode. It would be interesting to see a basic game running entirely on CPU, vs entirely on GPU
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game]]
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
---
|
||||
title: "@NOTimothyLottes CPUs are kings of hiding latency in serial workloads."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/kenpex/status/1736451627148845441"
|
||||
author: "c0de517e/AngeloPesce"
|
||||
handle: kenpex
|
||||
post_id: "1736451627148845441"
|
||||
date: 2023-12-17
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes CPUs are kings of hiding latency in serial workloads."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1736360606612038098"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/kenpex/status/1736451627148845441
|
||||
- Author: c0de517e/AngeloPesce (@kenpex)
|
||||
- Posted: 2023-12-17 18:21:44
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@kenpex** ^1736451627148845441
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
CPUs are kings of hiding latency in serial workloads. GPUs hide latency only when dealing w/massively parallel workloads, with much more items than cores!
|
||||
|
||||
**2/** **@NOTimothyLottes** ^1736476434191782262
|
||||
|
||||
**@kenpex**
|
||||
|
||||
Remember, a GPU doesn't have to do only uniform workloads, it is still possible to hide serial work inside a sea of parallel work.
|
||||
|
||||
**3/** **@kenpex** ^1736484359082033158
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
You're suggesting, if I get it, to hide some serial/logic work in tiny async dispatches. That would work and not too horribly inefficient, but are you then getting really bad wallclock perf? Remember that as a rule of thumb, the serial part of a game is ~= the GPU frametime.
|
||||
|
||||
**4/** **@kenpex** ^1736484904307937546
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
It is true that one could structure a game to be much more parallel than the average game is, thus reducing the serial logic to not much more than the coordination of a bunch of parallel for, but even with a lot of effort you'll not be near the amount of parallelism of a GPU
|
||||
|
||||
**5/** **@kenpex** ^1736485762349387942
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
That's just because of the nature of work and work expansion. You have what, 100, 1000 entities as part of gameplay? And most do a bunch of ad-hoc, brancy work, with interdeps etc. On a GPU you have say 10k draws that spawn 10mil vtx/pixel work that is mostly uniform.
|
||||
|
||||
**6/** **@AgileJebrim** ^1736487589618520265
|
||||
|
||||
You clearly don’t know how to leverage batching if you’re doing 10k draws lol.
|
||||
|
||||
I’m able to handle complex behaviors for hundreds of thousands of entities just fine on a GPU. You can do a ton of work in a single dispatch and only really need multiple if you need the synchronization beyond what you can achieve with a thread group.
|
||||
|
||||
Remember Amdahl’s Law. Your performance will be constrained by the workload you fail to parallelize.
|
||||
|
||||
**7/** **@SebAaltonen** ^1736506369245589658
|
||||
|
||||
**@AgileJebrim** **@kenpex** **@NOTimothyLottes**
|
||||
|
||||
You can batch, we can already push 10k actual draw calls at 60 fps on 99$ Android phones. Close to 1 million draw calls are doable at 60 fps on Steam Deck (Vulkan). 10k draws is nothing today if your CPU code is fast enough. Changing the PSO 100k times/frame at 60 is fine too.
|
||||
|
||||
**8/** **@kenpex** ^1736511576382099798
|
||||
|
||||
**@SebAaltonen** **@AgileJebrim** **@NOTimothyLottes**
|
||||
|
||||
Sure, but that isn't the point.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game]]
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
---
|
||||
title: "@NOTimothyLottes Aren’t Out-of-Order execution and HyperThreading exactly the mechanisms CPU uses to hide latency?"
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/__ReJ__/status/1736690676023062646"
|
||||
author: "ReJ 𓀨 Renaldas Zioma"
|
||||
handle: __ReJ__
|
||||
post_id: "1736690676023062646"
|
||||
date: 2023-12-18
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes Aren’t Out-of-Order execution and HyperThreading exactly the mechanisms CPU uses to hide latency?"
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1736360606612038098"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/__ReJ__/status/1736690676023062646
|
||||
- Author: ReJ 𓀨 Renaldas Zioma (@__ReJ__)
|
||||
- Posted: 2023-12-18 10:11:37
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@__ReJ__** ^1736690676023062646
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
Aren’t Out-of-Order execution and HyperThreading exactly the mechanisms CPU uses to hide latency?
|
||||
|
||||
GPU does similar things juggling waves, but at different “breadth” of a problem.
|
||||
|
||||
IMHO both modern CPU and GPU are built to hide latency, just for different granularities.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game]]
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
title: "@NOTimothyLottes Chasing pointers or dependent texture reads - same shit different sandwich."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/jaap_null/status/1736801931534938376"
|
||||
author: "Jaap van Muijden"
|
||||
handle: jaap_null
|
||||
post_id: "1736801931534938376"
|
||||
date: 2023-12-18
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes Chasing pointers or dependent texture reads - same shit different sandwich."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1736360606612038098"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/jaap_null/status/1736801931534938376
|
||||
- Author: Jaap van Muijden (@jaap_null)
|
||||
- Posted: 2023-12-18 17:33:43
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@jaap_null** ^1736801931534938376
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
Chasing pointers or dependent texture reads - same shit different sandwich.
|
||||
Just build dedicated hardware fetchers!
|
||||
|
||||
**2/** **@NOTimothyLottes** ^1736813224681435140
|
||||
|
||||
**@jaap_null**
|
||||
|
||||
{fetch, logic, dependent fetch} ... usually the state required for logic is larger than the fetch and used before/after the block, thus it isn't something you can move out of the ALUs ... vgpr parking lot with a lot of runable tasks is the dedicated hardware
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game]]
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "@NOTimothyLottes Could you give a few examples of “game code” that will run faster on gpu? Especially considering all the latency involved pushing/getting stuff to/from gpu?"
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/simplex_fx/status/1736667922808877183"
|
||||
author: "Simplex"
|
||||
handle: simplex_fx
|
||||
post_id: "1736667922808877183"
|
||||
date: 2023-12-18
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes Could you give a few examples of “game code” that will run faster on gpu? Especially considering all the latency involved pushing/getting stuff to/from gpu?"
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1736360606612038098"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/simplex_fx/status/1736667922808877183
|
||||
- Author: Simplex (@simplex_fx)
|
||||
- Posted: 2023-12-18 08:41:13
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@simplex_fx** ^1736667922808877183
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
Could you give a few examples of “game code” that will run faster on gpu? Especially considering all the latency involved pushing/getting stuff to/from gpu?
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game]]
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "Some irony: some say the CPU is needed for 'game code' ..."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/NOTimothyLottes/status/1736360606612038098"
|
||||
author: "NOTimothyLottes"
|
||||
handle: NOTimothyLottes
|
||||
post_id: "1736360606612038098"
|
||||
date: 2023-12-17
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "Some irony: some say the CPU is needed for 'game code' ..."
|
||||
in_reply_to: ""
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/NOTimothyLottes/status/1736360606612038098
|
||||
- Author: NOTimothyLottes (@NOTimothyLottes)
|
||||
- Posted: 2023-12-17 12:20:03
|
||||
|
||||
## Thread
|
||||
|
||||
**1/** **@NOTimothyLottes** ^1736360606612038098
|
||||
|
||||
Some irony: some say the CPU is needed for 'game code' ... but think about this, the CPU is horrible at the pointer chasing most are actually referring to, it has no mechanism to hide that latency ... the GPU on the other hand, it was built to hide latency
|
||||
|
||||
Branches: [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game/2023-12-17-kenpex-cpus-are-kings-of-hiding-latency-in-serial]], [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game/2023-12-17-JameswiseA-except-cpu-still-excel-at-branchy-code-which-also]], [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game/2023-12-18-simplex_fx-could-you-give-a-few-examples-of-game-code-that]], [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game/2023-12-18-__ReJ__-arent-out-of-order-execution-and-hyperthreading]], [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game/2023-12-18-jaap_null-chasing-pointers-or-dependent-texture-reads-same]]
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "@NOTimothyLottes I much prefer i32, f32, f16, u32, u8, etc."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/misyltoad/status/1737495664718688343"
|
||||
author: "autumn"
|
||||
handle: misyltoad
|
||||
post_id: "1737495664718688343"
|
||||
date: 2023-12-20
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "@NOTimothyLottes I much prefer i32, f32, f16, u32, u8, etc."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1737493375392137233"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/misyltoad/status/1737495664718688343
|
||||
- Author: autumn (@misyltoad)
|
||||
- Posted: 2023-12-20 15:30:22
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@misyltoad** ^1737495664718688343
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
I much prefer i32, f32, f16, u32, u8, etc.
|
||||
Doesn't need any explanation, and is very elegant and precise.
|
||||
Curious as to your thoughts.
|
||||
|
||||
**2/** **@NOTimothyLottes** ^1737497421914030532
|
||||
|
||||
**@phys_ballsocket**
|
||||
|
||||
I did that at one point in time too, but then I also use multi-component (since most of my code runs GPU side), so using both numbers for bit-width and component-count got messy.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/NOTimothyLottes/2023-12-20-i-share-the-same-unconventional-define-type]]
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "I share the same unconventional # define type conventions in C and GLSL, decoder:"
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/NOTimothyLottes/status/1737493375392137233"
|
||||
author: "NOTimothyLottes"
|
||||
handle: NOTimothyLottes
|
||||
post_id: "1737493375392137233"
|
||||
date: 2023-12-20
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- NOTimothyLottes
|
||||
description: "I share the same unconventional # define type conventions in C and GLSL, decoder:"
|
||||
in_reply_to: ""
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/NOTimothyLottes/status/1737493375392137233
|
||||
- Author: NOTimothyLottes (@NOTimothyLottes)
|
||||
- Posted: 2023-12-20 15:21:16
|
||||
|
||||
## Thread
|
||||
|
||||
**1/** **@NOTimothyLottes** ^1737493375392137233
|
||||
|
||||
I share the same unconventional # define type conventions in C and GLSL, decoder:
|
||||
{H=half,F=float,D=double}
|
||||
{P=predicate (aka bool)}
|
||||
{S=signed, else unsigned} for ints
|
||||
{B=8bit(byte),W=16bit(word),I=32bit(int),L=64bit(long)}
|
||||
then number of components {1,2,3,4}
|
||||
|
||||

|
||||
|
||||
Branches: [[archive/threads/NOTimothyLottes/2023-12-20-i-share-the-same-unconventional-define-type/2023-12-20-misyltoad-i-much-prefer-i32-f32-f16-u32-u8-etc-doesnt-need]]
|
||||
|
||||
**2/** **@NOTimothyLottes** ^1737494663009804674
|
||||
|
||||
Pointers in C are always either {R=restrict, or V=volatile} so I'm typically casting a raw 64-bit address after doing byte addressing: L1V_(base+bytes)[0] ... as is how it would be done naturally on the machine (and in asm).
|
||||
The '<type>_(x)' macros do broadcast typecasting.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
**3/** **@NOTimothyLottes** ^1737496597863243868
|
||||
|
||||
I've used variations of these kinds of conventions for many years. Found them useful at various works. For example FSR1/CAS's ffx_a.h https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/ffx-fsr/ffx_a.h
|
||||
@@ -28,10 +28,12 @@ tags:
|
||||
- [[archive/threads/NOTimothyLottes/2023-08-18-spc-last-crt-shader-was-broken]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-15-long-thread]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-16-inspecting-my-old-vk-engines]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-17-some-irony-some-say-the-cpu-is-needed-for-game]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-19-working-towards-a-public-domain-release-of-a]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-20-another-bad-habit-i-dont-include]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-20-before-moving-all-gpu-side-i-had-source-recompile]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-20-curious-if-you-can-mapviewoffile-and-then-use]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-20-i-share-the-same-unconventional-define-type]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-21-code-shy-brain-says-its-strange-to-be-reading]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-25-virtualized-xmas-thread]]
|
||||
- [[archive/threads/NOTimothyLottes/2023-12-26-no-luck-getting-d3dkmtgetscanline-to-work-thus-far]]
|
||||
|
||||
Reference in new issue
Block a user