vkd3d/libs/vkd3d-shader
Zebediah Figura b1c2852cd7 vkd3d-shader/hlsl: Store function overloads in a list.
The choice to store them in an rbtree was made early on. It does not seem likely
that HLSL programs would define many overloads for any of their functions, but I
suspect the idea was rather that intrinsics would be defined as plain
hlsl_ir_function_decl structures [cf. 447463e590]
and that some intrinsics that could operate on any type would therefore need
many overrides.

This is not how we deal with intrinsics, however. When the first intrinsics were
implemented I made the choice disregard this intended design, and instead match
and convert their types manually, in C. Nothing that has happened in the time
since has led me to question that choice, and in fact, the flexibility with
which we must accommodate functions has led me to believe that matching in this
way was definitely the right choice. The main other designs I see would have
been:

* define each intrinsic variant separately using existing HLSL types. Besides
  efficiency concerns (i.e. this would take more space in memory, and would take
  longer to generate each variant), the normal type-matching rules don't really
  apply to intrinsics.

  [For example: elementwise intrinsics like abs() return the same type as the
  input, including preserving the distinction between float and float1. It is
  legal to define separate HLSL overloads taking float and float1, but trying to
  invoke these functions yields an "ambiguous function call" error.]

* introduce new (semi-)generic types. This is far more code and ends up acting
  like our current scheme (with helpers) in a slightly more complex form.

So I think we can go ahead and rip out this vestige of the original design for
intrinsics.

As for why to change it: rbtrees are simply more complex to deal with, and it
seems unlikely to me that the difference is going to matter. I do not expect any
program to define large quantities of intrinsics; linked list search should be
good enough.
2023-11-09 21:15:11 +01:00
..
checksum.c vkd3d-shader: Introduce vkd3d_make_u{16, 32}() helpers. 2021-08-11 20:58:24 +02:00
d3d_asm.c vkd3d-shader/spirv: Introduce integer width cast instructions. 2023-11-09 21:14:32 +01:00
d3dbc.c vkd3d-shader/hlsl: Implement ternary operator for SM1. 2023-11-08 22:49:31 +01:00
dxbc.c vkd3d-shader/dxil: Read the DXIL input and output signatures. 2023-10-16 22:36:29 +02:00
dxil.c vkd3d-shader/dxil: Do not use COLOROUT for PS outputs. 2023-11-09 21:14:49 +01:00
glsl.c vkd3d-shader/glsl: Update the current source location in vkd3d_glsl_generator_generate(). 2023-03-13 22:09:58 +01:00
hlsl_codegen.c vkd3d-shader/hlsl: Store function overloads in a list. 2023-11-09 21:15:11 +01:00
hlsl_constant_ops.c vkd3d-shader: Add constant folding for 'floor'. 2023-11-08 22:49:40 +01:00
hlsl.c vkd3d-shader/hlsl: Store function overloads in a list. 2023-11-09 21:15:11 +01:00
hlsl.h vkd3d-shader/hlsl: Store function overloads in a list. 2023-11-09 21:15:11 +01:00
hlsl.l vkd3d-shader/hlsl: Sort keywords. 2023-11-06 23:09:20 +01:00
hlsl.y vkd3d-shader/hlsl: Store function overloads in a list. 2023-11-09 21:15:11 +01:00
ir.c vkd3d-shader/ir: Normalize all I/O registers to INPUT/OUTPUT/PATCHCONST. 2023-11-09 21:14:52 +01:00
libvkd3d-shader.pc.in build: Build libvkd3d-shader as public library. 2018-11-02 11:19:00 +01:00
preproc.h build: Make the default symbol visibility "hidden". 2021-08-09 21:43:22 +02:00
preproc.l vkd3d-shader/preproc: Append spaces between tokens in macro invocations. 2023-08-02 20:19:21 +09:00
preproc.y vkd3d-shader/hlsl: Handle over/underflow when parsing integer literals. 2022-05-12 19:33:56 +02:00
spirv.c vkd3d-shader/spirv: Remove no longer used private_output_variable_array_idx array. 2023-11-09 21:15:01 +01:00
tpf.c vkd3d-shader/tpf: Add support for ceil(). 2023-11-08 22:49:38 +01:00
vkd3d_shader_main.c vkd3d-shader: Dump shaders as soon as possible. 2023-11-02 18:22:26 +01:00
vkd3d_shader_private.h vkd3d-shader/ir: Normalize all I/O registers to INPUT/OUTPUT/PATCHCONST. 2023-11-09 21:14:52 +01:00
vkd3d_shader.map vkd3d-shader: Export vkd3d_shader_build_varying_map. 2023-09-19 21:30:35 +02:00