libs/vkd3d-shader: Use switch statement in shader_parse_root_parameters().

This commit is contained in:
Józef Kucia 2017-10-10 16:57:36 +02:00
parent 4522a80de8
commit 94a33020d3

View File

@ -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, &parameters[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, &parameters[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, &parameters[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, &parameters[i].u.DescriptorTable);
break;
case D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS:
hr = shader_parse_root_constants(data, data_size, offset, &parameters[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, &parameters[i].u.Descriptor);
break;
default:
FIXME("Unrecognized type %#x.\n", parameters[i].ParameterType);
return E_INVALIDARG;
}
if (FAILED(hr))
return hr;
}
return S_OK;