mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
d3d12converter: Add support initial pso DXGI_SAMPLE_DESC setting
Add more options for pso, in order to avoid redundant pso creation when MSAA is used Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7550>
This commit is contained in:
parent
965d898deb
commit
7cf27c456b
2 changed files with 34 additions and 3 deletions
|
@ -738,7 +738,7 @@ static gboolean
|
||||||
gst_d3d12_converter_setup_resource (GstD3D12Converter * self,
|
gst_d3d12_converter_setup_resource (GstD3D12Converter * self,
|
||||||
const GstVideoInfo * in_info, const GstVideoInfo * out_info,
|
const GstVideoInfo * in_info, const GstVideoInfo * out_info,
|
||||||
const GstD3D12Format * in_format, const GstD3D12Format * out_format,
|
const GstD3D12Format * in_format, const GstD3D12Format * out_format,
|
||||||
D3D12_FILTER sampler_filter)
|
D3D12_FILTER sampler_filter, guint sample_count, guint sample_quality)
|
||||||
{
|
{
|
||||||
auto priv = self->priv;
|
auto priv = self->priv;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -842,7 +842,8 @@ gst_d3d12_converter_setup_resource (GstD3D12Converter * self,
|
||||||
pso_desc.RTVFormats[j] = rtv_formats.front ();
|
pso_desc.RTVFormats[j] = rtv_formats.front ();
|
||||||
rtv_formats.pop ();
|
rtv_formats.pop ();
|
||||||
}
|
}
|
||||||
pso_desc.SampleDesc.Count = 1;
|
pso_desc.SampleDesc.Count = sample_count;
|
||||||
|
pso_desc.SampleDesc.Quality = sample_quality;
|
||||||
|
|
||||||
ComPtr < ID3D12PipelineState > pso;
|
ComPtr < ID3D12PipelineState > pso;
|
||||||
hr = device->CreateGraphicsPipelineState (&pso_desc, IID_PPV_ARGS (&pso));
|
hr = device->CreateGraphicsPipelineState (&pso_desc, IID_PPV_ARGS (&pso));
|
||||||
|
@ -1890,6 +1891,8 @@ gst_d3d12_converter_new (GstD3D12Device * device, GstD3D12CommandQueue * queue,
|
||||||
D3D12_FILTER sampler_filter = D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT;
|
D3D12_FILTER sampler_filter = D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT;
|
||||||
GstVideoInfo matrix_in_info;
|
GstVideoInfo matrix_in_info;
|
||||||
GstVideoInfo matrix_out_info;
|
GstVideoInfo matrix_out_info;
|
||||||
|
guint sample_count = 1;
|
||||||
|
guint sample_quality = 0;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_D3D12_DEVICE (device), nullptr);
|
g_return_val_if_fail (GST_IS_D3D12_DEVICE (device), nullptr);
|
||||||
g_return_val_if_fail (in_info != nullptr, nullptr);
|
g_return_val_if_fail (in_info != nullptr, nullptr);
|
||||||
|
@ -1951,6 +1954,14 @@ gst_d3d12_converter_new (GstD3D12Device * device, GstD3D12CommandQueue * queue,
|
||||||
gst_structure_get_enum (config, GST_D3D12_CONVERTER_OPT_DEST_ALPHA_MODE,
|
gst_structure_get_enum (config, GST_D3D12_CONVERTER_OPT_DEST_ALPHA_MODE,
|
||||||
GST_TYPE_D3D12_CONVERTER_ALPHA_MODE, (int *) &priv->dst_alpha_mode);
|
GST_TYPE_D3D12_CONVERTER_ALPHA_MODE, (int *) &priv->dst_alpha_mode);
|
||||||
|
|
||||||
|
gst_structure_get_uint (config,
|
||||||
|
GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_COUNT, &sample_count);
|
||||||
|
gst_structure_get_uint (config,
|
||||||
|
GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_QUALITY, &sample_quality);
|
||||||
|
|
||||||
|
priv->sample_desc.Count = sample_count;
|
||||||
|
priv->sample_desc.Quality = sample_quality;
|
||||||
|
|
||||||
gst_structure_free (config);
|
gst_structure_free (config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2075,7 +2086,7 @@ gst_d3d12_converter_new (GstD3D12Device * device, GstD3D12CommandQueue * queue,
|
||||||
|
|
||||||
if (!gst_d3d12_converter_setup_resource (self, &priv->in_info,
|
if (!gst_d3d12_converter_setup_resource (self, &priv->in_info,
|
||||||
&priv->out_info, &in_d3d12_format, &out_d3d12_format,
|
&priv->out_info, &in_d3d12_format, &out_d3d12_format,
|
||||||
sampler_filter)) {
|
sampler_filter, sample_count, sample_quality)) {
|
||||||
gst_object_unref (self);
|
gst_object_unref (self);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,26 @@ GType gst_d3d12_converter_alpha_mode_get_type (void);
|
||||||
*/
|
*/
|
||||||
#define GST_D3D12_CONVERTER_OPT_DEST_ALPHA_MODE "GstD3D12Converter.dest-alpha-mode"
|
#define GST_D3D12_CONVERTER_OPT_DEST_ALPHA_MODE "GstD3D12Converter.dest-alpha-mode"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_COUNT:
|
||||||
|
*
|
||||||
|
* #G_TYPE_UINT, D3D12_GRAPHICS_PIPELINE_STATE_DESC.SampleDesc.Count value to use.
|
||||||
|
* Default is 1.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_COUNT "GstD3D12Converter.pso-sample-desc-count"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_QUALITY:
|
||||||
|
*
|
||||||
|
* #G_TYPE_UINT, D3D12_GRAPHICS_PIPELINE_STATE_DESC.SampleDesc.Quality value to use.
|
||||||
|
* Default is 0.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_QUALITY "GstD3D12Converter.pso-sample-desc-quality"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstD3D12Converter:
|
* GstD3D12Converter:
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue