[PATCH vkd3d 1/6] vkd3d-shader/hlsl: Abort when an unexpected type appears.

Giovanni Mascellani gmascellani at codeweavers.com
Thu Mar 24 03:21:53 CDT 2022


Hi,

Il 23/03/22 16:43, Henri Verbeet ha scritto:
> Would we be able to get here by providing either valid or invalid user
> input, or would the only way to get here be internal inconsistencies
> in the HLSL compiler? The latter would be fine, but I don't think we'd
> want to use assert() in the former case.

I agree with the general principle that the user shouldn't ever be able 
to make an assert() fire.

In the specic case, for each processed instruction write_sm4_block() 
asserts that, if it has a return type, then it is either a scalar or 
vector type. Furthermore, the base type for scalars or vectors is only 
allowed to be in that list of six types (int, uint, bool, float, double, 
half). Therefore, if control reaches the lines that I am changing, it 
means that we have another bug up the pipeline, it shouldn't happen just 
a result of invalid user input.

Giovanni.



More information about the wine-devel mailing list