On Mon, Apr 15, 2019 at 4:55 PM Henri Verbeet hverbeet@gmail.com wrote:
Do we really need shader_parse_descriptor_ranges() to be able to handle 1.1 signatures if we also have shader_parse_descriptor_ranges1()? Or alternatively, do we really need shader_parse_descriptor_ranges1()? Likewise for shader_parse_root_descriptor() and shader_parse_root_parameters().
It's implemented that way for ID3D12RootSignatureDeserializer/vkd3d_create_root_signature_deserializer(). This implementation allows parsing root signature 1.1 directly to the old D3D12_ROOT_SIGNATURE_DESC for ID3D12RootSignatureDeserializer (without conversion). We could potentially re-implement vkd3d_create_root_signature_deserializer() and convert root signature 1.1 to 1.0 after it is parsed. The conversion is implemented later in this patch series.
int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_root_signature_desc *root_signature) +{
- struct vkd3d_versioned_root_signature_desc desc = {.version = VKD3D_ROOT_SIGNATURE_VERSION_1_0};
- int ret;
- TRACE("dxbc {%p, %zu}, root_signature %p.\n", dxbc->code, dxbc->size, root_signature);
- memset(root_signature, 0, sizeof(*root_signature));
- if ((ret = parse_dxbc(dxbc->code, dxbc->size, rts0_handler, &desc)) < 0)
- {
vkd3d_shader_free_versioned_root_signature(&desc);
return ret;
- }
- assert(desc.version == VKD3D_ROOT_SIGNATURE_VERSION_1_0);
- *root_signature = desc.u.v_1_0;
- return VKD3D_OK;
+}
Since vkd3d_shader_parse_root_signature() isn't in any released version of libvkd3d-shader, could we just get rid of it?
Yes, it should be possible. I was considering to remove vkd3d_shader_parse_root_signature() in a follow-up patch. I haven't written the patch yet.