vkd3d-shader/hlsl: Add some more constant folding operations.
Merge request reports
Activity
- Resolved by Nikolay Sivov
133 133 VKD3D_SHADER_ERROR_HLSL_MISSING_ATTRIBUTE = 5024, 134 134 VKD3D_SHADER_ERROR_HLSL_RECURSIVE_CALL = 5025, 135 135 VKD3D_SHADER_ERROR_HLSL_INCONSISTENT_SAMPLER = 5026, 136 VKD3D_SHADER_ERROR_HLSL_NON_FINITE_RESULT = 5027, 136 137 137 138 VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300, 138 139 VKD3D_SHADER_WARNING_HLSL_DIVISION_BY_ZERO = 5301, 139 140 VKD3D_SHADER_WARNING_HLSL_UNKNOWN_ATTRIBUTE = 5302, 141 VKD3D_SHADER_WARNING_HLSL_IMAGINARY_NUMERIC_RESULT = 5303, I am not sure of what is the general philosophy for the error identifiers in vkd3d. Honestly, my general feeling is they are a bit too specific. It's good to give a specific error message when this is meant for a human, as we do. But the error identifier is likely meant for a program, and I am not sure of which circumstances would make a program behave differently depending on whether the shader compilation failed because of a "non finite result", of a "division by zero or of an "offset out of bounds". Probably the only sensible thing a program can do in any of these occasions is to just report an error to the human, for whom the natural language error message is more useful than the error identifier; for that a single "HLSL compiler failed compilation" error identifier is probably more than enough.
OTOH, if we decide that for some reason we want to be specific with error identifiers, then let's really be specific. We already have "division by zero", so "non finite result" would be a useless generalization of that. Then let's call it "square root of a negative number".
As I said, I guess that's going to be pretty useless anyway, because I can't see any reasonable way to extract useful information from the error identifier, so leaving stuff as it is is fine for me too. I'm just a bit puzzled by the inconsistency.
added 70 commits
-
31c0de8c...f95ab2a5 - 67 commits from branch
wine:master
- 2456915b - vkd3d-shader/hlsl: Add constant folding for 'sqrt'.
- cd81cd1e - vkd3d-shader/hlsl: Add constant folding for 'log2'.
- bd9232cc - vkd3d-shader/hlsl: Use type width in fold_rcp().
Toggle commit list-
31c0de8c...f95ab2a5 - 67 commits from branch
added 41 commits
-
bd9232cc...5d75731d - 38 commits from branch
wine:master
- fddbc8fa - vkd3d-shader/hlsl: Add constant folding for 'sqrt'.
- 0784c58d - vkd3d-shader/hlsl: Add constant folding for 'log2'.
- 6dca036f - vkd3d-shader/hlsl: Use type width in fold_rcp().
Toggle commit list-
bd9232cc...5d75731d - 38 commits from branch