We skip these below for struct fields, so when can this happen?
Uh, right. First, I am skipping resource struct fields in prepend_input_struct_copy() but not in append_output_struct_copy(), so I added that, which was missing.
Second, yes. The errors in append_input_copy() and append_output_copy() aren't needed if we skip the resource fields and the the variables that are resources themselves, as we do directly in hlsl_emit_bytecode().
Also, could you please add tests for object input and output parameters?
This is related to this thread https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/159#note_29993 .
I think it would be more correct to say "objects within parameters", since resources are not considered input or output parameters, but are handled as uniforms instead, even if they are contained within input/output parameters that are structs. I removed the error for the same reason.
I had tests for objects as parameters in following patches. I brought them to this MR. But here, they are mostly useful to check that there aren't failed assertions or segfaults.