Moved the BytesPer* functions into FNA3D_Driver.h since 3/4 of our backends use them.
Added SetTextureDataYUV. This is mostly just copy-pasting SetTextureData2D three times in a row with changes for offset / size. Totally cargo-culted on this, I have no idea how the pipeline barriers actually work.
Tested on a video from Dust AET and it works as expected.
There's definitely room for refactoring since the if (stagingBuffer->resourceAccessType != nextResourceAccessType) block is copied three times in this function and once in SetTextureData2D. Wanted to see what you thought about extracting that stuff to an external function since it technically already uses another convenience function (CreateBufferMemoryBarrier) internally. Would it be weird to have a wrapper for a wrapper?
BytesPer*
functions intoFNA3D_Driver.h
since 3/4 of our backends use them.Tested on a video from Dust AET and it works as expected.
There's definitely room for refactoring since the
if (stagingBuffer->resourceAccessType != nextResourceAccessType)
block is copied three times in this function and once in SetTextureData2D. Wanted to see what you thought about extracting that stuff to an external function since it technically already uses another convenience function (CreateBufferMemoryBarrier
) internally. Would it be weird to have a wrapper for a wrapper?