This patch makes index expressions on resources hlsl_ir_index nodes
instead of hlsl_ir_resource_load nodes, because it is not known if they
will be used later as the lhs of an hlsl_ir_resource_store.
For now, the only benefit is consistency.
--
v2: vkd3d-shader/hlsl: Don't keep the implicit mipmap level on hlsl_ir_index.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/182
From what I can tell, the recent work on SampleBias/SampleLevel did all of the work for us, we just need to take the same framework and include the case for the `sample_l` instruction.
Tested with some shaders from the native Linux version of Little Racers STREET.
--
v6: vkd3d-shader/tpf: For sample_l/sample_b, set lod swizzle to SCALAR.
vkd3d-shader/tpf: Add support for emitting sample_l instructions
tests: Add a test for SampleLevel() function.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/188
It indicates a misuse of the API and is undefined behavior according to Glib / GStreamer semantics. Glib tells about it nicely and returns a sensible value, but it should be fixed on the caller side.
> The g_return family of macros (g_return_if_fail(), g_return_val_if_fail(), g_return_if_reached(), g_return_val_if_reached()) should only be used for programming errors, a typical use case is checking for invalid parameters at the beginning of a public function. They should not be used if you just mean “if (error) return”, they should only be used if you mean “if (bug in program) return”. The program behavior is generally considered undefined after one of these checks fails. They are not intended for normal control flow, only to give a perhaps-helpful warning before giving up.
>
> https://docs.gtk.org/glib/logging.html
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2546#note_31696