Repository navigation
[d3d11] Support planar outputs in video processor - #4872
Conversation
|
Would it be possible to split this into multiple commits? I'm having a very hard time working out what's going on when there's a relatively large refactor + adding new functionality all in one massive diff.
Because rendering to planar images conceptually doesn't make much sense; especially when the chroma plane is subsampled. As for ClearView, I don't know if this is supposed to do anything on planar views, would need some sort of test case to prove that it does, and if it does, work out how the color mapping actually works, and then clear the sub-views for each aspect one at a time. Views can only be created for one plane at a time. The whole video thing in general is neither particularly well tested, nor particualrly feature-complete since games so far haven't really needed much of it, planar VOV is certainly a first. |
|
OK, looking at ClearView docs, the color mapping for yuv formats is straight-forward and well-defined, but we'd still need to deal with individual aspects, take subsampling into account (especially if there's clear rects involved) etc etc. I do need to write some tests for this. |
|
sorry if it's a naive question, but are there tests located anywhere inside this repo or in a different one? I could contribute tests for this (I already wrote some amount of testing code for this), I'm just having trouble figuring out where to put them |
|
Not really, no. |
3098ab3 to
1355e2f
Compare
|
I split it into different commits now - I hope it makes more sense like this. |
doitsujin
left a comment
There was a problem hiding this comment.
Thanks, this is indeed much easier to reason about.
See comments; overall approach looks solid, but unless absolutely required I'd prefer to ignore the whole ClearView thing for now since there's going to be more refactoring needed.
1355e2f to
3e07c6f
Compare
|
Updated the PR according to feedback. I've also noticed that GetImageSubresources() isn't used anywhere, and since this PR touches it, I've decided to remove it in a separate commit before the other changes. |
3e07c6f to
f8f5dd0
Compare
f8f5dd0 to
2a793b7
Compare
2a793b7 to
7d9faaa
Compare
This aims to support the game JR East Train Simulator, which uses the video processor with input and output streams both in the NV12 format.
Vulkan does not (usually?) support rendering to a G8_B8R8_2PLANE_420_UNORM (=NV12) view (it lacks the COLOR_ATTACHMENT_BIT in features - tho I've only checked on a modern AMD gpu).
Two passes are necessary since the Y and CbCr views may have different dimensions (in the case of NV12, CbCr is half the size of the Y view).
Since the creation of the output view now significantly overlaps with the input view's code (both have to iterate over the aspectMask to create views), I've introduced a superclass
VideoProcessorViewto share the behavior.In case of planar output, the output view still creates a view in its "native" format, to support being cleared by
D3D11CommonContext::ClearView.