oh no...
I'm not sure I can actually do the NV12 planar output using 2 color attachments, because the UV part is half the height of of the Y part, does vulkan require color attachments to have the same size? I'd assume so since there is only one viewport...

maybe i gotta use multiple passes...

using nv12 as the output format is just a little insane like come on game *pokes it with a stick*

@lizzy

Okay so…you’re doing planar output. And Vulkan. And YUV color space?

This is very confusing to me. Especially the planar part.

@rk yes…

the YUV color space is the smallest problem, i can just convert between rgb and yuv easily, the problem is really the planar format

if a 4x4 RGB image is this:

8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B 8R8G8B

a 4x4 NV12 image is like this:

8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 8Y 4U4V 4U4V 4U4V 4U4V 4U4V 4U4V 4U4V 4U4V

where each UV value corresponds to two vertically adjacent Y values

initially i missed this fact and thought it was a 1:1 UV <-> Y correspondence, which is why i considered multiple color attachments

@lizzy

So…I guess I missed the overarching context here. What are you doing that has planar graphics?

@rk it’s… related to the video processor MFT, which is a windows api to convert images (or streams of images, for deinterlacing, but that’s not relevant here) between different formats and/or crop, rotate etc. them… it’s a bit like imagemagick on crack

I’m dealing with a game that wants the output to be NV12

Video Processor MFT (Camerauicontrol.h) - Win32 apps

The video processor MFT is a Microsoft Media Foundation transform (MFT) that performs colorspace conversion, video resizing, deinterlacing, frame rate conversion, rotation, cropping, spatial left and right view unpacking, and mirroring.

@lizzy

Ah. You’re well beyond my expertise in this area then. If you were needing to deal with planar modes on an Amiga or with ILBMs (which I guess could actually be relevant?) I could help, but otherwise I’m well out of my bitdepth.

@rk i only learned this stuff yesterday  (well, the entire planar stuff at least, i've been hacking on video processor mft for a while now, but never really had to touch dxvk/vulkan code for it)

@lizzy

Ah. You and I are about forty years out of sync. I definitely need to catch up but, if you’re interested in how we dealt with memory bandwidth limitations the original planar modes on the Amiga (and similarly vintaged systems) some spelunking might be fun.

@rk im really interested in that yea
i've also watched a bunch of videos about the N64 where the membus is very limited while the cpu is very powerful, so often it's better write smaller, less cpu-efficient code - not unrolling loops etc.
it also has to share the membus with the gpu

@lizzy

I am only casually interested in the N64, but it comes from an era where these sorts of things really mattered because you were designing your own bus/architecture.

Also, randomly, do you know @mothcompute ? If not, lemme introduce y’all. You’re both way smarter than I am at these sorts of low-level details and I would enjoy watching y’all nerd out.

@rk (pinging @mothcompute since the ping broke and editing posts doesn't change pings)
@rk (computers can be a bitch sometimes)

@lizzy

Computers were a mistake in general yes.