Add support for decoding NV12 into RGB image
This commit is contained in:
@@ -297,6 +297,7 @@ struct GPUDevice::PrivateData
|
||||
GPUPipelineState* PS_CopyLinear = nullptr;
|
||||
GPUPipelineState* PS_Clear = nullptr;
|
||||
GPUPipelineState* PS_DecodeYUY2 = nullptr;
|
||||
GPUPipelineState* PS_DecodeNV12 = nullptr;
|
||||
GPUBuffer* FullscreenTriangleVB = nullptr;
|
||||
AssetReference<Material> DefaultMaterial;
|
||||
SoftAssetReference<Material> DefaultDeformableMaterial;
|
||||
@@ -715,6 +716,18 @@ GPUPipelineState* GPUDevice::GetDecodeYUY2PS() const
|
||||
return _res->PS_DecodeYUY2;
|
||||
}
|
||||
|
||||
GPUPipelineState* GPUDevice::GetDecodeNV12PS() const
|
||||
{
|
||||
if (_res->PS_DecodeNV12 == nullptr)
|
||||
{
|
||||
auto psDesc = GPUPipelineState::Description::DefaultFullscreenTriangle;
|
||||
psDesc.PS = QuadShader->GetPS("PS_DecodeNV12");
|
||||
_res->PS_DecodeNV12 = const_cast<GPUDevice*>(this)->CreatePipelineState();
|
||||
_res->PS_DecodeNV12->Init(psDesc);
|
||||
}
|
||||
return _res->PS_DecodeNV12;
|
||||
}
|
||||
|
||||
GPUBuffer* GPUDevice::GetFullscreenTriangleVB() const
|
||||
{
|
||||
return _res->FullscreenTriangleVB;
|
||||
|
||||
@@ -275,6 +275,11 @@ public:
|
||||
/// </summary>
|
||||
GPUPipelineState* GetDecodeYUY2PS() const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the shader pipeline state object for NV12 frame decoding to RGBA.
|
||||
/// </summary>
|
||||
GPUPipelineState* GetDecodeNV12PS() const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fullscreen-triangle vertex buffer.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user