diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipgen.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipgen.cpp index 38b346cd3a..c985b9047a 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipgen.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipgen.cpp @@ -267,7 +267,11 @@ gst_d3d12_mip_gen_execute (GstD3D12MipGen * gen, ID3D12Resource * resource, cl->SetPipelineState (priv->pso.Get ()); D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc = { }; - srv_desc.Format = desc.Format; + DXGI_FORMAT view_format = desc.Format; + if (desc.Format == DXGI_FORMAT_AYUV) + view_format = DXGI_FORMAT_R8G8B8A8_UNORM; + + srv_desc.Format = view_format; srv_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; srv_desc.Texture2D.MipLevels = desc.MipLevels; @@ -335,7 +339,7 @@ gst_d3d12_mip_gen_execute (GstD3D12MipGen * gen, ID3D12Resource * resource, for (guint mip = 0; mip < mipCount; mip++) { D3D12_UNORDERED_ACCESS_VIEW_DESC uavDesc = { }; - uavDesc.Format = desc.Format; + uavDesc.Format = view_format; uavDesc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D; uavDesc.Texture2D.MipSlice = srcMip + mip + 1; diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipmapping.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipmapping.cpp index 1def8cd166..2216db35d1 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipmapping.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12mipmapping.cpp @@ -49,6 +49,8 @@ using namespace Microsoft::WRL; GST_DEBUG_CATEGORY_STATIC (gst_d3d12_mip_mapping_debug); #define GST_CAT_DEFAULT gst_d3d12_mip_mapping_debug +#define OUTPUT_FORMATS "{ VUYA, RGBA, AYUV64, RGBA64_LE }" + static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -63,11 +65,11 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES - (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, "RGBA") "; " + (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, OUTPUT_FORMATS) "; " GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY "," GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, - "RGBA"))); + OUTPUT_FORMATS))); enum {