vkd3d-shader/hlsl: Support evaluated expressions for sample count in multisampled textures declarations.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v2: vkd3d-shader/hlsl: Disallow certain instruction types from constant expressions.
vkd3d-shader/hlsl: Support evaluated expressions for sample count in multisampled textures declarations.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/256
```
On Margate Sands.
I can connect
Nothing with nothing.
```
--
v4: vkd3d-shader/d3dbc: Scan for the maximum temporary register index.
vkd3d-shader: Record a global temporary count per sm4 shader.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/255
In a declaration with multiple variables, the variables must be created
before the initializer of the next variable is parsed. This is required
for initializers such as:
```
float a = 1, b = a, c = b + 1;
```
The solution is to parse the type information in the same rule as the first variable ('a' in this case) so that it can be declared before the parser reaches the initializer for the following variables.
To initialize the following variables, the type information is passed along from the first variable's struct parse_variable_def to the next and so on.
---
Solves https://bugs.winehq.org/show_bug.cgi?id=54484, pointed out by @nsivov.
--
v4: vkd3d-shader/hlsl: Declare vars individually when parsing struct declarations.
vkd3d-shader/hlsl: Declare vars individually when parsing regular declarations.
vkd3d-shader/hlsl: Split declare_vars().
tests: Test multiple variable initializers.
tests: Test semantics in uniform variables.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/250
On my Nvidia GeForce GTX 1050 Ti `ddxddy.shader_test` doesn't pass because of considerably different numeric results.
As Giovanni pointed out, this is because my GPU uses the fine derivate and not the coarse derivate to implement ddx() and ddy().
For this reason, the result for ddx|ddy() is quantized so that the test passes if the GPU uses either coarse or fine derivates.
Additionally, tests for both ddx_coarse|ddy_coarse() and ddx_fine|ddy_fine() are added, that expect a more precise result.
--
v4: vkd3d-shader/hlsl: Support fine derivates.
vkd3d-shader/hlsl: Support coarse derivates.
tests: Quantize regular and coarse derivate test results.
tests: Make ddx() and ddy() test behave correctly for shader models < 4.
tests: Test coarse and fine derivates.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/224
This is obviously questionable, as it requires reaching into Wine internals in
tests (beyond simply detecting whether Wine is in use).
However, we are at a point where, for d3d10 and above, the Vulkan renderer works
well enough in general to see real use [in fact, in my experience it usually
works better than the GL renderer], and at this point I think avoiding
regressions is quite important. It is currently difficult to run tests with it
when the results contain so much noise, and I think we need to solve this
problem, by actually marking which tests work on each backend.
We could in theory expose the renderer through some adapter string, but I
believe in the past applications have been sensitive about the contents of
adapter strings.
Fixing either renderer to reach and maintain parity is not feasible. The GL
renderer is not going away, but regrettably GL as an API is abandoned by
Khronos, and important features we need in order to implement some Direct3D
features will probably never be introduced into GL. Moreover, the amount of
effort that would be required to reach parity is not small, and itself would all
need to be verified manually.
--
v2: d3d10core/tests: Mark test failures specific to the Vulkan or GL renderers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3232