That's the form of shader parameters, but I don't think it makes any statements about their function. I don't know exactly what the intent for the function was, but honestly I'm not sure I see a reason to limit it. It can just mean "any input parameter that reflects something about the source environment that the target type requires to be encoded in the shader".
Sure, but at that point you're essentially just arguing for passing the structures in question as an array instead of as a linked list. And struct vkd3d_shader_compile_option could be extended in a similar way to pass arbitrary data, of course.
That may mean that vkd3d_shader_parameter could in theory cover almost everything, but I'm not sure I see that as a bad thing. I mean, the thing about chained structures is that they're not exactly the easiest thing to work with, mostly when it comes to optionally adding them, or building helpers to construct the parameters. Arrays like vkd3d_shader_parameter are nicer.
I don't necessarily agree. Sure, constructing these chains has its issues, but they're issues that should be familiar to someone used to Vulkan, and I wouldn't say these issues are worse than you'd have with vkd3d_shader_parameter or vkd3d_shader_compile_option.
@@ -334,6 +338,8 @@ struct vkd3d_shader_parameter { struct vkd3d_shader_parameter_immediate_constant immediate_constant; struct vkd3d_shader_parameter_specialization_constant specialization_constant; + struct vkd3d_shader_varying_mapping varying_mapping; + enum vkd3d_shader_alpha_test_func alpha_test_func; } u; };
That doesn't scale, generally. Adding things to the union potentially changes the size of the vkd3d_shader_parameter structure, and that's a problem if we want to both pass an array of these and maintain a stable ABI.
In this case not every parameter name can support every parameter type, and I can see why that would be distasteful.
Well, it would be a break from how these are currently intended to be used, at least. These were intended mostly to provide an option other than "recompile the shader" and "use a constant buffer" for almost constant shader variables.