ReactOS 0.4.17-dev-934-g091855f
hlsl.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Matteo Bruni for CodeWeavers
3 * Copyright 2019-2020 Zebediah Figura for CodeWeavers
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#ifndef __VKD3D_SHADER_HLSL_H
21#define __VKD3D_SHADER_HLSL_H
22
24#include "wine/rbtree.h"
25#include "d3dcommon.h"
26#include "d3dx9shader.h"
27
28/* The general IR structure is inspired by Mesa GLSL hir, even though the code
29 * ends up being quite different in practice. Anyway, here comes the relevant
30 * licensing information.
31 *
32 * Copyright © 2010 Intel Corporation
33 *
34 * Permission is hereby granted, free of charge, to any person obtaining a
35 * copy of this software and associated documentation files (the "Software"),
36 * to deal in the Software without restriction, including without limitation
37 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
38 * and/or sell copies of the Software, and to permit persons to whom the
39 * Software is furnished to do so, subject to the following conditions:
40 *
41 * The above copyright notice and this permission notice (including the next
42 * paragraph) shall be included in all copies or substantial portions of the
43 * Software.
44 *
45 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
48 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
50 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
51 * DEALINGS IN THE SOFTWARE.
52 */
53
54#define HLSL_SWIZZLE_X (0u)
55#define HLSL_SWIZZLE_Y (1u)
56#define HLSL_SWIZZLE_Z (2u)
57#define HLSL_SWIZZLE_W (3u)
58
59#define HLSL_SWIZZLE(x, y, z, w) \
60 (((HLSL_SWIZZLE_ ## x) << 0) \
61 | ((HLSL_SWIZZLE_ ## y) << 2) \
62 | ((HLSL_SWIZZLE_ ## z) << 4) \
63 | ((HLSL_SWIZZLE_ ## w) << 6))
64
65#define HLSL_SWIZZLE_MASK (0x3u)
66#define HLSL_SWIZZLE_SHIFT(idx) (2u * (idx))
67
68static inline unsigned int hlsl_swizzle_get_component(uint32_t swizzle, unsigned int idx)
69{
71}
72
74{
79}
80
82{
111};
112
114{
122};
123
125{
142 /* NOTE: Remember to update object_methods[] in hlsl.y if this enum is modified. */
143};
144
146{
153};
154
155/* An HLSL source-level data type, including anonymous structs and typedefs. */
157{
158 /* Item entry in hlsl_ctx->types. */
159 struct list entry;
160 /* Item entry in hlsl_scope->types. hlsl_type->name is used as key (if not NULL). */
162
163 enum hlsl_type_class class;
164
165 /* If class is HLSL_CLASS_SAMPLER, then sampler_dim is <= HLSL_SAMPLER_DIM_LAST_SAMPLER.
166 * If class is HLSL_CLASS_TEXTURE, then sampler_dim can be any value of the enum except
167 * HLSL_SAMPLER_DIM_GENERIC and HLSL_SAMPLER_DIM_COMPARISON.
168 * If class is HLSL_CLASS_UAV, then sampler_dim must be one of HLSL_SAMPLER_DIM_1D,
169 * HLSL_SAMPLER_DIM_2D, HLSL_SAMPLER_DIM_3D, HLSL_SAMPLER_DIM_1DARRAY, HLSL_SAMPLER_DIM_2DARRAY,
170 * HLSL_SAMPLER_DIM_BUFFER, or HLSL_SAMPLER_DIM_STRUCTURED_BUFFER.
171 * Otherwise, sampler_dim is not used */
173 /* Name, in case the type is a named struct or a typedef. */
174 const char *name;
175 /* Bitfield for storing type modifiers, subset of HLSL_TYPE_MODIFIERS_MASK.
176 * Modifiers that don't fall inside this mask are to be stored in the variable in
177 * hlsl_ir_var.modifiers, or in the struct field in hlsl_ir_field.modifiers. */
179 /* Size of the type values on each dimension. For non-numeric types, they are set for the
180 * convenience of the sm1/sm4 backends.
181 * If type is HLSL_CLASS_SCALAR, then both dimx = 1 and dimy = 1.
182 * If type is HLSL_CLASS_VECTOR, then dimx is the size of the vector, and dimy = 1.
183 * If type is HLSL_CLASS_MATRIX, then dimx is the number of columns, and dimy the number of rows.
184 * If type is HLSL_CLASS_ARRAY, then dimx and dimy have the same value as in the type of the array elements.
185 * If type is HLSL_CLASS_STRUCT, then dimx is the sum of (dimx * dimy) of every component, and dimy = 1.
186 */
187 unsigned int dimx;
188 unsigned int dimy;
189 /* Sample count for HLSL_SAMPLER_DIM_2DMS or HLSL_SAMPLER_DIM_2DMSARRAY. */
190 unsigned int sample_count;
191
192 union
193 {
194 /* Additional information if type is numeric. */
195 struct
196 {
199 /* Additional information if type is HLSL_CLASS_STRUCT. */
200 struct
201 {
205 /* Additional information if type is HLSL_CLASS_ARRAY. */
206 struct
207 {
209 /* Array length, or HLSL_ARRAY_ELEMENTS_COUNT_IMPLICIT if it is not known yet at parse time. */
210 unsigned int elements_count;
212 /* Additional information if the class is HLSL_CLASS_TEXTURE or
213 * HLSL_CLASS_UAV. */
214 struct
215 {
216 /* Format of the data contained within the type. */
218 /* The type is a rasteriser-ordered view. */
221 /* Additional field to distinguish object types. Currently used only for technique types. */
222 unsigned int version;
223 } e;
224
225 /* Number of numeric register components used by one value of this type, for each regset.
226 * For HLSL_REGSET_NUMERIC, 4 components make 1 register, while for other regsets 1 component makes
227 * 1 register.
228 * If type is HLSL_CLASS_STRUCT or HLSL_CLASS_ARRAY, the reg_size of their elements and padding
229 * (which varies according to the backend) is also included. */
230 unsigned int reg_size[HLSL_REGSET_LAST + 1];
231 /* Offset where the type's description starts in the output bytecode, in bytes. */
233
235};
236
237/* In HLSL, a semantic is a string linked to a variable (or a field) to be recognized across
238 * different shader stages in the graphics pipeline. */
240{
241 const char *name;
243
244 /* Name exactly as it appears in the sources. */
245 const char *raw_name;
246 /* If the variable or field that stores this hlsl_semantic has already reported that it is missing. */
248 /* In case the variable or field that stores this semantic has already reported to use a
249 * duplicated output semantic, this value stores the last reported index + 1. Otherwise it is 0. */
251 /* In case the variable or field that stores this semantic has already reported to use a
252 * duplicated input semantic with incompatible values, this value stores the last reported
253 * index + 1. Otherwise it is 0. */
255};
256
257/* A field within a struct type declaration, used in hlsl_type.e.fields. */
259{
262 const char *name;
264
265 /* Bitfield for storing modifiers that are not in HLSL_TYPE_MODIFIERS_MASK (these are stored in
266 * type->modifiers instead) and that also are specific to the field and not the whole variable.
267 * In particular, interpolation modifiers. */
269 /* Offset of the field within the type it belongs to, in register components, for each regset. */
270 unsigned int reg_offset[HLSL_REGSET_LAST + 1];
271
272 /* Offset where the field name starts in the output bytecode, in bytes. */
274};
275
276/* Information of the register(s) allocated for an instruction node or variable.
277 * These values are initialized at the end of hlsl_emit_bytecode(), after the compilation passes,
278 * just before writing the bytecode.
279 * The type of register (register class) is implied from its use, so it is not stored in this
280 * struct. */
282{
283 /* Register number of the first register allocated. */
285 /* For descriptors (buffer, texture, sampler, UAV) this is the base binding
286 * index of the descriptor.
287 * For 5.1 and above descriptors have space and may be arrayed, in which
288 * case the array shares a single register ID but has a range of register
289 * indices, and "id" and "index" are as a rule not equal.
290 * For versions below 5.1, the register number for descriptors is the same
291 * as its external binding index, so only "index" is used, and "id" is
292 * ignored.
293 * For numeric registers "index" is not used. */
295 /* Register space of a descriptor. Not used for numeric registers. */
297 /* Number of registers to be allocated.
298 * Unlike the variable's type's regsize, it is not expressed in register components, but rather
299 * in whole registers, and may depend on which components are used within the shader. */
301 /* For numeric registers, a writemask can be provided to indicate the reservation of only some
302 * of the 4 components. */
303 unsigned int writemask;
304 /* Whether the register has been allocated. */
306};
307
308/* Types of instruction nodes for the IR.
309 * Each type of instruction node is associated to a struct with the same name in lower case.
310 * e.g. for HLSL_IR_CONSTANT there exists struct hlsl_ir_constant.
311 * Each one of these structs start with a struct hlsl_ir_node field, so pointers to values of these
312 * types can be casted seamlessly to (struct hlsl_ir_node *) and vice-versa. */
314{
329
333
335};
336
337/* Common data for every type of IR instruction node. */
339{
340 /* Item entry for storing the instruction in a list of instructions. */
341 struct list entry;
342
343 /* Type of node, which means that a pointer to this struct hlsl_ir_node can be casted to a
344 * pointer to the struct with the same name. */
346 /* HLSL data type of the node, when used by other nodes as a source (through an hlsl_src).
347 * HLSL_IR_CONSTANT, HLSL_IR_EXPR, HLSL_IR_LOAD, HLSL_IR_RESOURCE_LOAD, and HLSL_IR_SWIZZLE
348 * have a data type and can be used through an hlsl_src; other types of node don't. */
350
351 /* List containing all the struct hlsl_src·s that point to this node; linked by the
352 * hlsl_src.entry fields. */
353 struct list uses;
354
356
357 /* Liveness ranges. "index" is the index of this instruction. Since this is
358 * essentially an SSA value, the earliest live point is the index. This is
359 * true even for loops, since currently we can't have a reference to a
360 * value generated in an earlier iteration of the loop. */
361 unsigned int index, last_read;
362 /* Temp. register allocated to store the result of this instruction (if any). */
363 struct hlsl_reg reg;
364};
365
367{
368 /* List containing instruction nodes; linked by the hlsl_ir_node.entry fields. */
369 struct list instrs;
370 /* Instruction representing the "value" of this block, if applicable.
371 * This may point to an instruction outside of this block! */
373};
374
375/* A reference to an instruction node (struct hlsl_ir_node), usable as a field in other structs.
376 * struct hlsl_src is more powerful than a mere pointer to an hlsl_ir_node because it also
377 * contains a linked list item entry, which is used by the referenced instruction node to keep
378 * track of all the hlsl_src·s that reference it.
379 * This allows replacing any hlsl_ir_node with any other in all the places it is used, or checking
380 * that a node has no uses before it is removed. */
382{
384 /* Item entry for node->uses. */
385 struct list entry;
386};
387
389{
390 const char *name;
393 unsigned int args_count;
394 struct hlsl_src args[];
395};
396
397#define HLSL_STORAGE_EXTERN 0x00000001
398#define HLSL_STORAGE_NOINTERPOLATION 0x00000002
399#define HLSL_MODIFIER_PRECISE 0x00000004
400#define HLSL_STORAGE_SHARED 0x00000008
401#define HLSL_STORAGE_GROUPSHARED 0x00000010
402#define HLSL_STORAGE_STATIC 0x00000020
403#define HLSL_STORAGE_UNIFORM 0x00000040
404#define HLSL_MODIFIER_VOLATILE 0x00000080
405#define HLSL_MODIFIER_CONST 0x00000100
406#define HLSL_MODIFIER_ROW_MAJOR 0x00000200
407#define HLSL_MODIFIER_COLUMN_MAJOR 0x00000400
408#define HLSL_STORAGE_IN 0x00000800
409#define HLSL_STORAGE_OUT 0x00001000
410#define HLSL_MODIFIER_INLINE 0x00002000
411#define HLSL_STORAGE_CENTROID 0x00004000
412#define HLSL_STORAGE_NOPERSPECTIVE 0x00008000
413#define HLSL_STORAGE_LINEAR 0x00010000
414#define HLSL_MODIFIER_SINGLE 0x00020000
415#define HLSL_MODIFIER_EXPORT 0x00040000
416#define HLSL_STORAGE_ANNOTATION 0x00080000
417#define HLSL_MODIFIER_UNORM 0x00100000
418#define HLSL_MODIFIER_SNORM 0x00200000
419
420#define HLSL_TYPE_MODIFIERS_MASK (HLSL_MODIFIER_PRECISE | HLSL_MODIFIER_VOLATILE | \
421 HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \
422 HLSL_MODIFIER_COLUMN_MAJOR | HLSL_MODIFIER_UNORM | HLSL_MODIFIER_SNORM)
423
424#define HLSL_INTERPOLATION_MODIFIERS_MASK (HLSL_STORAGE_NOINTERPOLATION | HLSL_STORAGE_CENTROID | \
425 HLSL_STORAGE_NOPERSPECTIVE | HLSL_STORAGE_LINEAR)
426
427#define HLSL_MODIFIERS_MAJORITY_MASK (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
428
429#define HLSL_ARRAY_ELEMENTS_COUNT_IMPLICIT 0
430
431/* Reservation of a register and/or an offset for objects inside constant buffers, to be used as a
432 * starting point of their allocation. They are available through the register(·) and the
433 * packoffset(·) syntaxes, respectively.
434 * The constant buffer offset is measured register components. */
436{
438 unsigned int reg_space, reg_index;
439
441 unsigned int offset_index;
442};
443
445{
448 float f;
449 double d;
450};
451
453{
456 const char *name;
458 /* Buffer where the variable's value is stored, in case it is uniform. */
460 /* Bitfield for storage modifiers (type modifiers are stored in data_type->modifiers). */
462 /* Optional reservations of registers and/or offsets for variables within constant buffers. */
464
465 /* Item entry in hlsl_scope.vars. Specifically hlsl_ctx.globals.vars if the variable is global. */
467 /* Item entry in hlsl_ctx.extern_vars, if the variable is extern. */
469 /* Scope that variable itself defines, used to provide a container for techniques and passes. */
471 /* Scope that contains annotations for this variable. */
473
474 /* Array of default values the variable was initialized with, one for each component.
475 * Only for variables that need it, such as uniforms and variables inside constant buffers.
476 * This pointer is NULL for others. */
478 {
479 /* Default value, in case the component is a string, otherwise it is NULL. */
480 const char *string;
481 /* Default value, in case the component is a numeric value. */
484
485 /* A dynamic array containing the state block on the variable's declaration, if any.
486 * An array variable may contain multiple state blocks.
487 * A technique pass will always contain one.
488 * These are only really used for effect profiles. */
490 unsigned int state_block_count;
492
493 /* Indexes of the IR instructions where the variable is first written and last read (liveness
494 * range). The IR instructions are numerated starting from 2, because 0 means unused, and 1
495 * means function entry. */
496 unsigned int first_write, last_read;
497 /* Whether the variable is read in any entry function. */
499 /* Offset where the variable's value is stored within its buffer in numeric register components.
500 * This in case the variable is uniform. */
501 unsigned int buffer_offset;
502 /* Register to which the variable is allocated during its lifetime, for each register set.
503 * In case that the variable spans multiple registers in one regset, this is set to the
504 * start of the register range.
505 * Builtin semantics don't use the field.
506 * In SM4, uniforms don't use the field because they are located using the buffer's hlsl_reg
507 * and the buffer_offset instead. */
509
510 struct
511 {
512 bool used;
516 /* Minimum number of binds required to include all components actually used in the shader.
517 * It may be less than the allocation size, e.g. for texture arrays.
518 * The bind_count for HLSL_REGSET_NUMERIC is only used in uniforms for now. */
519 unsigned int bind_count[HLSL_REGSET_LAST + 1];
520
521 /* Whether the shader performs dereferences with non-constant offsets in the variable. */
523 /* Whether this is a semantic variable that was split from an array, or is the first
524 * element of a struct, and thus needs to be aligned when packed in the signature. */
526
534};
535
536/* This struct is used to represent assignments in state block entries:
537 * name = {args[0], args[1], ...};
538 * - or -
539 * name = args[0]
540 * - or -
541 * name[lhs_index] = args[0]
542 * - or -
543 * name[lhs_index] = {args[0], args[1], ...};
544 *
545 * This struct also represents function call syntax:
546 * name(args[0], args[1], ...)
547 */
549{
550 /* Whether this entry is a function call. */
552
553 /* For assignments, the name in the lhs.
554 * For functions, the name of the function. */
555 char *name;
556 /* Resolved format-specific property identifier. */
557 unsigned int name_id;
558
559 /* For assignments, whether the lhs of an assignment is indexed and, in
560 * that case, its index. */
562 unsigned int lhs_index;
563
564 /* Instructions present in the rhs or the function arguments. */
566
567 /* For assignments, arguments of the rhs initializer.
568 * For function calls, the arguments themselves. */
569 struct hlsl_src *args;
570 unsigned int args_count;
571};
572
574{
577};
578
579/* Sized array of variables representing a function's parameters. */
581{
584};
585
587{
588 /* Item entry in hlsl_ctx.functions */
590
591 const char *name;
592 /* Tree containing function definitions, stored as hlsl_ir_function_decl structures, which would
593 * be more than one in case of function overloading. */
595};
596
598{
600 /* Synthetic variable used to store the return value of the function. */
602
604 /* Item entry in hlsl_ir_function.overloads. */
605 struct list entry;
606
607 /* Function to which this declaration corresponds. */
609
611
614 /* Array of attributes (like numthreads) specified just before the function declaration.
615 * Not to be confused with the function parameters! */
616 unsigned int attr_count;
617 const struct hlsl_attribute *const *attrs;
618
620
621 /* Synthetic boolean variable marking whether a return statement has been
622 * executed. Needed to deal with return statements in non-uniform control
623 * flow, since some backends can't handle them. */
625
626 /* List of all the extern semantic variables; linked by the
627 * hlsl_ir_var.extern_entry fields. This exists as a convenience because
628 * it is often necessary to iterate all extern variables and these can be
629 * declared in as function parameters, or as the function return value. */
631};
632
634{
637};
638
640{
645};
646
648{
653
655{
657 /* loop condition is stored in the body (as "if (!condition) break;") */
659 unsigned int next_index; /* liveness index of the end of the loop */
660 unsigned int unroll_limit;
662};
663
665{
666 unsigned int value;
669 struct list entry;
671};
672
674{
677 struct list cases;
678};
679
681{
685
691 HLSL_OP1_COS_REDUCED, /* Reduced range [-pi, pi], writes to .x */
714 HLSL_OP1_SIN_REDUCED, /* Reduced range [-pi, pi], writes to .y */
717
737 /* SLT(a, b) retrieves 1.0 if (a < b), else 0.0. Only used for SM1-SM3 target vertex shaders. */
739
740 /* DP2ADD(a, b, c) computes the scalar product of a.xy and b.xy,
741 * then adds c, where c must have dimx=1. */
743 /* TERNARY(a, b, c) returns 'b' if 'a' is true and 'c' otherwise. 'a' must always be boolean.
744 * CMP(a, b, c) returns 'b' if 'a' >= 0, and 'c' otherwise. It's used only for SM1-SM3 targets. */
748};
749
750#define HLSL_MAX_OPERANDS 3
751
753{
757};
758
760{
766 /* UNRESOLVED_CONTINUE type is used by the parser when 'continue' statement is found,
767 it never reaches code generation, and is resolved to CONTINUE type once iteration
768 and loop exit logic was properly applied. */
770};
771
773{
776 /* Argument used for HLSL_IR_JUMP_DISCARD_NZ and HLSL_IR_JUMP_DISCARD_NEG. */
778};
779
781{
783 struct hlsl_src val;
785};
786
788{
790 struct hlsl_src val, idx;
791};
792
793/* Reference to a variable, or a part of it (e.g. a vector within a matrix within a struct). */
795{
797
798 /* An array of references to instruction nodes, of data type uint, that are used to reach the
799 * desired part of the variable.
800 * If path_len is 0, then this is a reference to the whole variable.
801 * The value of each instruction node in the path corresponds to the index of the element/field
802 * that has to be selected on each nesting level to reach this part.
803 * The path shall not contain additional values once a type that cannot be subdivided
804 * (a.k.a. "component") is reached. */
805 unsigned int path_len;
806 struct hlsl_src *path;
807
808 /* Before writing the bytecode, deref paths are lowered into an offset (within the pertaining
809 * regset) from the start of the variable, to the part of the variable that is referenced.
810 * This offset is stored using two fields, one for a variable part and other for a constant
811 * part, which are added together:
812 * - rel_offset: An offset given by an instruction node, in whole registers.
813 * - const_offset: A constant number of register components.
814 * Since the type information cannot longer be retrieved from the offset alone, the type is
815 * stored in the data_type field, which remains NULL if the deref hasn't been lowered yet. */
817 unsigned int const_offset;
819};
820
821/* Whether the path has been lowered to an offset or not. */
822static inline bool hlsl_deref_is_lowered(const struct hlsl_deref *deref)
823{
824 return !!deref->data_type;
825}
826
828{
831};
832
834{
849};
850
852{
856 struct hlsl_src coords, lod, ddx, ddy, cmp, sample_index, texel_offset;
858};
859
861{
865};
866
868{
871 struct hlsl_src rhs;
872 unsigned char writemask;
873};
874
876{
879 {
882 /* Constant register of type 'c' where the constant value is stored for SM1. */
883 struct hlsl_reg reg;
884};
885
887{
889 char *string;
890};
891
892/* Represents shader compilation call for effects, such as "CompileShader()".
893 *
894 * Unlike hlsl_ir_call, it is not flattened, thus, it keeps track of its
895 * arguments and maintains its own instruction block. */
897{
899
901 {
902 /* A shader compilation through the CompileShader() function or the "compile" syntax. */
904 /* A call to ConstructGSWithSO(), which receives a geometry shader and retrieves one as well. */
907
908 /* Special field to store the profile argument for HLSL_COMPILE_TYPE_COMPILE. */
910
911 /* Block containing the instructions required by the arguments of the
912 * compilation call. */
914
915 /* Arguments to the compilation call. For HLSL_COMPILE_TYPE_COMPILE
916 * args[0] is an hlsl_ir_call to the specified function. */
917 struct hlsl_src *args;
918 unsigned int args_count;
919};
920
921/* Represents a state block initialized with the "sampler_state" keyword. */
923{
925
927};
928
929/* Stateblock constants are undeclared values found on state blocks or technique passes descriptions,
930 * that do not concern regular pixel, vertex, or compute shaders, except for parsing. */
932{
934 char *name;
935};
936
937/* A vkd3d_shader_instruction that can be inserted in a hlsl_block.
938 * Only used for the HLSL IR to vsir translation, might be removed once this translation is complete. */
940{
942
943 /* Index to a vkd3d_shader_instruction within a vkd3d_shader_instruction_array in a vsir_program. */
944 unsigned int vsir_instr_idx;
945};
946
948{
949 /* Item entry for hlsl_ctx.scopes. */
950 struct list entry;
951
952 /* List containing the variables declared in this scope; linked by hlsl_ir_var->scope_entry. */
953 struct list vars;
954 /* Tree map containing the types declared in this scope, using hlsl_tree.name as key.
955 * The types are attached through the hlsl_type.scope_entry fields. */
957 /* Scope containing this scope. This value is NULL for the global scope. */
959 /* The scope was created for the loop statement. */
960 bool loop;
961 /* The scope was created for the switch statement. */
963 /* The scope contains annotation variables. */
965};
966
968{
969 const char *name;
971 unsigned int major_version;
972 unsigned int minor_version;
973 unsigned int major_level;
974 unsigned int minor_level;
976};
977
979{
980 float f[4];
981};
982
984{
987};
988
989/* In SM4, uniform variables are organized in different buffers. Besides buffers defined in the
990 * source code, there is also the implicit $Globals buffer and the implicit $Params buffer,
991 * to which uniform globals and parameters belong by default. */
993{
996 const char *name;
998 /* Register reserved for this buffer, if any.
999 * If provided, it should be of type 'b' if type is HLSL_BUFFER_CONSTANT and 't' if type is
1000 * HLSL_BUFFER_TEXTURE. */
1002 /* Scope that contains annotations for this buffer. */
1004 /* Item entry for hlsl_ctx.buffers */
1005 struct list entry;
1006
1007 /* The size of the buffer (in register components), and the size of the buffer as determined
1008 * by its last variable that's actually used. */
1009 unsigned size, used_size;
1010 /* Register of type 'b' on which the buffer is allocated. */
1012
1015};
1016
1018{
1020
1021 const char **source_files;
1023 /* Current location being read in the HLSL source, updated while parsing. */
1025 /* Stores the logging messages and logging configuration. */
1027 /* Cache for temporary string allocations. */
1029 /* A value from enum vkd3d_result with the current success/failure result of the whole
1030 * compilation.
1031 * It is initialized to VKD3D_OK and set to an error code in case a call to hlsl_fixme() or
1032 * hlsl_error() is triggered, or in case of a memory allocation error.
1033 * The value of this field is checked between compilation stages to stop execution in case of
1034 * failure. */
1036
1037 /* Pointer to an opaque data structure managed by FLEX (during lexing), that encapsulates the
1038 * current state of the scanner. This pointer is required by all FLEX API functions when the
1039 * scanner is declared as reentrant, which is the case. */
1040 void *scanner;
1041
1042 /* Pointer to the current scope; changes as the parser reads the code. */
1044 /* Scope of global variables. */
1046 /* Dummy scope for variables which should never be looked up by name. */
1048 /* List of all the scopes in the program; linked by the hlsl_scope.entry fields. */
1049 struct list scopes;
1050
1051 /* List of all the extern variables, excluding semantic variables; linked
1052 * by the hlsl_ir_var.extern_entry fields. This exists as a convenience
1053 * because it is often necessary to iterate all extern variables declared
1054 * in the global scope or as function parameters. */
1056
1057 /* List containing both the built-in HLSL buffers ($Globals and $Params) and the ones declared
1058 * in the shader; linked by the hlsl_buffer.entry fields. */
1060 /* Current buffer (changes as the parser reads the code), $Globals buffer, and $Params buffer,
1061 * respectively. */
1063 /* List containing all created hlsl_types, except builtin_types; linked by the hlsl_type.entry
1064 * fields. */
1065 struct list types;
1066 /* Tree map for the declared functions, using hlsl_ir_function.name as key.
1067 * The functions are attached through the hlsl_ir_function.entry fields. */
1069 /* Pointer to the current function; changes as the parser reads the code. */
1071
1072 /* Counter for generating unique internal variable names. */
1074
1075 /* Default matrix majority for matrix types. Can be set by a pragma within the HLSL source. */
1076 unsigned int matrix_majority;
1077
1078 /* Basic data types stored for convenience. */
1079 struct
1080 {
1083 /* matrix[HLSL_TYPE_FLOAT][1][3] is a float4x2, i.e. dimx = 2, dimy = 4 */
1091
1092 /* Pre-allocated "error" expression. */
1094
1095 /* List of the instruction nodes for initializing static variables. */
1097
1098 /* Dynamic array of constant values that appear in the shader, associated to the 'c' registers.
1099 * Only used for SM1 profiles. */
1101 {
1103 {
1108 size_t count, size;
1110 /* 'c' registers where the constants expected by SM2 sincos are stored. */
1111 struct hlsl_reg d3dsincosconst1, d3dsincosconst2;
1112
1113 /* Number of threads to be executed (on the X, Y, and Z dimensions) in a single thread group in
1114 * compute shader profiles. It is set using the numthreads() attribute in the entry point. */
1116
1122
1123 /* In some cases we generate opcodes by parsing an HLSL function and then
1124 * invoking it. If not NULL, this field is the name of the function that we
1125 * are currently parsing, "mangled" with an internal prefix to avoid
1126 * polluting the user namespace. */
1128
1129 /* Whether the parser is inside a state block (effects' metadata) inside a variable declaration. */
1131 /* Whether the numthreads() attribute has been provided in the entry-point function. */
1133
1139};
1140
1141static inline bool hlsl_version_ge(const struct hlsl_ctx *ctx, unsigned int major, unsigned int minor)
1142{
1143 return ctx->profile->major_version > major || (ctx->profile->major_version == major && ctx->profile->minor_version >= minor);
1144}
1145
1146static inline bool hlsl_version_lt(const struct hlsl_ctx *ctx, unsigned int major, unsigned int minor)
1147{
1148 return !hlsl_version_ge(ctx, major, minor);
1149}
1150
1152{
1158};
1159
1160static inline struct hlsl_ir_call *hlsl_ir_call(const struct hlsl_ir_node *node)
1161{
1162 VKD3D_ASSERT(node->type == HLSL_IR_CALL);
1163 return CONTAINING_RECORD(node, struct hlsl_ir_call, node);
1164}
1165
1166static inline struct hlsl_ir_constant *hlsl_ir_constant(const struct hlsl_ir_node *node)
1167{
1170}
1171
1173{
1176}
1177
1178static inline struct hlsl_ir_expr *hlsl_ir_expr(const struct hlsl_ir_node *node)
1179{
1180 VKD3D_ASSERT(node->type == HLSL_IR_EXPR);
1181 return CONTAINING_RECORD(node, struct hlsl_ir_expr, node);
1182}
1183
1184static inline struct hlsl_ir_if *hlsl_ir_if(const struct hlsl_ir_node *node)
1185{
1186 VKD3D_ASSERT(node->type == HLSL_IR_IF);
1187 return CONTAINING_RECORD(node, struct hlsl_ir_if, node);
1188}
1189
1190static inline struct hlsl_ir_jump *hlsl_ir_jump(const struct hlsl_ir_node *node)
1191{
1192 VKD3D_ASSERT(node->type == HLSL_IR_JUMP);
1193 return CONTAINING_RECORD(node, struct hlsl_ir_jump, node);
1194}
1195
1196static inline struct hlsl_ir_load *hlsl_ir_load(const struct hlsl_ir_node *node)
1197{
1198 VKD3D_ASSERT(node->type == HLSL_IR_LOAD);
1199 return CONTAINING_RECORD(node, struct hlsl_ir_load, node);
1200}
1201
1202static inline struct hlsl_ir_loop *hlsl_ir_loop(const struct hlsl_ir_node *node)
1203{
1204 VKD3D_ASSERT(node->type == HLSL_IR_LOOP);
1205 return CONTAINING_RECORD(node, struct hlsl_ir_loop, node);
1206}
1207
1209{
1212}
1213
1215{
1218}
1219
1220static inline struct hlsl_ir_store *hlsl_ir_store(const struct hlsl_ir_node *node)
1221{
1223 return CONTAINING_RECORD(node, struct hlsl_ir_store, node);
1224}
1225
1226static inline struct hlsl_ir_swizzle *hlsl_ir_swizzle(const struct hlsl_ir_node *node)
1227{
1229 return CONTAINING_RECORD(node, struct hlsl_ir_swizzle, node);
1230}
1231
1232static inline struct hlsl_ir_index *hlsl_ir_index(const struct hlsl_ir_node *node)
1233{
1235 return CONTAINING_RECORD(node, struct hlsl_ir_index, node);
1236}
1237
1238static inline struct hlsl_ir_switch *hlsl_ir_switch(const struct hlsl_ir_node *node)
1239{
1241 return CONTAINING_RECORD(node, struct hlsl_ir_switch, node);
1242}
1243
1244static inline struct hlsl_ir_compile *hlsl_ir_compile(const struct hlsl_ir_node *node)
1245{
1247 return CONTAINING_RECORD(node, struct hlsl_ir_compile, node);
1248}
1249
1251{
1254};
1255
1257{
1260}
1261
1263{
1266}
1267
1268static inline void hlsl_block_init(struct hlsl_block *block)
1269{
1270 list_init(&block->instrs);
1271 block->value = NULL;
1272}
1273
1274static inline void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir_node *instr)
1275{
1276 list_add_tail(&block->instrs, &instr->entry);
1277 block->value = (instr->data_type ? instr : NULL);
1278}
1279
1280static inline void hlsl_block_add_block(struct hlsl_block *block, struct hlsl_block *add)
1281{
1282 list_move_tail(&block->instrs, &add->instrs);
1283 block->value = add->value;
1284}
1285
1286static inline void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node)
1287{
1288 src->node = node;
1289 if (node)
1290 list_add_tail(&node->uses, &src->entry);
1291}
1292
1293static inline void hlsl_src_remove(struct hlsl_src *src)
1294{
1295 if (src->node)
1296 list_remove(&src->entry);
1297 src->node = NULL;
1298}
1299
1300static inline void *hlsl_alloc(struct hlsl_ctx *ctx, size_t size)
1301{
1302 void *ptr = vkd3d_calloc(1, size);
1303
1304 if (!ptr)
1306 return ptr;
1307}
1308
1309static inline void *hlsl_calloc(struct hlsl_ctx *ctx, size_t count, size_t size)
1310{
1311 void *ptr = vkd3d_calloc(count, size);
1312
1313 if (!ptr)
1315 return ptr;
1316}
1317
1318static inline void *hlsl_realloc(struct hlsl_ctx *ctx, void *ptr, size_t size)
1319{
1320 void *ret = vkd3d_realloc(ptr, size);
1321
1322 if (!ret)
1324 return ret;
1325}
1326
1327static inline char *hlsl_strdup(struct hlsl_ctx *ctx, const char *string)
1328{
1329 char *ptr = vkd3d_strdup(string);
1330
1331 if (!ptr)
1333 return ptr;
1334}
1335
1336static inline bool hlsl_array_reserve(struct hlsl_ctx *ctx, void **elements,
1337 size_t *capacity, size_t element_count, size_t element_size)
1338{
1339 bool ret = vkd3d_array_reserve(elements, capacity, element_count, element_size);
1340
1341 if (!ret)
1343 return ret;
1344}
1345
1347{
1348 struct vkd3d_string_buffer *ret = vkd3d_string_buffer_get(&ctx->string_buffers);
1349
1350 if (!ret)
1352 return ret;
1353}
1354
1356{
1357 vkd3d_string_buffer_release(&ctx->string_buffers, buffer);
1358}
1359
1360static inline struct hlsl_type *hlsl_get_scalar_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type)
1361{
1362 return ctx->builtin_types.scalar[base_type];
1363}
1364
1365static inline struct hlsl_type *hlsl_get_vector_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type,
1366 unsigned int dimx)
1367{
1368 return ctx->builtin_types.vector[base_type][dimx - 1];
1369}
1370
1371static inline struct hlsl_type *hlsl_get_matrix_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type,
1372 unsigned int dimx, unsigned int dimy)
1373{
1374 return ctx->builtin_types.matrix[base_type][dimx - 1][dimy - 1];
1375}
1376
1377static inline struct hlsl_type *hlsl_get_numeric_type(const struct hlsl_ctx *ctx, enum hlsl_type_class type,
1378 enum hlsl_base_type base_type, unsigned int dimx, unsigned int dimy)
1379{
1380 if (type == HLSL_CLASS_SCALAR)
1381 return hlsl_get_scalar_type(ctx, base_type);
1382 else if (type == HLSL_CLASS_VECTOR)
1383 return hlsl_get_vector_type(ctx, base_type, dimx);
1384 else
1385 return hlsl_get_matrix_type(ctx, base_type, dimx, dimy);
1386}
1387
1388static inline bool hlsl_is_numeric_type(const struct hlsl_type *type)
1389{
1390 return type->class <= HLSL_CLASS_LAST_NUMERIC;
1391}
1392
1393static inline unsigned int hlsl_sampler_dim_count(enum hlsl_sampler_dim dim)
1394{
1395 switch (dim)
1396 {
1401 return 1;
1405 return 2;
1410 return 3;
1412 return 4;
1413 default:
1415 }
1416}
1417
1419{
1420 return var->reg_reservation.reg_type == 'c' && var->buffer == ctx->globals_buffer;
1421}
1422
1423char *hlsl_sprintf_alloc(struct hlsl_ctx *ctx, const char *fmt, ...) VKD3D_PRINTF_FUNC(2, 3);
1424
1427const char *debug_hlsl_writemask(unsigned int writemask);
1428const char *debug_hlsl_swizzle(unsigned int swizzle, unsigned int count);
1429
1432 unsigned int index);
1435
1439bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var);
1440
1443
1446
1452 const struct hlsl_state_block_entry *src, const char *name, bool lhs_has_index,
1453 unsigned int lhs_index, bool single_arg, unsigned int arg_index);
1454
1460
1463
1465
1468
1471
1473
1480void hlsl_free_var(struct hlsl_ir_var *decl);
1481
1487struct hlsl_type *hlsl_get_type(struct hlsl_scope *scope, const char *name, bool recursive, bool case_insensitive);
1489
1492
1494
1507 const struct hlsl_constant_value *value, const struct vkd3d_shader_location *loc);
1513 float f, const struct vkd3d_shader_location *loc);
1518 struct hlsl_block *then_block, struct hlsl_block *else_block, const struct vkd3d_shader_location *loc);
1524
1526
1534 const struct hlsl_deref *deref, unsigned int comp, const struct vkd3d_shader_location *loc);
1536 struct hlsl_ir_node *var_instr, unsigned int comp, const struct vkd3d_shader_location *loc);
1537
1540 struct hlsl_ir_node *idx, struct hlsl_ir_node *rhs, unsigned int writemask, const struct vkd3d_shader_location *loc);
1542 const struct hlsl_deref *lhs, unsigned int comp, struct hlsl_ir_node *rhs);
1543
1547
1548struct hlsl_ir_node *hlsl_new_compile(struct hlsl_ctx *ctx, enum hlsl_compile_type compile_type,
1549 const char *profile_name, struct hlsl_ir_node **args, unsigned int args_count,
1554 struct hlsl_block *block, enum hlsl_ir_loop_unroll_type unroll_type, unsigned int unroll_limit, const struct vkd3d_shader_location *loc);
1572 struct hlsl_type *type, const struct vkd3d_shader_location *loc, bool dummy_scope);
1574 unsigned int sample_count);
1585 const struct hlsl_reg_reservation *reg_reservation);
1586struct hlsl_ir_switch_case *hlsl_new_switch_case(struct hlsl_ctx *ctx, unsigned int value, bool is_default,
1590
1593
1597 const char *fmt, ...) VKD3D_PRINTF_FUNC(3, 4);
1602
1605
1607
1609 unsigned int default_majority, uint32_t modifiers);
1613 unsigned int index);
1615 unsigned int index, enum hlsl_regset *regset);
1622unsigned int hlsl_type_get_sm4_offset(const struct hlsl_type *type, unsigned int offset);
1624
1626
1629
1630uint32_t hlsl_combine_swizzles(uint32_t first, uint32_t second, unsigned int dim);
1631unsigned int hlsl_combine_writemasks(unsigned int first, unsigned int second);
1632uint32_t hlsl_map_swizzle(uint32_t swizzle, unsigned int writemask);
1633uint32_t hlsl_swizzle_from_writemask(unsigned int writemask);
1634
1638 unsigned int *start, unsigned int *count);
1640 enum hlsl_regset regset, unsigned int *index);
1644
1650 struct hlsl_block *block, void *context);
1651
1654
1659
1663
1665 unsigned int storage_modifiers);
1666
1668
1670
1671#endif
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
Definition: list.h:39
size_t const element_size
Definition: debug_heap.cpp:510
#define NULL
Definition: types.h:112
INT32 int32_t
Definition: types.h:71
UINT32 uint32_t
Definition: types.h:75
UINT64 uint64_t
Definition: types.h:77
UINT op
Definition: effect.c:235
unsigned int idx
Definition: utils.c:40
const UINT template
Definition: action.c:7707
static void list_move_tail(struct list_head *list, struct list_head *head)
Definition: list.h:122
return ret
Definition: mutex.c:147
D3DXPARAMETER_CLASS
Definition: d3dx9shader.h:61
D3DXPARAMETER_TYPE
Definition: d3dx9shader.h:72
GLuint start
Definition: gl.h:1545
GLint level
Definition: gl.h:1546
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLenum func
Definition: glext.h:6028
GLdouble n
Definition: glext.h:7729
GLenum src
Definition: glext.h:6340
GLuint GLenum swizzle
Definition: glext.h:9511
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum GLuint components
Definition: glext.h:9620
GLintptr offset
Definition: glext.h:5920
GLenum condition
Definition: glext.h:9255
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
const GLubyte * c
Definition: glext.h:8905
GLuint sampler
Definition: glext.h:7283
GLuint coords
Definition: glext.h:7368
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
GLuint index
Definition: glext.h:6031
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLint lod
Definition: glext.h:7795
GLuint program
Definition: glext.h:6723
GLfloat f
Definition: glext.h:7540
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint GLenum matrix
Definition: glext.h:9407
GLenum const GLfloat * params
Definition: glext.h:5645
GLenum GLenum dst
Definition: glext.h:6340
const GLint * first
Definition: glext.h:5794
GLuint GLfloat * val
Definition: glext.h:7180
const GLuint * buffers
Definition: glext.h:5916
enum wined3d_data_type data_type
Definition: glsl_shader.c:71
unsigned int hlsl_type_get_array_element_reg_size(const struct hlsl_type *type, enum hlsl_regset regset)
Definition: hlsl.c:444
static void * hlsl_realloc(struct hlsl_ctx *ctx, void *ptr, size_t size)
Definition: hlsl.h:1318
static void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node)
Definition: hlsl.h:1286
static bool hlsl_array_reserve(struct hlsl_ctx *ctx, void **elements, size_t *capacity, size_t element_count, size_t element_size)
Definition: hlsl.h:1336
struct hlsl_ir_var * hlsl_get_var(struct hlsl_scope *scope, const char *name)
Definition: hlsl.c:123
void hlsl_lower_index_loads(struct hlsl_ctx *ctx, struct hlsl_block *body)
bool hlsl_scope_add_type(struct hlsl_scope *scope, struct hlsl_type *type)
Definition: hlsl.c:1285
void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer)
Definition: d3dbc.c:1752
void void hlsl_fixme(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, const char *fmt,...) VKD3D_PRINTF_FUNC(3
hlsl_type_class
Definition: hlsl.h:82
@ HLSL_CLASS_COMPUTE_SHADER
Definition: hlsl.h:102
@ HLSL_CLASS_RASTERIZER_STATE
Definition: hlsl.h:94
@ HLSL_CLASS_RENDER_TARGET_VIEW
Definition: hlsl.h:95
@ HLSL_CLASS_VERTEX_SHADER
Definition: hlsl.h:101
@ HLSL_CLASS_MATRIX
Definition: hlsl.h:85
@ HLSL_CLASS_GEOMETRY_SHADER
Definition: hlsl.h:105
@ HLSL_CLASS_TECHNIQUE
Definition: hlsl.h:98
@ HLSL_CLASS_SAMPLER
Definition: hlsl.h:96
@ HLSL_CLASS_UAV
Definition: hlsl.h:100
@ HLSL_CLASS_VECTOR
Definition: hlsl.h:84
@ HLSL_CLASS_TEXTURE
Definition: hlsl.h:99
@ HLSL_CLASS_DEPTH_STENCIL_VIEW
Definition: hlsl.h:90
@ HLSL_CLASS_STRUCT
Definition: hlsl.h:87
@ HLSL_CLASS_LAST_NUMERIC
Definition: hlsl.h:86
@ HLSL_CLASS_CONSTANT_BUFFER
Definition: hlsl.h:106
@ HLSL_CLASS_VOID
Definition: hlsl.h:108
@ HLSL_CLASS_SCALAR
Definition: hlsl.h:83
@ HLSL_CLASS_EFFECT_GROUP
Definition: hlsl.h:91
@ HLSL_CLASS_PIXEL_SHADER
Definition: hlsl.h:93
@ HLSL_CLASS_BLEND_STATE
Definition: hlsl.h:107
@ HLSL_CLASS_STRING
Definition: hlsl.h:97
@ HLSL_CLASS_HULL_SHADER
Definition: hlsl.h:104
@ HLSL_CLASS_DOMAIN_SHADER
Definition: hlsl.h:103
@ HLSL_CLASS_NULL
Definition: hlsl.h:109
@ HLSL_CLASS_ARRAY
Definition: hlsl.h:88
@ HLSL_CLASS_DEPTH_STENCIL_STATE
Definition: hlsl.h:89
@ HLSL_CLASS_PASS
Definition: hlsl.h:92
@ HLSL_CLASS_ERROR
Definition: hlsl.h:110
static char * hlsl_strdup(struct hlsl_ctx *ctx, const char *string)
Definition: hlsl.h:1327
hlsl_ir_loop_unroll_type
Definition: hlsl.h:648
@ HLSL_IR_LOOP_UNROLL
Definition: hlsl.h:649
@ HLSL_IR_LOOP_FORCE_UNROLL
Definition: hlsl.h:650
@ HLSL_IR_LOOP_FORCE_LOOP
Definition: hlsl.h:651
bool hlsl_clone_block(struct hlsl_ctx *ctx, struct hlsl_block *dst_block, const struct hlsl_block *src_block)
Definition: hlsl.c:2544
struct vkd3d_string_buffer * hlsl_type_to_string(struct hlsl_ctx *ctx, const struct hlsl_type *type)
Definition: hlsl.c:2696
static struct hlsl_type * hlsl_get_vector_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type, unsigned int dimx)
Definition: hlsl.h:1365
bool hlsl_component_index_range_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref, unsigned int *start, unsigned int *count)
void hlsl_dump_var_default_values(const struct hlsl_ir_var *var)
Definition: hlsl.c:3593
void hlsl_dump_function(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl *func)
Definition: hlsl.c:3573
bool hlsl_types_are_equal(const struct hlsl_type *t1, const struct hlsl_type *t2)
Definition: hlsl.c:1095
static void * hlsl_calloc(struct hlsl_ctx *ctx, size_t count, size_t size)
Definition: hlsl.h:1309
char * hlsl_sprintf_alloc(struct hlsl_ctx *ctx, const char *fmt,...) VKD3D_PRINTF_FUNC(2
struct hlsl_ir_node * hlsl_new_float_constant(struct hlsl_ctx *ctx, float f, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1545
bool hlsl_copy_deref(struct hlsl_ctx *ctx, struct hlsl_deref *deref, const struct hlsl_deref *other)
Definition: hlsl.c:1388
unsigned int hlsl_type_get_sm4_offset(const struct hlsl_type *type, unsigned int offset)
Definition: hlsl.c:332
struct hlsl_ir_node * hlsl_new_sampler_state(struct hlsl_ctx *ctx, const struct hlsl_state_block *state_block, struct vkd3d_shader_location *loc)
Definition: hlsl.c:1937
hlsl_regset
Definition: hlsl.h:146
@ HLSL_REGSET_NUMERIC
Definition: hlsl.h:151
@ HLSL_REGSET_LAST
Definition: hlsl.h:152
@ HLSL_REGSET_UAVS
Definition: hlsl.h:149
@ HLSL_REGSET_TEXTURES
Definition: hlsl.h:148
@ HLSL_REGSET_SAMPLERS
Definition: hlsl.h:147
@ HLSL_REGSET_LAST_OBJECT
Definition: hlsl.h:150
static void hlsl_block_init(struct hlsl_block *block)
Definition: hlsl.h:1268
hlsl_buffer_type
Definition: hlsl.h:984
@ HLSL_BUFFER_CONSTANT
Definition: hlsl.h:985
@ HLSL_BUFFER_TEXTURE
Definition: hlsl.h:986
bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var)
Definition: hlsl.c:96
hlsl_ir_node_type
Definition: hlsl.h:314
@ HLSL_IR_LOOP
Definition: hlsl.h:321
@ HLSL_IR_SWIZZLE
Definition: hlsl.h:327
@ HLSL_IR_IF
Definition: hlsl.h:318
@ HLSL_IR_STATEBLOCK_CONSTANT
Definition: hlsl.h:332
@ HLSL_IR_INDEX
Definition: hlsl.h:319
@ HLSL_IR_CALL
Definition: hlsl.h:315
@ HLSL_IR_LOAD
Definition: hlsl.h:320
@ HLSL_IR_CONSTANT
Definition: hlsl.h:316
@ HLSL_IR_VSIR_INSTRUCTION_REF
Definition: hlsl.h:334
@ HLSL_IR_COMPILE
Definition: hlsl.h:330
@ HLSL_IR_RESOURCE_LOAD
Definition: hlsl.h:323
@ HLSL_IR_SAMPLER_STATE
Definition: hlsl.h:331
@ HLSL_IR_SWITCH
Definition: hlsl.h:328
@ HLSL_IR_RESOURCE_STORE
Definition: hlsl.h:324
@ HLSL_IR_STORE
Definition: hlsl.h:326
@ HLSL_IR_EXPR
Definition: hlsl.h:317
@ HLSL_IR_JUMP
Definition: hlsl.h:322
@ HLSL_IR_STRING_CONSTANT
Definition: hlsl.h:325
struct hlsl_ir_function_decl * hlsl_get_first_func_decl(struct hlsl_ctx *ctx, const char *name)
Definition: hlsl.c:1028
bool hlsl_type_is_resource(const struct hlsl_type *type)
Definition: hlsl.c:240
struct hlsl_type * hlsl_new_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim, struct hlsl_type *format, bool rasteriser_ordered)
Definition: hlsl.c:938
void hlsl_block_cleanup(struct hlsl_block *block)
Definition: hlsl.c:3675
bool hlsl_index_chain_has_resource_access(struct hlsl_ir_index *index)
Definition: hlsl.c:2013
const char * hlsl_jump_type_to_string(enum hlsl_ir_jump_type type)
Definition: hlsl.c:2979
struct hlsl_ir_var * hlsl_new_synthetic_var(struct hlsl_ctx *ctx, const char *template, struct hlsl_type *type, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1349
void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function_decl *decl)
Definition: hlsl.c:3946
static unsigned int hlsl_sampler_dim_count(enum hlsl_sampler_dim dim)
Definition: hlsl.h:1393
hlsl_base_type
Definition: hlsl.h:114
@ HLSL_TYPE_HALF
Definition: hlsl.h:116
@ HLSL_TYPE_BOOL
Definition: hlsl.h:120
@ HLSL_TYPE_UINT
Definition: hlsl.h:119
@ HLSL_TYPE_LAST_SCALAR
Definition: hlsl.h:121
@ HLSL_TYPE_INT
Definition: hlsl.h:118
@ HLSL_TYPE_FLOAT
Definition: hlsl.h:115
@ HLSL_TYPE_DOUBLE
Definition: hlsl.h:117
struct hlsl_ir_node * hlsl_new_stateblock_constant(struct hlsl_ctx *ctx, const char *name, struct vkd3d_shader_location *loc)
Definition: hlsl.c:1978
void void void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_error error, const char *fmt,...) VKD3D_PRINTF_FUNC(4
struct hlsl_ir_node * hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *block, enum hlsl_ir_loop_unroll_type unroll_type, unsigned int unroll_limit, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:2057
struct hlsl_ir_node * hlsl_new_constant(struct hlsl_ctx *ctx, struct hlsl_type *type, const struct hlsl_constant_value *value, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1521
void hlsl_pop_scope(struct hlsl_ctx *ctx)
Definition: hlsl.c:2653
void hlsl_free_var(struct hlsl_ir_var *decl)
Definition: hlsl.c:161
unsigned int hlsl_type_component_count(const struct hlsl_type *type)
Definition: hlsl.c:1042
struct hlsl_type * hlsl_get_type(struct hlsl_scope *scope, const char *name, bool recursive, bool case_insensitive)
Definition: hlsl.c:995
bool hlsl_regset_index_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref, enum hlsl_regset regset, unsigned int *index)
bool hlsl_type_is_row_major(const struct hlsl_type *type)
Definition: hlsl.c:186
static struct vkd3d_string_buffer * hlsl_get_string_buffer(struct hlsl_ctx *ctx)
Definition: hlsl.h:1346
struct hlsl_ir_var * hlsl_new_synthetic_var_named(struct hlsl_ctx *ctx, const char *name, struct hlsl_type *type, const struct vkd3d_shader_location *loc, bool dummy_scope)
Definition: hlsl.c:1363
void hlsl_free_state_block_entry(struct hlsl_state_block_entry *state_block_entry)
Definition: hlsl.c:137
void hlsl_free_ir_switch_case(struct hlsl_ir_switch_case *c)
Definition: hlsl.c:2429
struct hlsl_ir_node * hlsl_new_switch(struct hlsl_ctx *ctx, struct hlsl_ir_node *selector, struct list *cases, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1682
void hlsl_init_simple_deref_from_var(struct hlsl_deref *deref, struct hlsl_ir_var *var)
Definition: hlsl.c:1424
bool hlsl_index_is_noncontiguous(struct hlsl_ir_index *index)
Definition: hlsl.c:1999
static struct hlsl_type * hlsl_get_scalar_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type)
Definition: hlsl.h:1360
struct hlsl_ir_node * hlsl_new_store_index(struct hlsl_ctx *ctx, const struct hlsl_deref *lhs, struct hlsl_ir_node *idx, struct hlsl_ir_node *rhs, unsigned int writemask, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1448
struct hlsl_ir_node * hlsl_new_int_constant(struct hlsl_ctx *ctx, int32_t n, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1554
bool hlsl_clone_semantic(struct hlsl_ctx *ctx, struct hlsl_semantic *dst, const struct hlsl_semantic *src)
Definition: hlsl.c:3903
struct hlsl_ir_node * hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_block *block, struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false)
bool hlsl_offset_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref, unsigned int *offset)
struct hlsl_ir_node * hlsl_new_cast(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, struct hlsl_type *type, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1294
bool hlsl_index_is_resource_access(struct hlsl_ir_index *index)
Definition: hlsl.c:2006
const char * debug_hlsl_type(struct hlsl_ctx *ctx, const struct hlsl_type *type)
Definition: hlsl.c:2889
struct hlsl_type * hlsl_new_cb_type(struct hlsl_ctx *ctx, struct hlsl_type *format)
Definition: hlsl.c:956
bool hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct hlsl_deref *lhs, unsigned int comp, struct hlsl_ir_node *rhs)
Definition: hlsl.c:1480
void hlsl_free_instr_list(struct list *list)
Definition: hlsl.c:3663
struct hlsl_ir_function_decl * hlsl_get_func_decl(struct hlsl_ctx *ctx, const char *name, const struct hlsl_func_parameters *parameters)
Definition: hlsl.c:2678
bool hlsl_validate_state_block_entry(struct hlsl_ctx *ctx, struct hlsl_state_block_entry *entry, const struct vkd3d_shader_location *loc)
Definition: fx.c:145
uint32_t hlsl_map_swizzle(uint32_t swizzle, unsigned int writemask)
Definition: hlsl.c:3978
void hlsl_calculate_buffer_offsets(struct hlsl_ctx *ctx)
bool hlsl_copy_propagation_execute(struct hlsl_ctx *ctx, struct hlsl_block *block)
struct hlsl_ir_node * hlsl_new_swizzle(struct hlsl_ctx *ctx, uint32_t s, unsigned int components, struct hlsl_ir_node *val, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1847
#define HLSL_SWIZZLE_SHIFT(idx)
Definition: hlsl.h:66
static struct hlsl_type * hlsl_get_numeric_type(const struct hlsl_ctx *ctx, enum hlsl_type_class type, enum hlsl_base_type base_type, unsigned int dimx, unsigned int dimy)
Definition: hlsl.h:1377
static void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir_node *instr)
Definition: hlsl.h:1274
void void void void void hlsl_push_scope(struct hlsl_ctx *ctx)
Definition: hlsl.c:2642
struct hlsl_ir_node * hlsl_new_unary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1611
enum vkd3d_shader_interpolation_mode sm4_get_interpolation_mode(struct hlsl_type *type, unsigned int storage_modifiers)
bool hlsl_fold_constant_swizzles(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
void hlsl_cleanup_deref(struct hlsl_deref *deref)
Definition: hlsl.c:1408
static bool hlsl_var_has_buffer_offset_register_reservation(struct hlsl_ctx *ctx, const struct hlsl_ir_var *var)
Definition: hlsl.h:1418
void hlsl_cleanup_semantic(struct hlsl_semantic *semantic)
Definition: hlsl.c:3896
struct hlsl_ir_load * hlsl_new_var_load(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1757
hlsl_resource_load_type
Definition: hlsl.h:834
@ HLSL_RESOURCE_SAMPLE
Definition: hlsl.h:836
@ HLSL_RESOURCE_GATHER_BLUE
Definition: hlsl.h:845
@ HLSL_RESOURCE_SAMPLE_GRAD
Definition: hlsl.h:841
@ HLSL_RESOURCE_SAMPLE_CMP
Definition: hlsl.h:837
@ HLSL_RESOURCE_SAMPLE_CMP_LZ
Definition: hlsl.h:838
@ HLSL_RESOURCE_RESINFO
Definition: hlsl.h:848
@ HLSL_RESOURCE_SAMPLE_LOD_BIAS
Definition: hlsl.h:840
@ HLSL_RESOURCE_SAMPLE_PROJ
Definition: hlsl.h:842
@ HLSL_RESOURCE_SAMPLE_INFO
Definition: hlsl.h:847
@ HLSL_RESOURCE_GATHER_GREEN
Definition: hlsl.h:844
@ HLSL_RESOURCE_GATHER_RED
Definition: hlsl.h:843
@ HLSL_RESOURCE_SAMPLE_LOD
Definition: hlsl.h:839
@ HLSL_RESOURCE_LOAD
Definition: hlsl.h:835
@ HLSL_RESOURCE_GATHER_ALPHA
Definition: hlsl.h:846
int tpf_compile(struct vsir_program *program, uint64_t config_flags, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context, struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func)
Definition: tpf.c:6046
struct hlsl_type * hlsl_new_struct_type(struct hlsl_ctx *ctx, const char *name, struct hlsl_struct_field *fields, size_t field_count)
Definition: hlsl.c:901
void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_error error, const char *fmt,...) VKD3D_PRINTF_FUNC(4
struct hlsl_buffer * hlsl_new_buffer(struct hlsl_ctx *ctx, enum hlsl_buffer_type type, const char *name, uint32_t modifiers, const struct hlsl_reg_reservation *reservation, struct hlsl_scope *annotations, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:2594
bool hlsl_transform_ir(struct hlsl_ctx *ctx, bool(*func)(struct hlsl_ctx *ctx, struct hlsl_ir_node *, void *), struct hlsl_block *block, void *context)
Definition: hlsl_codegen.c:642
struct vkd3d_string_buffer * hlsl_modifiers_to_string(struct hlsl_ctx *ctx, unsigned int modifiers)
struct hlsl_ir_node * hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct hlsl_deref *deref, unsigned int comp, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1766
struct hlsl_ir_node * hlsl_new_compile(struct hlsl_ctx *ctx, enum hlsl_compile_type compile_type, const char *profile_name, struct hlsl_ir_node **args, unsigned int args_count, struct hlsl_block *args_instrs, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1866
unsigned int hlsl_type_element_count(const struct hlsl_type *type)
Definition: hlsl.c:209
uint32_t hlsl_swizzle_from_writemask(unsigned int writemask)
Definition: hlsl.c:4001
struct hlsl_ir_node * hlsl_new_null_constant(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1589
struct hlsl_type * hlsl_type_clone(struct hlsl_ctx *ctx, struct hlsl_type *old, unsigned int default_majority, uint32_t modifiers)
Definition: hlsl.c:1183
unsigned int hlsl_type_get_component_offset(struct hlsl_ctx *ctx, struct hlsl_type *type, unsigned int index, enum hlsl_regset *regset)
Definition: hlsl.c:620
struct hlsl_reg hlsl_reg_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
struct hlsl_ir_node * hlsl_new_copy(struct hlsl_ctx *ctx, struct hlsl_ir_node *node)
Definition: hlsl.c:1305
struct hlsl_type * hlsl_type_get_component_type(struct hlsl_ctx *ctx, struct hlsl_type *type, unsigned int index)
Definition: hlsl.c:611
struct hlsl_ir_node * hlsl_new_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS], struct hlsl_type *data_type, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1595
uint32_t hlsl_combine_swizzles(uint32_t first, uint32_t second, unsigned int dim)
Definition: hlsl.c:4042
const struct hlsl_type * hlsl_get_multiarray_element_type(const struct hlsl_type *type)
Definition: hlsl.c:226
static void * hlsl_alloc(struct hlsl_ctx *ctx, size_t size)
Definition: hlsl.h:1300
static bool hlsl_is_numeric_type(const struct hlsl_type *type)
Definition: hlsl.h:1388
static void hlsl_block_add_block(struct hlsl_block *block, struct hlsl_block *add)
Definition: hlsl.h:1280
char const char * debug_hlsl_expr_op(enum hlsl_ir_expr_op op)
Definition: hlsl.c:3176
unsigned int hlsl_get_multiarray_size(const struct hlsl_type *type)
Definition: hlsl.c:233
static bool hlsl_version_ge(const struct hlsl_ctx *ctx, unsigned int major, unsigned int minor)
Definition: hlsl.h:1141
bool hlsl_type_is_shader(const struct hlsl_type *type)
Definition: hlsl.c:257
void void void void hlsl_note(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_log_level level, const char *fmt,...) VKD3D_PRINTF_FUNC(4
struct hlsl_ir_node * hlsl_new_ternary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2, struct hlsl_ir_node *arg3)
Definition: hlsl.c:1627
bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
struct hlsl_ir_node * hlsl_new_uint_constant(struct hlsl_ctx *ctx, unsigned int n, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1562
struct vkd3d_string_buffer * hlsl_component_to_string(struct hlsl_ctx *ctx, const struct hlsl_ir_var *var, unsigned int index)
Definition: hlsl.c:2864
D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type)
Definition: d3dbc.c:1575
struct hlsl_ir_node * hlsl_add_load_component(struct hlsl_ctx *ctx, struct hlsl_block *block, struct hlsl_ir_node *var_instr, unsigned int comp, const struct vkd3d_shader_location *loc)
hlsl_sampler_dim
Definition: hlsl.h:125
@ HLSL_SAMPLER_DIM_GENERIC
Definition: hlsl.h:126
@ HLSL_SAMPLER_DIM_1DARRAY
Definition: hlsl.h:133
@ HLSL_SAMPLER_DIM_CUBEARRAY
Definition: hlsl.h:137
@ HLSL_SAMPLER_DIM_2DMSARRAY
Definition: hlsl.h:136
@ HLSL_SAMPLER_DIM_BUFFER
Definition: hlsl.h:138
@ HLSL_SAMPLER_DIM_2DMS
Definition: hlsl.h:135
@ HLSL_SAMPLER_DIM_MAX
Definition: hlsl.h:141
@ HLSL_SAMPLER_DIM_LAST_SAMPLER
Definition: hlsl.h:132
@ HLSL_SAMPLER_DIM_2DARRAY
Definition: hlsl.h:134
@ HLSL_SAMPLER_DIM_CUBE
Definition: hlsl.h:131
@ HLSL_SAMPLER_DIM_3D
Definition: hlsl.h:130
@ HLSL_SAMPLER_DIM_2D
Definition: hlsl.h:129
@ HLSL_SAMPLER_DIM_RAW_BUFFER
Definition: hlsl.h:140
@ HLSL_SAMPLER_DIM_COMPARISON
Definition: hlsl.h:127
@ HLSL_SAMPLER_DIM_STRUCTURED_BUFFER
Definition: hlsl.h:139
@ HLSL_SAMPLER_DIM_1D
Definition: hlsl.h:128
const char * debug_hlsl_swizzle(unsigned int swizzle, unsigned int count)
struct hlsl_type * hlsl_get_element_type_from_path_index(struct hlsl_ctx *ctx, const struct hlsl_type *type, struct hlsl_ir_node *idx)
Definition: hlsl.c:848
struct hlsl_ir_node * hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *val, struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:2022
struct hlsl_type * hlsl_deref_get_type(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
Definition: hlsl.c:783
void hlsl_replace_node(struct hlsl_ir_node *old, struct hlsl_ir_node *new)
Definition: hlsl.c:3626
struct hlsl_ir_node * hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1833
const char * debug_hlsl_writemask(unsigned int writemask)
Definition: hlsl.c:3074
int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func, enum vkd3d_shader_target_type target_type, struct vkd3d_shader_code *out)
int hlsl_lexer_compile(struct hlsl_ctx *ctx, const struct vkd3d_shader_code *hlsl)
unsigned int hlsl_type_major_size(const struct hlsl_type *type)
Definition: hlsl.c:201
struct hlsl_ir_node * hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1794
const char * hlsl_node_type_to_string(enum hlsl_ir_node_type type)
Definition: hlsl.c:2949
unsigned int hlsl_offset_from_deref_safe(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
static bool hlsl_deref_is_lowered(const struct hlsl_deref *deref)
Definition: hlsl.h:822
unsigned int hlsl_combine_writemasks(unsigned int first, unsigned int second)
Definition: hlsl.c:4026
struct hlsl_ir_function_decl * hlsl_new_func_decl(struct hlsl_ctx *ctx, struct hlsl_type *return_type, const struct hlsl_func_parameters *parameters, const struct hlsl_semantic *semantic, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:2554
struct hlsl_type * hlsl_new_texture_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim, struct hlsl_type *format, unsigned int sample_count)
Definition: hlsl.c:920
static void hlsl_src_remove(struct hlsl_src *src)
Definition: hlsl.h:1293
struct hlsl_type * hlsl_new_array_type(struct hlsl_ctx *ctx, struct hlsl_type *basic_type, unsigned int array_size)
Definition: hlsl.c:880
const struct hlsl_profile_info * hlsl_get_target_info(const char *target)
Definition: hlsl.c:4054
struct hlsl_ir_node * hlsl_new_binary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2)
Definition: hlsl.c:1619
struct hlsl_ir_switch_case * hlsl_new_switch_case(struct hlsl_ctx *ctx, unsigned int value, bool is_default, struct hlsl_block *body, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1664
void hlsl_free_state_block(struct hlsl_state_block *state_block)
Definition: hlsl.c:150
struct hlsl_ir_load * hlsl_new_load_index(struct hlsl_ctx *ctx, const struct hlsl_deref *deref, struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1714
#define HLSL_MAX_OPERANDS
Definition: hlsl.h:750
bool hlsl_state_block_add_entry(struct hlsl_state_block *state_block, struct hlsl_state_block_entry *entry)
Definition: hlsl.c:1925
struct hlsl_ir_node * hlsl_new_call(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *decl, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1508
static bool hlsl_version_lt(const struct hlsl_ctx *ctx, unsigned int major, unsigned int minor)
Definition: hlsl.h:1146
hlsl_ir_expr_op
Definition: hlsl.h:681
@ HLSL_OP2_LESS
Definition: hlsl.h:727
@ HLSL_OP1_DSY
Definition: hlsl.h:695
@ HLSL_OP2_LOGIC_AND
Definition: hlsl.h:728
@ HLSL_OP2_LOGIC_OR
Definition: hlsl.h:729
@ HLSL_OP1_NEG
Definition: hlsl.h:705
@ HLSL_OP1_F32TOF16
Definition: hlsl.h:700
@ HLSL_OP2_DIV
Definition: hlsl.h:723
@ HLSL_OP1_NRM
Definition: hlsl.h:706
@ HLSL_OP1_DSY_COARSE
Definition: hlsl.h:696
@ HLSL_OP1_DSY_FINE
Definition: hlsl.h:697
@ HLSL_OP2_LSHIFT
Definition: hlsl.h:730
@ HLSL_OP2_ADD
Definition: hlsl.h:718
@ HLSL_OP1_SAT
Definition: hlsl.h:711
@ HLSL_OP1_F16TOF32
Definition: hlsl.h:699
@ HLSL_OP2_NEQUAL
Definition: hlsl.h:735
@ HLSL_OP1_DSX_FINE
Definition: hlsl.h:694
@ HLSL_OP1_COS_REDUCED
Definition: hlsl.h:691
@ HLSL_OP2_MIN
Definition: hlsl.h:732
@ HLSL_OP1_BIT_NOT
Definition: hlsl.h:687
@ HLSL_OP1_ABS
Definition: hlsl.h:686
@ HLSL_OP1_CEIL
Definition: hlsl.h:689
@ HLSL_OP2_MAX
Definition: hlsl.h:731
@ HLSL_OP1_TRUNC
Definition: hlsl.h:716
@ HLSL_OP1_FRACT
Definition: hlsl.h:702
@ HLSL_OP2_BIT_XOR
Definition: hlsl.h:721
@ HLSL_OP0_RASTERIZER_SAMPLE_COUNT
Definition: hlsl.h:684
@ HLSL_OP2_BIT_AND
Definition: hlsl.h:719
@ HLSL_OP2_MOD
Definition: hlsl.h:733
@ HLSL_OP3_MAD
Definition: hlsl.h:747
@ HLSL_OP2_RSHIFT
Definition: hlsl.h:736
@ HLSL_OP1_FLOOR
Definition: hlsl.h:701
@ HLSL_OP0_ERROR
Definition: hlsl.h:682
@ HLSL_OP1_COS
Definition: hlsl.h:690
@ HLSL_OP2_MUL
Definition: hlsl.h:734
@ HLSL_OP2_GEQUAL
Definition: hlsl.h:726
@ HLSL_OP2_SLT
Definition: hlsl.h:738
@ HLSL_OP2_EQUAL
Definition: hlsl.h:725
@ HLSL_OP1_ROUND
Definition: hlsl.h:709
@ HLSL_OP1_RCP
Definition: hlsl.h:707
@ HLSL_OP1_DSX
Definition: hlsl.h:692
@ HLSL_OP3_TERNARY
Definition: hlsl.h:746
@ HLSL_OP1_LOG2
Definition: hlsl.h:703
@ HLSL_OP1_EXP2
Definition: hlsl.h:698
@ HLSL_OP0_VOID
Definition: hlsl.h:683
@ HLSL_OP3_DP2ADD
Definition: hlsl.h:742
@ HLSL_OP2_CRS
Definition: hlsl.h:722
@ HLSL_OP3_CMP
Definition: hlsl.h:745
@ HLSL_OP1_LOGIC_NOT
Definition: hlsl.h:704
@ HLSL_OP1_RSQ
Definition: hlsl.h:710
@ HLSL_OP1_DSX_COARSE
Definition: hlsl.h:693
@ HLSL_OP1_SQRT
Definition: hlsl.h:715
@ HLSL_OP2_DOT
Definition: hlsl.h:724
@ HLSL_OP1_SIN
Definition: hlsl.h:713
@ HLSL_OP1_SIGN
Definition: hlsl.h:712
@ HLSL_OP2_BIT_OR
Definition: hlsl.h:720
@ HLSL_OP1_CAST
Definition: hlsl.h:688
@ HLSL_OP1_SIN_REDUCED
Definition: hlsl.h:714
@ HLSL_OP1_REINTERPRET
Definition: hlsl.h:708
static uint32_t vsir_swizzle_from_hlsl(uint32_t swizzle)
Definition: hlsl.h:73
bool hlsl_init_deref_from_index_chain(struct hlsl_ctx *ctx, struct hlsl_deref *deref, struct hlsl_ir_node *chain)
Definition: hlsl.c:717
unsigned int hlsl_type_minor_size(const struct hlsl_type *type)
Definition: hlsl.c:193
struct hlsl_ir_var * hlsl_new_var(struct hlsl_ctx *ctx, const char *name, struct hlsl_type *type, const struct vkd3d_shader_location *loc, const struct hlsl_semantic *semantic, uint32_t modifiers, const struct hlsl_reg_reservation *reg_reservation)
Definition: hlsl.c:1311
void hlsl_free_type(struct hlsl_type *type)
Definition: hlsl.c:3643
void hlsl_free_attribute(struct hlsl_attribute *attr)
Definition: hlsl.c:3885
int d3dbc_compile(struct vsir_program *program, uint64_t config_flags, const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_code *ctab, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context)
Definition: d3dbc.c:2359
struct hlsl_ir_node * hlsl_new_vsir_instruction_ref(struct hlsl_ctx *ctx, unsigned int vsir_instr_idx, struct hlsl_type *type, const struct hlsl_reg *reg, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1698
static unsigned int hlsl_swizzle_get_component(uint32_t swizzle, unsigned int idx)
Definition: hlsl.h:68
D3DXPARAMETER_CLASS hlsl_sm1_class(const struct hlsl_type *type)
Definition: d3dbc.c:1528
hlsl_ir_jump_type
Definition: hlsl.h:760
@ HLSL_IR_JUMP_DISCARD_NZ
Definition: hlsl.h:764
@ HLSL_IR_JUMP_UNRESOLVED_CONTINUE
Definition: hlsl.h:769
@ HLSL_IR_JUMP_RETURN
Definition: hlsl.h:765
@ HLSL_IR_JUMP_CONTINUE
Definition: hlsl.h:762
@ HLSL_IR_JUMP_DISCARD_NEG
Definition: hlsl.h:763
@ HLSL_IR_JUMP_BREAK
Definition: hlsl.h:761
static void hlsl_release_string_buffer(struct hlsl_ctx *ctx, struct vkd3d_string_buffer *buffer)
Definition: hlsl.h:1355
enum hlsl_regset hlsl_deref_get_regset(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
Definition: hlsl.c:327
struct hlsl_ir_function * hlsl_get_function(struct hlsl_ctx *ctx, const char *name)
Definition: hlsl.c:1019
struct hlsl_ir_node * hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type type, struct hlsl_ir_node *condition, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:2044
int hlsl_emit_effect_binary(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
Definition: fx.c:2865
void hlsl_run_const_passes(struct hlsl_ctx *ctx, struct hlsl_block *body)
void hlsl_free_instr(struct hlsl_ir_node *node)
Definition: hlsl.c:3805
#define HLSL_SWIZZLE_MASK
Definition: hlsl.h:65
struct hlsl_ir_function_decl * hlsl_compile_internal_function(struct hlsl_ctx *ctx, const char *name, const char *hlsl)
Definition: hlsl.c:4642
struct hlsl_ir_node * hlsl_new_if(struct hlsl_ctx *ctx, struct hlsl_ir_node *condition, struct hlsl_block *then_block, struct hlsl_block *else_block, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1647
static struct hlsl_type * hlsl_get_matrix_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type, unsigned int dimx, unsigned int dimy)
Definition: hlsl.h:1371
struct hlsl_ir_node * hlsl_new_string_constant(struct hlsl_ctx *ctx, const char *str, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1571
bool hlsl_fold_constant_identities(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
void hlsl_cleanup_ir_switch_cases(struct list *cases)
Definition: hlsl.c:2436
struct hlsl_state_block_entry * clone_stateblock_entry(struct hlsl_ctx *ctx, const struct hlsl_state_block_entry *src, const char *name, bool lhs_has_index, unsigned int lhs_index, bool single_arg, unsigned int arg_index)
Definition: hlsl.c:2379
struct hlsl_ir_node * hlsl_new_bool_constant(struct hlsl_ctx *ctx, bool b, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1537
struct hlsl_ir_node * hlsl_new_simple_store(struct hlsl_ctx *ctx, struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs)
Definition: hlsl.c:1440
struct hlsl_ir_load * hlsl_new_load_parent(struct hlsl_ctx *ctx, const struct hlsl_deref *deref, const struct vkd3d_shader_location *loc)
Definition: hlsl.c:1744
static int reg
Definition: i386-dis.c:1290
uint32_t entry
Definition: isohybrid.c:63
#define error(str)
Definition: mkdosfs.c:1605
static PVOID ptr
Definition: dispmode.c:27
const char * var
Definition: shader.c:5879
D3DXREGISTER_SET regset
Definition: shader.c:5881
#define cmp(status, error)
Definition: error.c:118
static ULONG ** element_count
Definition: exception.c:124
const char * fields[10]
Definition: parser.c:313
static const char * target_type(DWORD dwType)
Definition: mixer.c:95
static BYTE parameters[]
Definition: asn.c:558
int other
Definition: msacm.c:1376
static UINT array_size
Definition: msctf.cpp:39
const WCHAR * str
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
Definition: match.c:390
Definition: cookie.c:202
Definition: http.c:7252
Definition: dsound.c:943
struct vkd3d_shader_location loc
Definition: hlsl.h:392
struct hlsl_block instrs
Definition: hlsl.h:391
unsigned int args_count
Definition: hlsl.h:393
const char * name
Definition: hlsl.h:390
struct hlsl_ir_node * value
Definition: hlsl.h:372
struct list instrs
Definition: hlsl.h:369
struct hlsl_reg_reservation reservation
Definition: hlsl.h:1001
uint32_t modifiers
Definition: hlsl.h:997
enum hlsl_buffer_type type
Definition: hlsl.h:995
bool manually_packed_elements
Definition: hlsl.h:1013
unsigned size
Definition: hlsl.h:1009
struct hlsl_reg reg
Definition: hlsl.h:1011
bool automatically_packed_elements
Definition: hlsl.h:1014
struct list entry
Definition: hlsl.h:1005
unsigned used_size
Definition: hlsl.h:1009
struct vkd3d_shader_location loc
Definition: hlsl.h:994
const char * name
Definition: hlsl.h:996
struct hlsl_scope * annotations
Definition: hlsl.h:1003
struct hlsl_ctx::hlsl_constant_defs::hlsl_constant_register * regs
void * scanner
Definition: hlsl.h:1040
struct hlsl_scope * globals
Definition: hlsl.h:1045
uint32_t in_state_block
Definition: hlsl.h:1130
struct hlsl_ir_node * error_instr
Definition: hlsl.h:1093
struct hlsl_type * scalar[HLSL_TYPE_LAST_SCALAR+1]
Definition: hlsl.h:1081
unsigned int source_files_count
Definition: hlsl.h:1022
struct hlsl_scope * dummy_scope
Definition: hlsl.h:1047
struct hlsl_reg d3dsincosconst1 d3dsincosconst2
Definition: hlsl.h:1111
struct hlsl_ir_function_decl * patch_constant_func
Definition: hlsl.h:1121
enum vkd3d_shader_tessellator_output_primitive output_primitive
Definition: hlsl.h:1119
bool double_as_float_alias
Definition: hlsl.h:1138
int result
Definition: hlsl.h:1035
struct hlsl_type * string
Definition: hlsl.h:1086
struct list extern_vars
Definition: hlsl.h:1055
enum vkd3d_tessellator_domain domain
Definition: hlsl.h:1117
const struct hlsl_ir_function_decl * cur_function
Definition: hlsl.h:1070
struct vkd3d_shader_message_context * message_context
Definition: hlsl.h:1026
const char ** source_files
Definition: hlsl.h:1021
unsigned int matrix_majority
Definition: hlsl.h:1076
struct hlsl_type * error
Definition: hlsl.h:1089
bool warn_implicit_truncation
Definition: hlsl.h:1137
struct hlsl_type * null
Definition: hlsl.h:1088
struct rb_tree functions
Definition: hlsl.h:1068
bool include_empty_buffers
Definition: hlsl.h:1136
struct hlsl_ctx::hlsl_constant_defs constant_defs
unsigned int internal_name_counter
Definition: hlsl.h:1073
const struct hlsl_profile_info * profile
Definition: hlsl.h:1019
struct hlsl_type * Void
Definition: hlsl.h:1087
bool semantic_compat_mapping
Definition: hlsl.h:1134
enum vkd3d_shader_tessellator_partitioning partitioning
Definition: hlsl.h:1120
struct hlsl_buffer * globals_buffer
Definition: hlsl.h:1062
struct list scopes
Definition: hlsl.h:1049
uint32_t found_numthreads
Definition: hlsl.h:1132
uint32_t thread_count[3]
Definition: hlsl.h:1115
struct hlsl_ctx::@6003 builtin_types
bool child_effect
Definition: hlsl.h:1135
struct hlsl_buffer * params_buffer
Definition: hlsl.h:1062
const char * internal_func_name
Definition: hlsl.h:1127
struct hlsl_block static_initializers
Definition: hlsl.h:1096
struct vkd3d_string_buffer_cache string_buffers
Definition: hlsl.h:1028
struct hlsl_scope * cur_scope
Definition: hlsl.h:1043
unsigned int output_control_point_count
Definition: hlsl.h:1118
struct hlsl_buffer * cur_buffer
Definition: hlsl.h:1062
struct hlsl_type * data_type
Definition: hlsl.h:818
unsigned int path_len
Definition: hlsl.h:805
struct hlsl_src rel_offset
Definition: hlsl.h:816
struct hlsl_src * path
Definition: hlsl.h:806
unsigned int const_offset
Definition: hlsl.h:817
struct hlsl_ir_var * var
Definition: hlsl.h:796
size_t capacity
Definition: hlsl.h:583
struct hlsl_ir_var ** vars
Definition: hlsl.h:582
struct hlsl_ir_function_decl * decl
Definition: hlsl.h:636
@ HLSL_COMPILE_TYPE_CONSTRUCTGSWITHSO
Definition: hlsl.h:905
@ HLSL_COMPILE_TYPE_COMPILE
Definition: hlsl.h:903
unsigned int args_count
Definition: hlsl.h:918
struct hlsl_src * args
Definition: hlsl.h:917
struct hlsl_block instrs
Definition: hlsl.h:913
const struct hlsl_profile_info * profile
Definition: hlsl.h:909
enum hlsl_ir_compile::hlsl_compile_type compile_type
union hlsl_constant_value_component u[4]
Definition: hlsl.h:880
struct hlsl_reg reg
Definition: hlsl.h:883
struct hlsl_ir_constant::hlsl_constant_value value
struct hlsl_src operands[HLSL_MAX_OPERANDS]
Definition: hlsl.h:756
enum hlsl_ir_expr_op op
Definition: hlsl.h:755
const struct hlsl_attribute *const * attrs
Definition: hlsl.h:617
struct list entry
Definition: hlsl.h:605
struct hlsl_func_parameters parameters
Definition: hlsl.h:610
bool early_depth_test
Definition: hlsl.h:619
struct hlsl_ir_function * func
Definition: hlsl.h:608
struct hlsl_ir_var * return_var
Definition: hlsl.h:601
unsigned int attr_count
Definition: hlsl.h:616
struct list extern_vars
Definition: hlsl.h:630
struct hlsl_ir_var * early_return_var
Definition: hlsl.h:624
struct vkd3d_shader_location loc
Definition: hlsl.h:603
struct hlsl_type * return_type
Definition: hlsl.h:599
struct hlsl_block body
Definition: hlsl.h:612
const char * name
Definition: hlsl.h:591
struct list overloads
Definition: hlsl.h:594
struct rb_entry entry
Definition: hlsl.h:589
struct hlsl_block then_block
Definition: hlsl.h:643
struct hlsl_block else_block
Definition: hlsl.h:644
struct hlsl_src val idx
Definition: hlsl.h:790
enum hlsl_ir_jump_type type
Definition: hlsl.h:775
enum hlsl_ir_loop_unroll_type unroll_type
Definition: hlsl.h:661
unsigned int next_index
Definition: hlsl.h:659
unsigned int unroll_limit
Definition: hlsl.h:660
struct hlsl_block body
Definition: hlsl.h:658
unsigned int index
Definition: hlsl.h:361
struct list entry
Definition: hlsl.h:341
enum hlsl_ir_node_type type
Definition: hlsl.h:345
struct hlsl_reg reg
Definition: hlsl.h:363
struct list uses
Definition: hlsl.h:353
struct hlsl_type * data_type
Definition: hlsl.h:349
struct vkd3d_shader_location loc
Definition: hlsl.h:355
unsigned int last_read
Definition: hlsl.h:361
struct hlsl_src coords lod ddx ddy cmp sample_index texel_offset
Definition: hlsl.h:856
enum hlsl_sampler_dim sampling_dim
Definition: hlsl.h:857
enum hlsl_resource_load_type load_type
Definition: hlsl.h:854
struct hlsl_state_block * state_block
Definition: hlsl.h:926
struct hlsl_src rhs
Definition: hlsl.h:871
struct hlsl_deref lhs
Definition: hlsl.h:870
unsigned char writemask
Definition: hlsl.h:872
struct hlsl_block body
Definition: hlsl.h:668
struct vkd3d_shader_location loc
Definition: hlsl.h:670
unsigned int value
Definition: hlsl.h:666
struct list entry
Definition: hlsl.h:669
struct hlsl_src selector
Definition: hlsl.h:676
struct list cases
Definition: hlsl.h:677
uint32_t swizzle
Definition: hlsl.h:784
union hlsl_constant_value_component number
Definition: hlsl.h:482
unsigned int buffer_offset
Definition: hlsl.h:501
uint32_t is_output_semantic
Definition: hlsl.h:528
const char * name
Definition: hlsl.h:456
struct hlsl_ir_var::hlsl_default_value * default_values
bool used
Definition: hlsl.h:512
unsigned int first_write
Definition: hlsl.h:496
uint32_t has_explicit_bind_point
Definition: hlsl.h:533
struct hlsl_scope * scope
Definition: hlsl.h:470
struct hlsl_semantic semantic
Definition: hlsl.h:457
struct vkd3d_shader_location first_sampler_dim_loc
Definition: hlsl.h:514
unsigned int last_read
Definition: hlsl.h:496
uint32_t is_param
Definition: hlsl.h:530
struct hlsl_reg_reservation reg_reservation
Definition: hlsl.h:463
unsigned int bind_count[HLSL_REGSET_LAST+1]
Definition: hlsl.h:519
struct hlsl_ir_var::@6002 * objects_usage[HLSL_REGSET_LAST_OBJECT+1]
struct hlsl_type * data_type
Definition: hlsl.h:454
uint32_t storage_modifiers
Definition: hlsl.h:461
struct vkd3d_shader_location loc
Definition: hlsl.h:455
uint32_t is_uniform
Definition: hlsl.h:529
bool is_read
Definition: hlsl.h:498
enum hlsl_sampler_dim sampler_dim
Definition: hlsl.h:513
uint32_t is_synthetic
Definition: hlsl.h:532
unsigned int state_block_count
Definition: hlsl.h:490
struct hlsl_buffer * buffer
Definition: hlsl.h:459
struct hlsl_scope * annotations
Definition: hlsl.h:472
struct list scope_entry
Definition: hlsl.h:466
struct hlsl_state_block ** state_blocks
Definition: hlsl.h:489
struct hlsl_reg regs[HLSL_REGSET_LAST+1]
Definition: hlsl.h:508
bool indexable
Definition: hlsl.h:522
struct list extern_entry
Definition: hlsl.h:468
size_t state_block_capacity
Definition: hlsl.h:491
bool force_align
Definition: hlsl.h:525
uint32_t is_input_semantic
Definition: hlsl.h:527
uint32_t is_separated_resource
Definition: hlsl.h:531
struct hlsl_ir_node node
Definition: hlsl.h:941
unsigned int vsir_instr_idx
Definition: hlsl.h:944
unsigned int minor_level
Definition: hlsl.h:974
unsigned int minor_version
Definition: hlsl.h:972
unsigned int major_version
Definition: hlsl.h:971
enum vkd3d_shader_type type
Definition: hlsl.h:970
bool software
Definition: hlsl.h:975
unsigned int major_level
Definition: hlsl.h:973
const char * name
Definition: hlsl.h:969
unsigned int reg_space
Definition: hlsl.h:438
unsigned int offset_index
Definition: hlsl.h:441
unsigned int reg_index
Definition: hlsl.h:438
Definition: hlsl.h:282
uint32_t index
Definition: hlsl.h:294
bool allocated
Definition: hlsl.h:305
unsigned int writemask
Definition: hlsl.h:303
uint32_t id
Definition: hlsl.h:284
uint32_t allocation_size
Definition: hlsl.h:300
uint32_t space
Definition: hlsl.h:296
struct hlsl_ir_node * sample_index
Definition: hlsl.h:1156
struct hlsl_ir_node * ddx
Definition: hlsl.h:1156
struct hlsl_ir_node * lod
Definition: hlsl.h:1156
enum hlsl_sampler_dim sampling_dim
Definition: hlsl.h:1157
struct hlsl_ir_node * resource
Definition: hlsl.h:1155
enum hlsl_resource_load_type type
Definition: hlsl.h:1154
struct hlsl_ir_node * texel_offset
Definition: hlsl.h:1156
struct hlsl_ir_node * ddy
Definition: hlsl.h:1156
struct hlsl_ir_node * coords
Definition: hlsl.h:1156
struct hlsl_ir_node * sampler
Definition: hlsl.h:1155
struct hlsl_type * format
Definition: hlsl.h:1153
struct hlsl_ir_node * cmp
Definition: hlsl.h:1156
bool _switch
Definition: hlsl.h:962
bool loop
Definition: hlsl.h:960
bool annotations
Definition: hlsl.h:964
struct list entry
Definition: hlsl.h:950
struct list vars
Definition: hlsl.h:953
struct hlsl_scope * upper
Definition: hlsl.h:958
uint32_t reported_duplicated_output_next_index
Definition: hlsl.h:250
uint32_t index
Definition: hlsl.h:242
bool reported_missing
Definition: hlsl.h:247
uint32_t reported_duplicated_input_incompatible_next_index
Definition: hlsl.h:254
const char * name
Definition: hlsl.h:241
const char * raw_name
Definition: hlsl.h:245
Definition: hlsl.h:382
struct list entry
Definition: hlsl.h:385
struct hlsl_ir_node * node
Definition: hlsl.h:383
Definition: hlsl.h:549
unsigned int name_id
Definition: hlsl.h:557
bool is_function_call
Definition: hlsl.h:551
bool lhs_has_index
Definition: hlsl.h:561
struct hlsl_block * instrs
Definition: hlsl.h:565
unsigned int args_count
Definition: hlsl.h:570
char * name
Definition: hlsl.h:555
struct hlsl_src * args
Definition: hlsl.h:569
unsigned int lhs_index
Definition: hlsl.h:562
size_t count
Definition: hlsl.h:576
size_t capacity
Definition: hlsl.h:576
struct hlsl_state_block_entry ** entries
Definition: hlsl.h:575
const char * name
Definition: hlsl.h:262
uint32_t storage_modifiers
Definition: hlsl.h:268
struct hlsl_type * type
Definition: hlsl.h:261
struct hlsl_semantic semantic
Definition: hlsl.h:263
size_t name_bytecode_offset
Definition: hlsl.h:273
struct vkd3d_shader_location loc
Definition: hlsl.h:260
unsigned int reg_offset[HLSL_REGSET_LAST+1]
Definition: hlsl.h:270
uint32_t is_minimum_precision
Definition: hlsl.h:234
unsigned int dimx
Definition: hlsl.h:187
struct rb_entry scope_entry
Definition: hlsl.h:161
bool rasteriser_ordered
Definition: hlsl.h:219
unsigned int elements_count
Definition: hlsl.h:210
struct hlsl_type * format
Definition: hlsl.h:217
struct hlsl_type::@5997::@5998 numeric
enum hlsl_base_type type
Definition: hlsl.h:197
size_t field_count
Definition: hlsl.h:203
unsigned int version
Definition: hlsl.h:222
enum hlsl_sampler_dim sampler_dim
Definition: hlsl.h:172
const char * name
Definition: hlsl.h:174
uint32_t modifiers
Definition: hlsl.h:178
struct hlsl_type::@5997::@6000 array
unsigned int sample_count
Definition: hlsl.h:190
struct list entry
Definition: hlsl.h:159
union hlsl_type::@5997 e
struct hlsl_type::@5997::@6001 resource
unsigned int reg_size[HLSL_REGSET_LAST+1]
Definition: hlsl.h:230
struct hlsl_type * type
Definition: hlsl.h:208
struct hlsl_struct_field * fields
Definition: hlsl.h:202
size_t bytecode_offset
Definition: hlsl.h:232
struct hlsl_type::@5997::@5999 record
unsigned int dimy
Definition: hlsl.h:188
Definition: name.c:39
Definition: rbtree.h:30
Definition: rbtree.h:40
Definition: tools.h:99
Definition: cmds.c:130
struct sock * chain
Definition: tcpcore.h:1
#define new(TYPE, numElems)
Definition: treelist.c:54
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
Definition: dlist.c:348
Definition: pdh_main.c:64
#define VKD3D_PRINTF_FUNC(fmt, args)
Definition: vkd3d_common.h:114
#define vkd3d_unreachable()
Definition: vkd3d_common.h:119
#define VKD3D_ASSERT(cond)
Definition: vkd3d_common.h:49
static void * vkd3d_calloc(size_t count, size_t size)
Definition: vkd3d_memory.h:43
static char * vkd3d_strdup(const char *string)
Definition: vkd3d_memory.h:57
static void * vkd3d_realloc(void *ptr, size_t size)
Definition: vkd3d_memory.h:36
bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size)
Definition: memory.c:22
static uint32_t vkd3d_shader_create_swizzle(enum vkd3d_shader_swizzle_component x, enum vkd3d_shader_swizzle_component y, enum vkd3d_shader_swizzle_component z, enum vkd3d_shader_swizzle_component w)
vkd3d_shader_log_level
vkd3d_shader_tessellator_output_primitive
vkd3d_shader_tessellator_partitioning
vkd3d_shader_target_type
struct vkd3d_string_buffer * vkd3d_string_buffer_get(struct vkd3d_string_buffer_cache *cache)
void vkd3d_string_buffer_release(struct vkd3d_string_buffer_cache *cache, struct vkd3d_string_buffer *buffer)
vkd3d_shader_type
vkd3d_shader_interpolation_mode
vkd3d_shader_error
vkd3d_tessellator_domain
@ VKD3D_ERROR_OUT_OF_MEMORY
Definition: vkd3d_types.h:49
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
@ if_true
Definition: wpp_private.h:102
@ if_false
Definition: wpp_private.h:101
static unsigned int block
Definition: xmlmemory.c:101
#define const
Definition: zconf.h:233