Add support for decoding NV12 into RGB image

This commit is contained in:
Wojtek Figat
2024-05-15 11:15:19 +02:00
parent 9d2dc91920
commit 82bf4238df
6 changed files with 75 additions and 15 deletions

View File

@@ -91,8 +91,19 @@ protected:
context->GPU->SetViewportAndScissors((float)_player->Width, (float)_player->Height);
context->GPU->SetRenderTarget(frame->View());
context->GPU->BindSR(0, _player->FrameUpload->View());
ASSERT_LOW_LAYER(_player->Format == PixelFormat::YUY2);
context->GPU->SetState(GPUDevice::Instance->GetDecodeYUY2PS());
GPUPipelineState* pso;
switch (_player->Format)
{
case PixelFormat::YUY2:
pso = GPUDevice::Instance->GetDecodeYUY2PS();
break;
case PixelFormat::NV12:
pso = GPUDevice::Instance->GetDecodeNV12PS();
break;
default:
return Result::Failed;
}
context->GPU->SetState(pso);
context->GPU->DrawFullscreenTriangle();
}
else