d3d11converter: Fallback to linear sampler if filter is not supported

Use linear sampler if requested filter is not supported

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5572>
This commit is contained in:
Seungha Yang 2023-10-29 00:36:23 +09:00
parent e7069984df
commit f32bb06e32

View file

@ -798,10 +798,16 @@ gst_d3d11_color_convert_setup_shader (GstD3D11Converter * self,
device_handle = gst_d3d11_device_get_device_handle (device);
hr = gst_d3d11_device_get_sampler (device, sampler_filter, &sampler);
if (!gst_d3d11_result (hr, device)) {
GST_WARNING_OBJECT (self, "Trying again with linear sampler");
hr = gst_d3d11_device_get_sampler (device, D3D11_FILTER_MIN_MAG_MIP_LINEAR,
&sampler);
if (!gst_d3d11_result (hr, device)) {
GST_ERROR_OBJECT (self, "Couldn't create sampler, hr: 0x%x", (guint) hr);
return FALSE;
}
}
hr = gst_d3d11_device_get_sampler (device, D3D11_FILTER_MIN_MAG_MIP_LINEAR,
&linear_sampler);