mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d-shader: Use switch statement in shader_parse_root_parameters().
This commit is contained in:
parent
4522a80de8
commit
94a33020d3
@ -2177,29 +2177,26 @@ static HRESULT shader_parse_root_parameters(const char *data, DWORD data_size,
|
||||
TRACE("Type %#x, shader visibility %#x.\n",
|
||||
parameters[i].ParameterType, parameters[i].ShaderVisibility);
|
||||
|
||||
if (parameters[i].ParameterType == D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE)
|
||||
switch (parameters[i].ParameterType)
|
||||
{
|
||||
if (FAILED(hr = shader_parse_descriptor_table(data, data_size,
|
||||
offset, ¶meters[i].u.DescriptorTable)))
|
||||
return hr;
|
||||
}
|
||||
else if (parameters[i].ParameterType == D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS)
|
||||
{
|
||||
if (FAILED(hr = shader_parse_root_constants(data, data_size,
|
||||
offset, ¶meters[i].u.Constants)))
|
||||
return hr;
|
||||
}
|
||||
else if (parameters[i].ParameterType <= D3D12_ROOT_PARAMETER_TYPE_UAV)
|
||||
{
|
||||
if (FAILED(hr = shader_parse_root_descriptor(data, data_size,
|
||||
offset, ¶meters[i].u.Descriptor)))
|
||||
return hr;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("Unrecognized type %#x.\n", parameters[i].ParameterType);
|
||||
return E_INVALIDARG;
|
||||
case D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE:
|
||||
hr = shader_parse_descriptor_table(data, data_size, offset, ¶meters[i].u.DescriptorTable);
|
||||
break;
|
||||
case D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS:
|
||||
hr = shader_parse_root_constants(data, data_size, offset, ¶meters[i].u.Constants);
|
||||
break;
|
||||
case D3D12_ROOT_PARAMETER_TYPE_CBV:
|
||||
case D3D12_ROOT_PARAMETER_TYPE_SRV:
|
||||
case D3D12_ROOT_PARAMETER_TYPE_UAV:
|
||||
hr = shader_parse_root_descriptor(data, data_size, offset, ¶meters[i].u.Descriptor);
|
||||
break;
|
||||
default:
|
||||
FIXME("Unrecognized type %#x.\n", parameters[i].ParameterType);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user