Add Video module

This commit is contained in:
Wojtek Figat
2024-05-01 01:25:16 +02:00
parent 8a45dda98c
commit 0d8c9f6626
22 changed files with 1699 additions and 4 deletions

View File

@@ -296,6 +296,7 @@ struct GPUDevice::PrivateData
AssetReference<Shader> QuadShader;
GPUPipelineState* PS_CopyLinear = nullptr;
GPUPipelineState* PS_Clear = nullptr;
GPUPipelineState* PS_DecodeYUY2 = nullptr;
GPUBuffer* FullscreenTriangleVB = nullptr;
AssetReference<Material> DefaultMaterial;
SoftAssetReference<Material> DefaultDeformableMaterial;
@@ -489,6 +490,7 @@ void GPUDevice::preDispose()
_res->DefaultBlackTexture = nullptr;
SAFE_DELETE_GPU_RESOURCE(_res->PS_CopyLinear);
SAFE_DELETE_GPU_RESOURCE(_res->PS_Clear);
SAFE_DELETE_GPU_RESOURCE(_res->PS_DecodeYUY2);
SAFE_DELETE_GPU_RESOURCE(_res->FullscreenTriangleVB);
Locker.Unlock();
@@ -701,6 +703,18 @@ GPUPipelineState* GPUDevice::GetClearPS() const
return _res->PS_Clear;
}
GPUPipelineState* GPUDevice::GetDecodeYUY2PS() const
{
if (_res->PS_DecodeYUY2 == nullptr)
{
auto psDesc = GPUPipelineState::Description::DefaultFullscreenTriangle;
psDesc.PS = QuadShader->GetPS("PS_DecodeYUY2");
_res->PS_DecodeYUY2 = const_cast<GPUDevice*>(this)->CreatePipelineState();
_res->PS_DecodeYUY2->Init(psDesc);
}
return _res->PS_DecodeYUY2;
}
GPUBuffer* GPUDevice::GetFullscreenTriangleVB() const
{
return _res->FullscreenTriangleVB;