ReactOS 0.4.15-dev-7670-g69b08be
d3dcompiler_private.h File Reference
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/rbtree.h"
#include "wine/heap.h"
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "d3dcompiler.h"
#include <assert.h>
Include dependency graph for d3dcompiler_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  constant
 
struct  shader_reg
 
struct  instruction
 
struct  declaration
 
struct  samplerdecl
 
struct  bwriter_shader
 
struct  rel_reg
 
struct  src_regs
 
struct  asmparser_backend
 
struct  compilation_messages
 
struct  asm_parser
 
struct  bytecode_buffer
 
struct  bytecode_backend
 
struct  bytecode_backend::instr_handler_table
 
struct  bc_writer
 
struct  hlsl_type
 
struct  hlsl_struct_field
 
struct  source_location
 
struct  hlsl_ir_node
 
struct  reg_reservation
 
struct  hlsl_ir_var
 
struct  hlsl_ir_function
 
struct  hlsl_ir_function_decl
 
struct  hlsl_ir_if
 
struct  hlsl_ir_loop
 
struct  hlsl_ir_assignment
 
struct  hlsl_ir_expr
 
struct  hlsl_ir_jump
 
struct  hlsl_ir_swizzle
 
struct  hlsl_ir_deref
 
struct  hlsl_ir_constant
 
struct  hlsl_ir_constructor
 
struct  hlsl_scope
 
struct  parse_parameter
 
struct  parse_colon_attribute
 
struct  parse_initializer
 
struct  parse_variable_def
 
struct  parse_function
 
struct  parse_if_body
 
struct  hlsl_parse_ctx
 
struct  dxbc_section
 
struct  dxbc
 

Macros

#define COBJMACROS
 
#define D3DERR_INVALIDCALL   0x8876086c
 
#define INSTRARRAY_INITIAL_SIZE   8
 
#define MAX_SRC_REGS   4
 
#define MESSAGEBUFFER_INITIAL_SIZE   256
 
#define PRINTF_ATTR(fmt, args)
 
#define BYTECODEBUFFER_INITIAL_SIZE   32
 
#define SWIZZLE_ERR   ~0U
 
#define BWRITERSP_WRITEMASK_0   0x1 /* .x r */
 
#define BWRITERSP_WRITEMASK_1   0x2 /* .y g */
 
#define BWRITERSP_WRITEMASK_2   0x4 /* .z b */
 
#define BWRITERSP_WRITEMASK_3   0x8 /* .w a */
 
#define BWRITERSP_WRITEMASK_ALL   0xf /* all */
 
#define BWRITERSI_TEXLD_PROJECT   1
 
#define BWRITERSI_TEXLD_BIAS   2
 
#define BWRITER_SM1_VS   0xfffeu
 
#define BWRITER_SM1_PS   0xffffu
 
#define BWRITERPS_VERSION(major, minor)   ((BWRITER_SM1_PS << 16) | ((major) << 8) | (minor))
 
#define BWRITERVS_VERSION(major, minor)   ((BWRITER_SM1_VS << 16) | ((major) << 8) | (minor))
 
#define BWRITERVS_SWIZZLE_SHIFT   16
 
#define BWRITERVS_SWIZZLE_MASK   (0xFF << BWRITERVS_SWIZZLE_SHIFT)
 
#define BWRITERVS_X_X   (0 << BWRITERVS_SWIZZLE_SHIFT)
 
#define BWRITERVS_X_Y   (1 << BWRITERVS_SWIZZLE_SHIFT)
 
#define BWRITERVS_X_Z   (2 << BWRITERVS_SWIZZLE_SHIFT)
 
#define BWRITERVS_X_W   (3 << BWRITERVS_SWIZZLE_SHIFT)
 
#define BWRITERVS_Y_X   (0 << (BWRITERVS_SWIZZLE_SHIFT + 2))
 
#define BWRITERVS_Y_Y   (1 << (BWRITERVS_SWIZZLE_SHIFT + 2))
 
#define BWRITERVS_Y_Z   (2 << (BWRITERVS_SWIZZLE_SHIFT + 2))
 
#define BWRITERVS_Y_W   (3 << (BWRITERVS_SWIZZLE_SHIFT + 2))
 
#define BWRITERVS_Z_X   (0 << (BWRITERVS_SWIZZLE_SHIFT + 4))
 
#define BWRITERVS_Z_Y   (1 << (BWRITERVS_SWIZZLE_SHIFT + 4))
 
#define BWRITERVS_Z_Z   (2 << (BWRITERVS_SWIZZLE_SHIFT + 4))
 
#define BWRITERVS_Z_W   (3 << (BWRITERVS_SWIZZLE_SHIFT + 4))
 
#define BWRITERVS_W_X   (0 << (BWRITERVS_SWIZZLE_SHIFT + 6))
 
#define BWRITERVS_W_Y   (1 << (BWRITERVS_SWIZZLE_SHIFT + 6))
 
#define BWRITERVS_W_Z   (2 << (BWRITERVS_SWIZZLE_SHIFT + 6))
 
#define BWRITERVS_W_W   (3 << (BWRITERVS_SWIZZLE_SHIFT + 6))
 
#define BWRITERVS_NOSWIZZLE   (BWRITERVS_X_X | BWRITERVS_Y_Y | BWRITERVS_Z_Z | BWRITERVS_W_W)
 
#define BWRITERVS_SWIZZLE_X   (BWRITERVS_X_X | BWRITERVS_Y_X | BWRITERVS_Z_X | BWRITERVS_W_X)
 
#define BWRITERVS_SWIZZLE_Y   (BWRITERVS_X_Y | BWRITERVS_Y_Y | BWRITERVS_Z_Y | BWRITERVS_W_Y)
 
#define BWRITERVS_SWIZZLE_Z   (BWRITERVS_X_Z | BWRITERVS_Y_Z | BWRITERVS_Z_Z | BWRITERVS_W_Z)
 
#define BWRITERVS_SWIZZLE_W   (BWRITERVS_X_W | BWRITERVS_Y_W | BWRITERVS_Z_W | BWRITERVS_W_W)
 
#define T0_REG   2
 
#define T1_REG   3
 
#define T2_REG   4
 
#define T3_REG   5
 
#define HLSL_STORAGE_EXTERN   0x00000001
 
#define HLSL_STORAGE_NOINTERPOLATION   0x00000002
 
#define HLSL_MODIFIER_PRECISE   0x00000004
 
#define HLSL_STORAGE_SHARED   0x00000008
 
#define HLSL_STORAGE_GROUPSHARED   0x00000010
 
#define HLSL_STORAGE_STATIC   0x00000020
 
#define HLSL_STORAGE_UNIFORM   0x00000040
 
#define HLSL_STORAGE_VOLATILE   0x00000080
 
#define HLSL_MODIFIER_CONST   0x00000100
 
#define HLSL_MODIFIER_ROW_MAJOR   0x00000200
 
#define HLSL_MODIFIER_COLUMN_MAJOR   0x00000400
 
#define HLSL_MODIFIER_IN   0x00000800
 
#define HLSL_MODIFIER_OUT   0x00001000
 
#define HLSL_TYPE_MODIFIERS_MASK
 
#define HLSL_MODIFIERS_COMPARISON_MASK   (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
 
#define MAKE_TAG(ch0, ch1, ch2, ch3)
 
#define TAG_Aon9   MAKE_TAG('A', 'o', 'n', '9')
 
#define TAG_DXBC   MAKE_TAG('D', 'X', 'B', 'C')
 
#define TAG_ISGN   MAKE_TAG('I', 'S', 'G', 'N')
 
#define TAG_OSGN   MAKE_TAG('O', 'S', 'G', 'N')
 
#define TAG_OSG5   MAKE_TAG('O', 'S', 'G', '5')
 
#define TAG_PCSG   MAKE_TAG('P', 'C', 'S', 'G')
 
#define TAG_RDEF   MAKE_TAG('R', 'D', 'E', 'F')
 
#define TAG_SDBG   MAKE_TAG('S', 'D', 'B', 'G')
 
#define TAG_SHDR   MAKE_TAG('S', 'H', 'D', 'R')
 
#define TAG_SHEX   MAKE_TAG('S', 'H', 'E', 'X')
 
#define TAG_STAT   MAKE_TAG('S', 'T', 'A', 'T')
 
#define TAG_XNAP   MAKE_TAG('X', 'N', 'A', 'P')
 
#define TAG_XNAS   MAKE_TAG('X', 'N', 'A', 'S')
 

Typedefs

typedef void(* instr_writer) (struct bc_writer *This, const struct instruction *instr, struct bytecode_buffer *buffer)
 

Enumerations

enum  shader_type { ST_UNKNOWN , ST_VERTEX , ST_PIXEL }
 
enum  bwriter_comparison_type {
  BWRITER_COMPARISON_NONE , BWRITER_COMPARISON_GT , BWRITER_COMPARISON_EQ , BWRITER_COMPARISON_GE ,
  BWRITER_COMPARISON_LT , BWRITER_COMPARISON_NE , BWRITER_COMPARISON_LE
}
 
enum  parse_status { PARSE_SUCCESS = 0 , PARSE_WARN = 1 , PARSE_ERR = 2 }
 
enum  bwritershader_instruction_opcode_type {
  BWRITERSIO_NOP , BWRITERSIO_MOV , BWRITERSIO_ADD , BWRITERSIO_SUB ,
  BWRITERSIO_MAD , BWRITERSIO_MUL , BWRITERSIO_RCP , BWRITERSIO_RSQ ,
  BWRITERSIO_DP3 , BWRITERSIO_DP4 , BWRITERSIO_MIN , BWRITERSIO_MAX ,
  BWRITERSIO_SLT , BWRITERSIO_SGE , BWRITERSIO_EXP , BWRITERSIO_LOG ,
  BWRITERSIO_LIT , BWRITERSIO_DST , BWRITERSIO_LRP , BWRITERSIO_FRC ,
  BWRITERSIO_M4x4 , BWRITERSIO_M4x3 , BWRITERSIO_M3x4 , BWRITERSIO_M3x3 ,
  BWRITERSIO_M3x2 , BWRITERSIO_CALL , BWRITERSIO_CALLNZ , BWRITERSIO_LOOP ,
  BWRITERSIO_RET , BWRITERSIO_ENDLOOP , BWRITERSIO_LABEL , BWRITERSIO_DCL ,
  BWRITERSIO_POW , BWRITERSIO_CRS , BWRITERSIO_SGN , BWRITERSIO_ABS ,
  BWRITERSIO_NRM , BWRITERSIO_SINCOS , BWRITERSIO_REP , BWRITERSIO_ENDREP ,
  BWRITERSIO_IF , BWRITERSIO_IFC , BWRITERSIO_ELSE , BWRITERSIO_ENDIF ,
  BWRITERSIO_BREAK , BWRITERSIO_BREAKC , BWRITERSIO_MOVA , BWRITERSIO_DEFB ,
  BWRITERSIO_DEFI , BWRITERSIO_TEXCOORD , BWRITERSIO_TEXKILL , BWRITERSIO_TEX ,
  BWRITERSIO_TEXBEM , BWRITERSIO_TEXBEML , BWRITERSIO_TEXREG2AR , BWRITERSIO_TEXREG2GB ,
  BWRITERSIO_TEXM3x2PAD , BWRITERSIO_TEXM3x2TEX , BWRITERSIO_TEXM3x3PAD , BWRITERSIO_TEXM3x3TEX ,
  BWRITERSIO_TEXM3x3SPEC , BWRITERSIO_TEXM3x3VSPEC , BWRITERSIO_EXPP , BWRITERSIO_LOGP ,
  BWRITERSIO_CND , BWRITERSIO_DEF , BWRITERSIO_TEXREG2RGB , BWRITERSIO_TEXDP3TEX ,
  BWRITERSIO_TEXM3x2DEPTH , BWRITERSIO_TEXDP3 , BWRITERSIO_TEXM3x3 , BWRITERSIO_TEXDEPTH ,
  BWRITERSIO_CMP , BWRITERSIO_BEM , BWRITERSIO_DP2ADD , BWRITERSIO_DSX ,
  BWRITERSIO_DSY , BWRITERSIO_TEXLDD , BWRITERSIO_SETP , BWRITERSIO_TEXLDL ,
  BWRITERSIO_BREAKP , BWRITERSIO_TEXLDP , BWRITERSIO_TEXLDB , BWRITERSIO_PHASE ,
  BWRITERSIO_COMMENT , BWRITERSIO_END
}
 
enum  bwritershader_param_register_type {
  BWRITERSPR_TEMP , BWRITERSPR_INPUT , BWRITERSPR_CONST , BWRITERSPR_ADDR ,
  BWRITERSPR_TEXTURE , BWRITERSPR_RASTOUT , BWRITERSPR_ATTROUT , BWRITERSPR_TEXCRDOUT ,
  BWRITERSPR_OUTPUT , BWRITERSPR_CONSTINT , BWRITERSPR_COLOROUT , BWRITERSPR_DEPTHOUT ,
  BWRITERSPR_SAMPLER , BWRITERSPR_CONSTBOOL , BWRITERSPR_LOOP , BWRITERSPR_MISCTYPE ,
  BWRITERSPR_LABEL , BWRITERSPR_PREDICATE
}
 
enum  bwritervs_rastout_offsets { BWRITERSRO_POSITION , BWRITERSRO_FOG , BWRITERSRO_POINT_SIZE }
 
enum  bwritershader_param_dstmod_type { BWRITERSPDM_NONE = 0 , BWRITERSPDM_SATURATE = 1 , BWRITERSPDM_PARTIALPRECISION = 2 , BWRITERSPDM_MSAMPCENTROID = 4 }
 
enum  bwritersampler_texture_type {
  BWRITERSTT_UNKNOWN = 0 , BWRITERSTT_1D = 1 , BWRITERSTT_2D = 2 , BWRITERSTT_CUBE = 3 ,
  BWRITERSTT_VOLUME = 4
}
 
enum  bwritershader_param_srcmod_type {
  BWRITERSPSM_NONE = 0 , BWRITERSPSM_NEG , BWRITERSPSM_BIAS , BWRITERSPSM_BIASNEG ,
  BWRITERSPSM_SIGN , BWRITERSPSM_SIGNNEG , BWRITERSPSM_COMP , BWRITERSPSM_X2 ,
  BWRITERSPSM_X2NEG , BWRITERSPSM_DZ , BWRITERSPSM_DW , BWRITERSPSM_ABS ,
  BWRITERSPSM_ABSNEG , BWRITERSPSM_NOT
}
 
enum  bwriterdeclusage {
  BWRITERDECLUSAGE_POSITION , BWRITERDECLUSAGE_BLENDWEIGHT , BWRITERDECLUSAGE_BLENDINDICES , BWRITERDECLUSAGE_NORMAL ,
  BWRITERDECLUSAGE_PSIZE , BWRITERDECLUSAGE_TEXCOORD , BWRITERDECLUSAGE_TANGENT , BWRITERDECLUSAGE_BINORMAL ,
  BWRITERDECLUSAGE_TESSFACTOR , BWRITERDECLUSAGE_POSITIONT , BWRITERDECLUSAGE_COLOR , BWRITERDECLUSAGE_FOG ,
  BWRITERDECLUSAGE_DEPTH , BWRITERDECLUSAGE_SAMPLE
}
 
enum  hlsl_type_class {
  HLSL_CLASS_SCALAR , HLSL_CLASS_VECTOR , HLSL_CLASS_MATRIX , HLSL_CLASS_LAST_NUMERIC = HLSL_CLASS_MATRIX ,
  HLSL_CLASS_STRUCT , HLSL_CLASS_ARRAY , HLSL_CLASS_OBJECT
}
 
enum  hlsl_base_type {
  HLSL_TYPE_FLOAT , HLSL_TYPE_HALF , HLSL_TYPE_DOUBLE , HLSL_TYPE_INT ,
  HLSL_TYPE_UINT , HLSL_TYPE_BOOL , HLSL_TYPE_LAST_SCALAR = HLSL_TYPE_BOOL , HLSL_TYPE_SAMPLER ,
  HLSL_TYPE_TEXTURE , HLSL_TYPE_PIXELSHADER , HLSL_TYPE_VERTEXSHADER , HLSL_TYPE_STRING ,
  HLSL_TYPE_VOID
}
 
enum  hlsl_sampler_dim {
  HLSL_SAMPLER_DIM_GENERIC , HLSL_SAMPLER_DIM_1D , HLSL_SAMPLER_DIM_2D , HLSL_SAMPLER_DIM_3D ,
  HLSL_SAMPLER_DIM_CUBE
}
 
enum  hlsl_matrix_majority { HLSL_COLUMN_MAJOR , HLSL_ROW_MAJOR }
 
enum  hlsl_ir_node_type {
  HLSL_IR_ASSIGNMENT = 0 , HLSL_IR_CONSTANT , HLSL_IR_CONSTRUCTOR , HLSL_IR_DEREF ,
  HLSL_IR_EXPR , HLSL_IR_IF , HLSL_IR_LOOP , HLSL_IR_JUMP ,
  HLSL_IR_SWIZZLE
}
 
enum  hlsl_ir_expr_op {
  HLSL_IR_UNOP_BIT_NOT = 0 , HLSL_IR_UNOP_LOGIC_NOT , HLSL_IR_UNOP_NEG , HLSL_IR_UNOP_ABS ,
  HLSL_IR_UNOP_SIGN , HLSL_IR_UNOP_RCP , HLSL_IR_UNOP_RSQ , HLSL_IR_UNOP_SQRT ,
  HLSL_IR_UNOP_NRM , HLSL_IR_UNOP_EXP2 , HLSL_IR_UNOP_LOG2 , HLSL_IR_UNOP_CAST ,
  HLSL_IR_UNOP_FRACT , HLSL_IR_UNOP_SIN , HLSL_IR_UNOP_COS , HLSL_IR_UNOP_SIN_REDUCED ,
  HLSL_IR_UNOP_COS_REDUCED , HLSL_IR_UNOP_DSX , HLSL_IR_UNOP_DSY , HLSL_IR_UNOP_SAT ,
  HLSL_IR_UNOP_PREINC , HLSL_IR_UNOP_PREDEC , HLSL_IR_UNOP_POSTINC , HLSL_IR_UNOP_POSTDEC ,
  HLSL_IR_BINOP_ADD , HLSL_IR_BINOP_SUB , HLSL_IR_BINOP_MUL , HLSL_IR_BINOP_DIV ,
  HLSL_IR_BINOP_MOD , HLSL_IR_BINOP_LESS , HLSL_IR_BINOP_GREATER , HLSL_IR_BINOP_LEQUAL ,
  HLSL_IR_BINOP_GEQUAL , HLSL_IR_BINOP_EQUAL , HLSL_IR_BINOP_NEQUAL , HLSL_IR_BINOP_LOGIC_AND ,
  HLSL_IR_BINOP_LOGIC_OR , HLSL_IR_BINOP_LSHIFT , HLSL_IR_BINOP_RSHIFT , HLSL_IR_BINOP_BIT_AND ,
  HLSL_IR_BINOP_BIT_OR , HLSL_IR_BINOP_BIT_XOR , HLSL_IR_BINOP_DOT , HLSL_IR_BINOP_CRS ,
  HLSL_IR_BINOP_MIN , HLSL_IR_BINOP_MAX , HLSL_IR_BINOP_POW , HLSL_IR_TEROP_LERP ,
  HLSL_IR_SEQUENCE
}
 
enum  hlsl_ir_jump_type { HLSL_IR_JUMP_BREAK , HLSL_IR_JUMP_CONTINUE , HLSL_IR_JUMP_DISCARD , HLSL_IR_JUMP_RETURN }
 
enum  hlsl_ir_deref_type { HLSL_IR_DEREF_VAR , HLSL_IR_DEREF_ARRAY , HLSL_IR_DEREF_RECORD }
 
enum  parse_unary_op { UNARY_OP_PLUS , UNARY_OP_MINUS , UNARY_OP_LOGICNOT , UNARY_OP_BITNOT }
 
enum  parse_assign_op {
  ASSIGN_OP_ASSIGN , ASSIGN_OP_ADD , ASSIGN_OP_SUB , ASSIGN_OP_MUL ,
  ASSIGN_OP_DIV , ASSIGN_OP_MOD , ASSIGN_OP_LSHIFT , ASSIGN_OP_RSHIFT ,
  ASSIGN_OP_AND , ASSIGN_OP_OR , ASSIGN_OP_XOR
}
 
enum  hlsl_error_level { HLSL_LEVEL_ERROR = 0 , HLSL_LEVEL_WARNING , HLSL_LEVEL_NOTE }
 

Functions

const chardebug_d3dcompiler_d3d_blob_part (D3D_BLOB_PART part) DECLSPEC_HIDDEN
 
const chardebug_d3dcompiler_shader_variable_class (D3D_SHADER_VARIABLE_CLASS c) DECLSPEC_HIDDEN
 
const chardebug_d3dcompiler_shader_variable_type (D3D_SHADER_VARIABLE_TYPE t) DECLSPEC_HIDDEN
 
static voidd3dcompiler_alloc (SIZE_T size)
 
static voidd3dcompiler_realloc (void *ptr, SIZE_T size)
 
static BOOL d3dcompiler_free (void *ptr)
 
static chard3dcompiler_strdup (const char *string)
 
struct instructionalloc_instr (unsigned int srcs) DECLSPEC_HIDDEN
 
BOOL add_instruction (struct bwriter_shader *shader, struct instruction *instr) DECLSPEC_HIDDEN
 
BOOL add_constF (struct bwriter_shader *shader, DWORD reg, float x, float y, float z, float w) DECLSPEC_HIDDEN
 
BOOL add_constI (struct bwriter_shader *shader, DWORD reg, INT x, INT y, INT z, INT w) DECLSPEC_HIDDEN
 
BOOL add_constB (struct bwriter_shader *shader, DWORD reg, BOOL x) DECLSPEC_HIDDEN
 
BOOL record_declaration (struct bwriter_shader *shader, DWORD usage, DWORD usage_idx, DWORD mod, BOOL output, DWORD regnum, DWORD writemask, BOOL builtin) DECLSPEC_HIDDEN
 
BOOL record_sampler (struct bwriter_shader *shader, DWORD samptype, DWORD mod, DWORD regnum) DECLSPEC_HIDDEN
 
void create_vs10_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_vs11_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_vs20_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_vs2x_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_vs30_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps10_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps11_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps12_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps13_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps14_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps20_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps2x_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
void create_ps30_parser (struct asm_parser *ret) DECLSPEC_HIDDEN
 
struct bwriter_shaderparse_asm_shader (char **messages) DECLSPEC_HIDDEN
 
void compilation_message (struct compilation_messages *msg, const char *fmt, __ms_va_list args) DECLSPEC_HIDDEN
 
void WINAPIV asmparser_message (struct asm_parser *ctx, const char *fmt,...) PRINTF_ATTR(2
 
static void set_parse_status (enum parse_status *current, enum parse_status update)
 
const chardebug_print_srcmod (DWORD mod) DECLSPEC_HIDDEN
 
const chardebug_print_dstmod (DWORD mod) DECLSPEC_HIDDEN
 
const chardebug_print_shift (DWORD shift) DECLSPEC_HIDDEN
 
const chardebug_print_dstreg (const struct shader_reg *reg) DECLSPEC_HIDDEN
 
const chardebug_print_srcreg (const struct shader_reg *reg) DECLSPEC_HIDDEN
 
const chardebug_print_comp (DWORD comp) DECLSPEC_HIDDEN
 
const chardebug_print_opcode (DWORD opcode) DECLSPEC_HIDDEN
 
struct bwriter_shaderSlAssembleShader (const char *text, char **messages) DECLSPEC_HIDDEN
 
HRESULT SlWriteBytecode (const struct bwriter_shader *shader, int dxversion, DWORD **result, DWORD *size) DECLSPEC_HIDDEN
 
void SlDeleteShader (struct bwriter_shader *shader) DECLSPEC_HIDDEN
 
void WINAPIV hlsl_message (const char *fmt,...) PRINTF_ATTR(1
 
void WINAPIV hlsl_report_message (const char *filename, DWORD line, DWORD column, enum hlsl_error_level level, const char *fmt,...) PRINTF_ATTR(5
 
static struct hlsl_ir_exprexpr_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_derefderef_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_constantconstant_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_jumpjump_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_assignmentassignment_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_swizzleswizzle_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_constructorconstructor_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_ifif_from_node (const struct hlsl_ir_node *node)
 
static struct hlsl_ir_looploop_from_node (const struct hlsl_ir_node *node)
 
BOOL add_declaration (struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN
 
struct hlsl_ir_varget_variable (struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN
 
void free_declaration (struct hlsl_ir_var *decl) DECLSPEC_HIDDEN
 
struct hlsl_typenew_hlsl_type (const char *name, enum hlsl_type_class type_class, enum hlsl_base_type base_type, unsigned dimx, unsigned dimy) DECLSPEC_HIDDEN
 
struct hlsl_typenew_array_type (struct hlsl_type *basic_type, unsigned int array_size) DECLSPEC_HIDDEN
 
struct hlsl_typeclone_hlsl_type (struct hlsl_type *old) DECLSPEC_HIDDEN
 
struct hlsl_typeget_type (struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN
 
BOOL find_function (const char *name) DECLSPEC_HIDDEN
 
unsigned int components_count_type (struct hlsl_type *type) DECLSPEC_HIDDEN
 
BOOL compare_hlsl_types (const struct hlsl_type *t1, const struct hlsl_type *t2) DECLSPEC_HIDDEN
 
BOOL compatible_data_types (struct hlsl_type *s1, struct hlsl_type *s2) DECLSPEC_HIDDEN
 
struct hlsl_ir_exprnew_expr (enum hlsl_ir_expr_op op, struct hlsl_ir_node **operands, struct source_location *loc) DECLSPEC_HIDDEN
 
struct hlsl_ir_exprnew_cast (struct hlsl_ir_node *node, struct hlsl_type *type, struct source_location *loc) DECLSPEC_HIDDEN
 
struct hlsl_ir_derefnew_var_deref (struct hlsl_ir_var *var) DECLSPEC_HIDDEN
 
struct hlsl_ir_derefnew_record_deref (struct hlsl_ir_node *record, struct hlsl_struct_field *field) DECLSPEC_HIDDEN
 
struct hlsl_ir_nodemake_assignment (struct hlsl_ir_node *left, enum parse_assign_op assign_op, DWORD writemask, struct hlsl_ir_node *right) DECLSPEC_HIDDEN
 
void push_scope (struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN
 
BOOL pop_scope (struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN
 
struct hlsl_ir_function_declnew_func_decl (struct hlsl_type *return_type, struct list *parameters) DECLSPEC_HIDDEN
 
void init_functions_tree (struct wine_rb_tree *funcs) DECLSPEC_HIDDEN
 
void add_function_decl (struct wine_rb_tree *funcs, char *name, struct hlsl_ir_function_decl *decl, BOOL intrinsic) DECLSPEC_HIDDEN
 
struct bwriter_shaderparse_hlsl_shader (const char *text, enum shader_type type, DWORD major, DWORD minor, const char *entrypoint, char **messages) DECLSPEC_HIDDEN
 
const chardebug_hlsl_type (const struct hlsl_type *type) DECLSPEC_HIDDEN
 
const chardebug_modifiers (DWORD modifiers) DECLSPEC_HIDDEN
 
void debug_dump_ir_function_decl (const struct hlsl_ir_function_decl *func) DECLSPEC_HIDDEN
 
void free_hlsl_type (struct hlsl_type *type) DECLSPEC_HIDDEN
 
void free_instr (struct hlsl_ir_node *node) DECLSPEC_HIDDEN
 
void free_instr_list (struct list *list) DECLSPEC_HIDDEN
 
void free_function_rb (struct wine_rb_entry *entry, void *context) DECLSPEC_HIDDEN
 
static struct hlsl_ir_nodenew_unary_expr (enum hlsl_ir_expr_op op, struct hlsl_ir_node *op1, struct source_location loc)
 
static struct hlsl_ir_nodenew_binary_expr (enum hlsl_ir_expr_op op, struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, struct source_location loc)
 
HRESULT dxbc_write_blob (struct dxbc *dxbc, ID3DBlob **blob) DECLSPEC_HIDDEN
 
void dxbc_destroy (struct dxbc *dxbc) DECLSPEC_HIDDEN
 
HRESULT dxbc_parse (const char *data, SIZE_T data_size, struct dxbc *dxbc) DECLSPEC_HIDDEN
 
HRESULT dxbc_add_section (struct dxbc *dxbc, DWORD tag, const char *data, DWORD data_size) DECLSPEC_HIDDEN
 
HRESULT dxbc_init (struct dxbc *dxbc, unsigned int size) DECLSPEC_HIDDEN
 
static void read_dword (const char **ptr, DWORD *d)
 
static void write_dword (char **ptr, DWORD d)
 
void skip_dword_unknown (const char **ptr, unsigned int count) DECLSPEC_HIDDEN
 

Variables

struct asm_parser asm_ctx DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ BWRITER_SM1_PS

#define BWRITER_SM1_PS   0xffffu

Definition at line 537 of file d3dcompiler_private.h.

◆ BWRITER_SM1_VS

#define BWRITER_SM1_VS   0xfffeu

Definition at line 536 of file d3dcompiler_private.h.

◆ BWRITERPS_VERSION

#define BWRITERPS_VERSION (   major,
  minor 
)    ((BWRITER_SM1_PS << 16) | ((major) << 8) | (minor))

Definition at line 539 of file d3dcompiler_private.h.

◆ BWRITERSI_TEXLD_BIAS

#define BWRITERSI_TEXLD_BIAS   2

Definition at line 516 of file d3dcompiler_private.h.

◆ BWRITERSI_TEXLD_PROJECT

#define BWRITERSI_TEXLD_PROJECT   1

Definition at line 515 of file d3dcompiler_private.h.

◆ BWRITERSP_WRITEMASK_0

#define BWRITERSP_WRITEMASK_0   0x1 /* .x r */

Definition at line 492 of file d3dcompiler_private.h.

◆ BWRITERSP_WRITEMASK_1

#define BWRITERSP_WRITEMASK_1   0x2 /* .y g */

Definition at line 493 of file d3dcompiler_private.h.

◆ BWRITERSP_WRITEMASK_2

#define BWRITERSP_WRITEMASK_2   0x4 /* .z b */

Definition at line 494 of file d3dcompiler_private.h.

◆ BWRITERSP_WRITEMASK_3

#define BWRITERSP_WRITEMASK_3   0x8 /* .w a */

Definition at line 495 of file d3dcompiler_private.h.

◆ BWRITERSP_WRITEMASK_ALL

#define BWRITERSP_WRITEMASK_ALL   0xf /* all */

Definition at line 496 of file d3dcompiler_private.h.

◆ BWRITERVS_NOSWIZZLE

#define BWRITERVS_NOSWIZZLE   (BWRITERVS_X_X | BWRITERVS_Y_Y | BWRITERVS_Z_Z | BWRITERVS_W_W)

Definition at line 565 of file d3dcompiler_private.h.

◆ BWRITERVS_SWIZZLE_MASK

#define BWRITERVS_SWIZZLE_MASK   (0xFF << BWRITERVS_SWIZZLE_SHIFT)

Definition at line 543 of file d3dcompiler_private.h.

◆ BWRITERVS_SWIZZLE_SHIFT

#define BWRITERVS_SWIZZLE_SHIFT   16

Definition at line 542 of file d3dcompiler_private.h.

◆ BWRITERVS_SWIZZLE_W

#define BWRITERVS_SWIZZLE_W   (BWRITERVS_X_W | BWRITERVS_Y_W | BWRITERVS_Z_W | BWRITERVS_W_W)

Definition at line 570 of file d3dcompiler_private.h.

◆ BWRITERVS_SWIZZLE_X

#define BWRITERVS_SWIZZLE_X   (BWRITERVS_X_X | BWRITERVS_Y_X | BWRITERVS_Z_X | BWRITERVS_W_X)

Definition at line 567 of file d3dcompiler_private.h.

◆ BWRITERVS_SWIZZLE_Y

#define BWRITERVS_SWIZZLE_Y   (BWRITERVS_X_Y | BWRITERVS_Y_Y | BWRITERVS_Z_Y | BWRITERVS_W_Y)

Definition at line 568 of file d3dcompiler_private.h.

◆ BWRITERVS_SWIZZLE_Z

#define BWRITERVS_SWIZZLE_Z   (BWRITERVS_X_Z | BWRITERVS_Y_Z | BWRITERVS_Z_Z | BWRITERVS_W_Z)

Definition at line 569 of file d3dcompiler_private.h.

◆ BWRITERVS_VERSION

#define BWRITERVS_VERSION (   major,
  minor 
)    ((BWRITER_SM1_VS << 16) | ((major) << 8) | (minor))

Definition at line 540 of file d3dcompiler_private.h.

◆ BWRITERVS_W_W

#define BWRITERVS_W_W   (3 << (BWRITERVS_SWIZZLE_SHIFT + 6))

Definition at line 563 of file d3dcompiler_private.h.

◆ BWRITERVS_W_X

#define BWRITERVS_W_X   (0 << (BWRITERVS_SWIZZLE_SHIFT + 6))

Definition at line 560 of file d3dcompiler_private.h.

◆ BWRITERVS_W_Y

#define BWRITERVS_W_Y   (1 << (BWRITERVS_SWIZZLE_SHIFT + 6))

Definition at line 561 of file d3dcompiler_private.h.

◆ BWRITERVS_W_Z

#define BWRITERVS_W_Z   (2 << (BWRITERVS_SWIZZLE_SHIFT + 6))

Definition at line 562 of file d3dcompiler_private.h.

◆ BWRITERVS_X_W

#define BWRITERVS_X_W   (3 << BWRITERVS_SWIZZLE_SHIFT)

Definition at line 548 of file d3dcompiler_private.h.

◆ BWRITERVS_X_X

#define BWRITERVS_X_X   (0 << BWRITERVS_SWIZZLE_SHIFT)

Definition at line 545 of file d3dcompiler_private.h.

◆ BWRITERVS_X_Y

#define BWRITERVS_X_Y   (1 << BWRITERVS_SWIZZLE_SHIFT)

Definition at line 546 of file d3dcompiler_private.h.

◆ BWRITERVS_X_Z

#define BWRITERVS_X_Z   (2 << BWRITERVS_SWIZZLE_SHIFT)

Definition at line 547 of file d3dcompiler_private.h.

◆ BWRITERVS_Y_W

#define BWRITERVS_Y_W   (3 << (BWRITERVS_SWIZZLE_SHIFT + 2))

Definition at line 553 of file d3dcompiler_private.h.

◆ BWRITERVS_Y_X

#define BWRITERVS_Y_X   (0 << (BWRITERVS_SWIZZLE_SHIFT + 2))

Definition at line 550 of file d3dcompiler_private.h.

◆ BWRITERVS_Y_Y

#define BWRITERVS_Y_Y   (1 << (BWRITERVS_SWIZZLE_SHIFT + 2))

Definition at line 551 of file d3dcompiler_private.h.

◆ BWRITERVS_Y_Z

#define BWRITERVS_Y_Z   (2 << (BWRITERVS_SWIZZLE_SHIFT + 2))

Definition at line 552 of file d3dcompiler_private.h.

◆ BWRITERVS_Z_W

#define BWRITERVS_Z_W   (3 << (BWRITERVS_SWIZZLE_SHIFT + 4))

Definition at line 558 of file d3dcompiler_private.h.

◆ BWRITERVS_Z_X

#define BWRITERVS_Z_X   (0 << (BWRITERVS_SWIZZLE_SHIFT + 4))

Definition at line 555 of file d3dcompiler_private.h.

◆ BWRITERVS_Z_Y

#define BWRITERVS_Z_Y   (1 << (BWRITERVS_SWIZZLE_SHIFT + 4))

Definition at line 556 of file d3dcompiler_private.h.

◆ BWRITERVS_Z_Z

#define BWRITERVS_Z_Z   (2 << (BWRITERVS_SWIZZLE_SHIFT + 4))

Definition at line 557 of file d3dcompiler_private.h.

◆ BYTECODEBUFFER_INITIAL_SIZE

#define BYTECODEBUFFER_INITIAL_SIZE   32

Definition at line 299 of file d3dcompiler_private.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 30 of file d3dcompiler_private.h.

◆ D3DERR_INVALIDCALL

#define D3DERR_INVALIDCALL   0x8876086c

Definition at line 44 of file d3dcompiler_private.h.

◆ HLSL_MODIFIER_COLUMN_MAJOR

#define HLSL_MODIFIER_COLUMN_MAJOR   0x00000400

Definition at line 739 of file d3dcompiler_private.h.

◆ HLSL_MODIFIER_CONST

#define HLSL_MODIFIER_CONST   0x00000100

Definition at line 737 of file d3dcompiler_private.h.

◆ HLSL_MODIFIER_IN

#define HLSL_MODIFIER_IN   0x00000800

Definition at line 740 of file d3dcompiler_private.h.

◆ HLSL_MODIFIER_OUT

#define HLSL_MODIFIER_OUT   0x00001000

Definition at line 741 of file d3dcompiler_private.h.

◆ HLSL_MODIFIER_PRECISE

#define HLSL_MODIFIER_PRECISE   0x00000004

Definition at line 731 of file d3dcompiler_private.h.

◆ HLSL_MODIFIER_ROW_MAJOR

#define HLSL_MODIFIER_ROW_MAJOR   0x00000200

Definition at line 738 of file d3dcompiler_private.h.

◆ HLSL_MODIFIERS_COMPARISON_MASK

#define HLSL_MODIFIERS_COMPARISON_MASK   (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)

Definition at line 747 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_EXTERN

#define HLSL_STORAGE_EXTERN   0x00000001

Definition at line 729 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_GROUPSHARED

#define HLSL_STORAGE_GROUPSHARED   0x00000010

Definition at line 733 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_NOINTERPOLATION

#define HLSL_STORAGE_NOINTERPOLATION   0x00000002

Definition at line 730 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_SHARED

#define HLSL_STORAGE_SHARED   0x00000008

Definition at line 732 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_STATIC

#define HLSL_STORAGE_STATIC   0x00000020

Definition at line 734 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_UNIFORM

#define HLSL_STORAGE_UNIFORM   0x00000040

Definition at line 735 of file d3dcompiler_private.h.

◆ HLSL_STORAGE_VOLATILE

#define HLSL_STORAGE_VOLATILE   0x00000080

Definition at line 736 of file d3dcompiler_private.h.

◆ HLSL_TYPE_MODIFIERS_MASK

#define HLSL_TYPE_MODIFIERS_MASK
Value:
#define HLSL_MODIFIER_PRECISE
#define HLSL_MODIFIER_CONST
#define HLSL_MODIFIER_ROW_MAJOR
#define HLSL_MODIFIER_COLUMN_MAJOR
#define HLSL_STORAGE_VOLATILE

Definition at line 743 of file d3dcompiler_private.h.

◆ INSTRARRAY_INITIAL_SIZE

#define INSTRARRAY_INITIAL_SIZE   8

Definition at line 118 of file d3dcompiler_private.h.

◆ MAKE_TAG

#define MAKE_TAG (   ch0,
  ch1,
  ch2,
  ch3 
)
Value:
((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DWORD
Definition: nt_native.h:44

Definition at line 1175 of file d3dcompiler_private.h.

◆ MAX_SRC_REGS

#define MAX_SRC_REGS   4

Definition at line 190 of file d3dcompiler_private.h.

◆ MESSAGEBUFFER_INITIAL_SIZE

#define MESSAGEBUFFER_INITIAL_SIZE   256

Definition at line 234 of file d3dcompiler_private.h.

◆ PRINTF_ATTR

#define PRINTF_ATTR (   fmt,
  args 
)

Definition at line 285 of file d3dcompiler_private.h.

◆ SWIZZLE_ERR

#define SWIZZLE_ERR   ~0U

Definition at line 367 of file d3dcompiler_private.h.

◆ T0_REG

#define T0_REG   2

Definition at line 591 of file d3dcompiler_private.h.

◆ T1_REG

#define T1_REG   3

Definition at line 592 of file d3dcompiler_private.h.

◆ T2_REG

#define T2_REG   4

Definition at line 593 of file d3dcompiler_private.h.

◆ T3_REG

#define T3_REG   5

Definition at line 594 of file d3dcompiler_private.h.

◆ TAG_Aon9

#define TAG_Aon9   MAKE_TAG('A', 'o', 'n', '9')

Definition at line 1178 of file d3dcompiler_private.h.

◆ TAG_DXBC

#define TAG_DXBC   MAKE_TAG('D', 'X', 'B', 'C')

Definition at line 1179 of file d3dcompiler_private.h.

◆ TAG_ISGN

#define TAG_ISGN   MAKE_TAG('I', 'S', 'G', 'N')

Definition at line 1180 of file d3dcompiler_private.h.

◆ TAG_OSG5

#define TAG_OSG5   MAKE_TAG('O', 'S', 'G', '5')

Definition at line 1182 of file d3dcompiler_private.h.

◆ TAG_OSGN

#define TAG_OSGN   MAKE_TAG('O', 'S', 'G', 'N')

Definition at line 1181 of file d3dcompiler_private.h.

◆ TAG_PCSG

#define TAG_PCSG   MAKE_TAG('P', 'C', 'S', 'G')

Definition at line 1183 of file d3dcompiler_private.h.

◆ TAG_RDEF

#define TAG_RDEF   MAKE_TAG('R', 'D', 'E', 'F')

Definition at line 1184 of file d3dcompiler_private.h.

◆ TAG_SDBG

#define TAG_SDBG   MAKE_TAG('S', 'D', 'B', 'G')

Definition at line 1185 of file d3dcompiler_private.h.

◆ TAG_SHDR

#define TAG_SHDR   MAKE_TAG('S', 'H', 'D', 'R')

Definition at line 1186 of file d3dcompiler_private.h.

◆ TAG_SHEX

#define TAG_SHEX   MAKE_TAG('S', 'H', 'E', 'X')

Definition at line 1187 of file d3dcompiler_private.h.

◆ TAG_STAT

#define TAG_STAT   MAKE_TAG('S', 'T', 'A', 'T')

Definition at line 1188 of file d3dcompiler_private.h.

◆ TAG_XNAP

#define TAG_XNAP   MAKE_TAG('X', 'N', 'A', 'P')

Definition at line 1189 of file d3dcompiler_private.h.

◆ TAG_XNAS

#define TAG_XNAS   MAKE_TAG('X', 'N', 'A', 'S')

Definition at line 1190 of file d3dcompiler_private.h.

Typedef Documentation

◆ instr_writer

typedef void(* instr_writer) (struct bc_writer *This, const struct instruction *instr, struct bytecode_buffer *buffer)

Definition at line 312 of file d3dcompiler_private.h.

Enumeration Type Documentation

◆ bwriter_comparison_type

Enumerator
BWRITER_COMPARISON_NONE 
BWRITER_COMPARISON_GT 
BWRITER_COMPARISON_EQ 
BWRITER_COMPARISON_GE 
BWRITER_COMPARISON_LT 
BWRITER_COMPARISON_NE 
BWRITER_COMPARISON_LE 

Definition at line 58 of file d3dcompiler_private.h.

◆ bwriterdeclusage

Enumerator
BWRITERDECLUSAGE_POSITION 
BWRITERDECLUSAGE_BLENDWEIGHT 
BWRITERDECLUSAGE_BLENDINDICES 
BWRITERDECLUSAGE_NORMAL 
BWRITERDECLUSAGE_PSIZE 
BWRITERDECLUSAGE_TEXCOORD 
BWRITERDECLUSAGE_TANGENT 
BWRITERDECLUSAGE_BINORMAL 
BWRITERDECLUSAGE_TESSFACTOR 
BWRITERDECLUSAGE_POSITIONT 
BWRITERDECLUSAGE_COLOR 
BWRITERDECLUSAGE_FOG 
BWRITERDECLUSAGE_DEPTH 
BWRITERDECLUSAGE_SAMPLE 

Definition at line 572 of file d3dcompiler_private.h.

573{
588};
@ BWRITERDECLUSAGE_BLENDWEIGHT
@ BWRITERDECLUSAGE_FOG
@ BWRITERDECLUSAGE_NORMAL
@ BWRITERDECLUSAGE_PSIZE
@ BWRITERDECLUSAGE_COLOR
@ BWRITERDECLUSAGE_POSITION
@ BWRITERDECLUSAGE_BINORMAL
@ BWRITERDECLUSAGE_TANGENT
@ BWRITERDECLUSAGE_TESSFACTOR
@ BWRITERDECLUSAGE_DEPTH
@ BWRITERDECLUSAGE_BLENDINDICES
@ BWRITERDECLUSAGE_POSITIONT
@ BWRITERDECLUSAGE_TEXCOORD
@ BWRITERDECLUSAGE_SAMPLE

◆ bwritersampler_texture_type

Enumerator
BWRITERSTT_UNKNOWN 
BWRITERSTT_1D 
BWRITERSTT_2D 
BWRITERSTT_CUBE 
BWRITERSTT_VOLUME 

Definition at line 506 of file d3dcompiler_private.h.

507{
509 BWRITERSTT_1D = 1,
510 BWRITERSTT_2D = 2,
511 BWRITERSTT_CUBE = 3,
513};
@ BWRITERSTT_CUBE
@ BWRITERSTT_UNKNOWN
@ BWRITERSTT_VOLUME
@ BWRITERSTT_2D
@ BWRITERSTT_1D

◆ bwritershader_instruction_opcode_type

Enumerator
BWRITERSIO_NOP 
BWRITERSIO_MOV 
BWRITERSIO_ADD 
BWRITERSIO_SUB 
BWRITERSIO_MAD 
BWRITERSIO_MUL 
BWRITERSIO_RCP 
BWRITERSIO_RSQ 
BWRITERSIO_DP3 
BWRITERSIO_DP4 
BWRITERSIO_MIN 
BWRITERSIO_MAX 
BWRITERSIO_SLT 
BWRITERSIO_SGE 
BWRITERSIO_EXP 
BWRITERSIO_LOG 
BWRITERSIO_LIT 
BWRITERSIO_DST 
BWRITERSIO_LRP 
BWRITERSIO_FRC 
BWRITERSIO_M4x4 
BWRITERSIO_M4x3 
BWRITERSIO_M3x4 
BWRITERSIO_M3x3 
BWRITERSIO_M3x2 
BWRITERSIO_CALL 
BWRITERSIO_CALLNZ 
BWRITERSIO_LOOP 
BWRITERSIO_RET 
BWRITERSIO_ENDLOOP 
BWRITERSIO_LABEL 
BWRITERSIO_DCL 
BWRITERSIO_POW 
BWRITERSIO_CRS 
BWRITERSIO_SGN 
BWRITERSIO_ABS 
BWRITERSIO_NRM 
BWRITERSIO_SINCOS 
BWRITERSIO_REP 
BWRITERSIO_ENDREP 
BWRITERSIO_IF 
BWRITERSIO_IFC 
BWRITERSIO_ELSE 
BWRITERSIO_ENDIF 
BWRITERSIO_BREAK 
BWRITERSIO_BREAKC 
BWRITERSIO_MOVA 
BWRITERSIO_DEFB 
BWRITERSIO_DEFI 
BWRITERSIO_TEXCOORD 
BWRITERSIO_TEXKILL 
BWRITERSIO_TEX 
BWRITERSIO_TEXBEM 
BWRITERSIO_TEXBEML 
BWRITERSIO_TEXREG2AR 
BWRITERSIO_TEXREG2GB 
BWRITERSIO_TEXM3x2PAD 
BWRITERSIO_TEXM3x2TEX 
BWRITERSIO_TEXM3x3PAD 
BWRITERSIO_TEXM3x3TEX 
BWRITERSIO_TEXM3x3SPEC 
BWRITERSIO_TEXM3x3VSPEC 
BWRITERSIO_EXPP 
BWRITERSIO_LOGP 
BWRITERSIO_CND 
BWRITERSIO_DEF 
BWRITERSIO_TEXREG2RGB 
BWRITERSIO_TEXDP3TEX 
BWRITERSIO_TEXM3x2DEPTH 
BWRITERSIO_TEXDP3 
BWRITERSIO_TEXM3x3 
BWRITERSIO_TEXDEPTH 
BWRITERSIO_CMP 
BWRITERSIO_BEM 
BWRITERSIO_DP2ADD 
BWRITERSIO_DSX 
BWRITERSIO_DSY 
BWRITERSIO_TEXLDD 
BWRITERSIO_SETP 
BWRITERSIO_TEXLDL 
BWRITERSIO_BREAKP 
BWRITERSIO_TEXLDP 
BWRITERSIO_TEXLDB 
BWRITERSIO_PHASE 
BWRITERSIO_COMMENT 
BWRITERSIO_END 

Definition at line 371 of file d3dcompiler_private.h.

372{
422
457
461};
@ BWRITERSIO_EXP
@ BWRITERSIO_TEXBEML
@ BWRITERSIO_DSX
@ BWRITERSIO_LRP
@ BWRITERSIO_MAX
@ BWRITERSIO_TEXLDB
@ BWRITERSIO_BEM
@ BWRITERSIO_RCP
@ BWRITERSIO_MOV
@ BWRITERSIO_POW
@ BWRITERSIO_NRM
@ BWRITERSIO_DEF
@ BWRITERSIO_TEXM3x3TEX
@ BWRITERSIO_DEFB
@ BWRITERSIO_MIN
@ BWRITERSIO_TEXM3x2PAD
@ BWRITERSIO_DP2ADD
@ BWRITERSIO_SGE
@ BWRITERSIO_CALLNZ
@ BWRITERSIO_MUL
@ BWRITERSIO_BREAK
@ BWRITERSIO_END
@ BWRITERSIO_CALL
@ BWRITERSIO_TEXM3x3PAD
@ BWRITERSIO_ENDREP
@ BWRITERSIO_CND
@ BWRITERSIO_BREAKP
@ BWRITERSIO_SGN
@ BWRITERSIO_M3x4
@ BWRITERSIO_TEXDP3
@ BWRITERSIO_LOOP
@ BWRITERSIO_TEX
@ BWRITERSIO_TEXREG2AR
@ BWRITERSIO_TEXLDD
@ BWRITERSIO_TEXM3x3SPEC
@ BWRITERSIO_DCL
@ BWRITERSIO_TEXM3x2DEPTH
@ BWRITERSIO_EXPP
@ BWRITERSIO_TEXCOORD
@ BWRITERSIO_MOVA
@ BWRITERSIO_ENDIF
@ BWRITERSIO_TEXREG2RGB
@ BWRITERSIO_IFC
@ BWRITERSIO_TEXBEM
@ BWRITERSIO_MAD
@ BWRITERSIO_CRS
@ BWRITERSIO_FRC
@ BWRITERSIO_LABEL
@ BWRITERSIO_SINCOS
@ BWRITERSIO_ADD
@ BWRITERSIO_M4x3
@ BWRITERSIO_M3x2
@ BWRITERSIO_TEXM3x3VSPEC
@ BWRITERSIO_TEXLDL
@ BWRITERSIO_DSY
@ BWRITERSIO_SUB
@ BWRITERSIO_TEXDP3TEX
@ BWRITERSIO_TEXDEPTH
@ BWRITERSIO_TEXKILL
@ BWRITERSIO_M4x4
@ BWRITERSIO_DP4
@ BWRITERSIO_ELSE
@ BWRITERSIO_LIT
@ BWRITERSIO_IF
@ BWRITERSIO_LOGP
@ BWRITERSIO_RET
@ BWRITERSIO_CMP
@ BWRITERSIO_DP3
@ BWRITERSIO_LOG
@ BWRITERSIO_PHASE
@ BWRITERSIO_M3x3
@ BWRITERSIO_TEXLDP
@ BWRITERSIO_REP
@ BWRITERSIO_DEFI
@ BWRITERSIO_ENDLOOP
@ BWRITERSIO_TEXM3x2TEX
@ BWRITERSIO_SETP
@ BWRITERSIO_RSQ
@ BWRITERSIO_TEXM3x3
@ BWRITERSIO_COMMENT
@ BWRITERSIO_TEXREG2GB
@ BWRITERSIO_BREAKC
@ BWRITERSIO_ABS
@ BWRITERSIO_DST
@ BWRITERSIO_SLT
@ BWRITERSIO_NOP

◆ bwritershader_param_dstmod_type

Enumerator
BWRITERSPDM_NONE 
BWRITERSPDM_SATURATE 
BWRITERSPDM_PARTIALPRECISION 
BWRITERSPDM_MSAMPCENTROID 

Definition at line 498 of file d3dcompiler_private.h.

499{
504};
@ BWRITERSPDM_SATURATE
@ BWRITERSPDM_PARTIALPRECISION
@ BWRITERSPDM_MSAMPCENTROID
@ BWRITERSPDM_NONE

◆ bwritershader_param_register_type

Enumerator
BWRITERSPR_TEMP 
BWRITERSPR_INPUT 
BWRITERSPR_CONST 
BWRITERSPR_ADDR 
BWRITERSPR_TEXTURE 
BWRITERSPR_RASTOUT 
BWRITERSPR_ATTROUT 
BWRITERSPR_TEXCRDOUT 
BWRITERSPR_OUTPUT 
BWRITERSPR_CONSTINT 
BWRITERSPR_COLOROUT 
BWRITERSPR_DEPTHOUT 
BWRITERSPR_SAMPLER 
BWRITERSPR_CONSTBOOL 
BWRITERSPR_LOOP 
BWRITERSPR_MISCTYPE 
BWRITERSPR_LABEL 
BWRITERSPR_PREDICATE 

Definition at line 463 of file d3dcompiler_private.h.

464{
483};
@ BWRITERSPR_TEXCRDOUT
@ BWRITERSPR_CONSTINT
@ BWRITERSPR_MISCTYPE
@ BWRITERSPR_RASTOUT
@ BWRITERSPR_LOOP
@ BWRITERSPR_CONSTBOOL
@ BWRITERSPR_COLOROUT
@ BWRITERSPR_SAMPLER
@ BWRITERSPR_CONST
@ BWRITERSPR_TEXTURE
@ BWRITERSPR_DEPTHOUT
@ BWRITERSPR_ADDR
@ BWRITERSPR_ATTROUT
@ BWRITERSPR_TEMP
@ BWRITERSPR_INPUT
@ BWRITERSPR_PREDICATE
@ BWRITERSPR_LABEL
@ BWRITERSPR_OUTPUT

◆ bwritershader_param_srcmod_type

Enumerator
BWRITERSPSM_NONE 
BWRITERSPSM_NEG 
BWRITERSPSM_BIAS 
BWRITERSPSM_BIASNEG 
BWRITERSPSM_SIGN 
BWRITERSPSM_SIGNNEG 
BWRITERSPSM_COMP 
BWRITERSPSM_X2 
BWRITERSPSM_X2NEG 
BWRITERSPSM_DZ 
BWRITERSPSM_DW 
BWRITERSPSM_ABS 
BWRITERSPSM_ABSNEG 
BWRITERSPSM_NOT 

Definition at line 518 of file d3dcompiler_private.h.

519{
534};
@ BWRITERSPSM_COMP
@ BWRITERSPSM_X2
@ BWRITERSPSM_ABS
@ BWRITERSPSM_NONE
@ BWRITERSPSM_BIAS
@ BWRITERSPSM_X2NEG
@ BWRITERSPSM_NEG
@ BWRITERSPSM_SIGNNEG
@ BWRITERSPSM_BIASNEG
@ BWRITERSPSM_DZ
@ BWRITERSPSM_ABSNEG
@ BWRITERSPSM_NOT
@ BWRITERSPSM_SIGN
@ BWRITERSPSM_DW

◆ bwritervs_rastout_offsets

Enumerator
BWRITERSRO_POSITION 
BWRITERSRO_FOG 
BWRITERSRO_POINT_SIZE 

Definition at line 485 of file d3dcompiler_private.h.

486{
490};
@ BWRITERSRO_POSITION
@ BWRITERSRO_FOG
@ BWRITERSRO_POINT_SIZE

◆ hlsl_base_type

Enumerator
HLSL_TYPE_FLOAT 
HLSL_TYPE_HALF 
HLSL_TYPE_DOUBLE 
HLSL_TYPE_INT 
HLSL_TYPE_UINT 
HLSL_TYPE_BOOL 
HLSL_TYPE_LAST_SCALAR 
HLSL_TYPE_SAMPLER 
HLSL_TYPE_TEXTURE 
HLSL_TYPE_PIXELSHADER 
HLSL_TYPE_VERTEXSHADER 
HLSL_TYPE_STRING 
HLSL_TYPE_VOID 

Definition at line 637 of file d3dcompiler_private.h.

◆ hlsl_error_level

Enumerator
HLSL_LEVEL_ERROR 
HLSL_LEVEL_WARNING 
HLSL_LEVEL_NOTE 

Definition at line 1058 of file d3dcompiler_private.h.

1059{
1060 HLSL_LEVEL_ERROR = 0,
1063};
@ HLSL_LEVEL_NOTE
@ HLSL_LEVEL_WARNING
@ HLSL_LEVEL_ERROR

◆ hlsl_ir_deref_type

Enumerator
HLSL_IR_DEREF_VAR 
HLSL_IR_DEREF_ARRAY 
HLSL_IR_DEREF_RECORD 

Definition at line 907 of file d3dcompiler_private.h.

908{
912};
@ HLSL_IR_DEREF_ARRAY
@ HLSL_IR_DEREF_RECORD
@ HLSL_IR_DEREF_VAR

◆ hlsl_ir_expr_op

Enumerator
HLSL_IR_UNOP_BIT_NOT 
HLSL_IR_UNOP_LOGIC_NOT 
HLSL_IR_UNOP_NEG 
HLSL_IR_UNOP_ABS 
HLSL_IR_UNOP_SIGN 
HLSL_IR_UNOP_RCP 
HLSL_IR_UNOP_RSQ 
HLSL_IR_UNOP_SQRT 
HLSL_IR_UNOP_NRM 
HLSL_IR_UNOP_EXP2 
HLSL_IR_UNOP_LOG2 
HLSL_IR_UNOP_CAST 
HLSL_IR_UNOP_FRACT 
HLSL_IR_UNOP_SIN 
HLSL_IR_UNOP_COS 
HLSL_IR_UNOP_SIN_REDUCED 
HLSL_IR_UNOP_COS_REDUCED 
HLSL_IR_UNOP_DSX 
HLSL_IR_UNOP_DSY 
HLSL_IR_UNOP_SAT 
HLSL_IR_UNOP_PREINC 
HLSL_IR_UNOP_PREDEC 
HLSL_IR_UNOP_POSTINC 
HLSL_IR_UNOP_POSTDEC 
HLSL_IR_BINOP_ADD 
HLSL_IR_BINOP_SUB 
HLSL_IR_BINOP_MUL 
HLSL_IR_BINOP_DIV 
HLSL_IR_BINOP_MOD 
HLSL_IR_BINOP_LESS 
HLSL_IR_BINOP_GREATER 
HLSL_IR_BINOP_LEQUAL 
HLSL_IR_BINOP_GEQUAL 
HLSL_IR_BINOP_EQUAL 
HLSL_IR_BINOP_NEQUAL 
HLSL_IR_BINOP_LOGIC_AND 
HLSL_IR_BINOP_LOGIC_OR 
HLSL_IR_BINOP_LSHIFT 
HLSL_IR_BINOP_RSHIFT 
HLSL_IR_BINOP_BIT_AND 
HLSL_IR_BINOP_BIT_OR 
HLSL_IR_BINOP_BIT_XOR 
HLSL_IR_BINOP_DOT 
HLSL_IR_BINOP_CRS 
HLSL_IR_BINOP_MIN 
HLSL_IR_BINOP_MAX 
HLSL_IR_BINOP_POW 
HLSL_IR_TEROP_LERP 
HLSL_IR_SEQUENCE 

Definition at line 810 of file d3dcompiler_private.h.

810 {
822
824
826
829 HLSL_IR_UNOP_SIN_REDUCED, /* Reduced range [-pi, pi] */
830 HLSL_IR_UNOP_COS_REDUCED, /* Reduced range [-pi, pi] */
831
834
836
841
846
848
855
858
864
869
871
873
875};
@ HLSL_IR_UNOP_SQRT
@ HLSL_IR_BINOP_SUB
@ HLSL_IR_UNOP_LOG2
@ HLSL_IR_UNOP_LOGIC_NOT
@ HLSL_IR_UNOP_POSTINC
@ HLSL_IR_BINOP_LSHIFT
@ HLSL_IR_UNOP_PREINC
@ HLSL_IR_UNOP_EXP2
@ HLSL_IR_BINOP_BIT_XOR
@ HLSL_IR_BINOP_ADD
@ HLSL_IR_BINOP_LESS
@ HLSL_IR_UNOP_SIGN
@ HLSL_IR_BINOP_POW
@ HLSL_IR_BINOP_MOD
@ HLSL_IR_UNOP_RCP
@ HLSL_IR_BINOP_DOT
@ HLSL_IR_BINOP_GREATER
@ HLSL_IR_UNOP_SIN
@ HLSL_IR_BINOP_DIV
@ HLSL_IR_BINOP_LOGIC_AND
@ HLSL_IR_BINOP_BIT_AND
@ HLSL_IR_BINOP_MIN
@ HLSL_IR_UNOP_COS
@ HLSL_IR_BINOP_LOGIC_OR
@ HLSL_IR_SEQUENCE
@ HLSL_IR_UNOP_SAT
@ HLSL_IR_BINOP_NEQUAL
@ HLSL_IR_BINOP_LEQUAL
@ HLSL_IR_UNOP_NEG
@ HLSL_IR_UNOP_CAST
@ HLSL_IR_BINOP_CRS
@ HLSL_IR_UNOP_SIN_REDUCED
@ HLSL_IR_BINOP_BIT_OR
@ HLSL_IR_UNOP_COS_REDUCED
@ HLSL_IR_UNOP_ABS
@ HLSL_IR_UNOP_PREDEC
@ HLSL_IR_BINOP_MAX
@ HLSL_IR_BINOP_MUL
@ HLSL_IR_BINOP_EQUAL
@ HLSL_IR_BINOP_RSHIFT
@ HLSL_IR_UNOP_RSQ
@ HLSL_IR_UNOP_FRACT
@ HLSL_IR_BINOP_GEQUAL
@ HLSL_IR_UNOP_DSX
@ HLSL_IR_TEROP_LERP
@ HLSL_IR_UNOP_POSTDEC
@ HLSL_IR_UNOP_BIT_NOT
@ HLSL_IR_UNOP_DSY
@ HLSL_IR_UNOP_NRM

◆ hlsl_ir_jump_type

Enumerator
HLSL_IR_JUMP_BREAK 
HLSL_IR_JUMP_CONTINUE 
HLSL_IR_JUMP_DISCARD 
HLSL_IR_JUMP_RETURN 

Definition at line 885 of file d3dcompiler_private.h.

886{
891};
@ HLSL_IR_JUMP_DISCARD
@ HLSL_IR_JUMP_RETURN
@ HLSL_IR_JUMP_CONTINUE
@ HLSL_IR_JUMP_BREAK

◆ hlsl_ir_node_type

Enumerator
HLSL_IR_ASSIGNMENT 
HLSL_IR_CONSTANT 
HLSL_IR_CONSTRUCTOR 
HLSL_IR_DEREF 
HLSL_IR_EXPR 
HLSL_IR_IF 
HLSL_IR_LOOP 
HLSL_IR_JUMP 
HLSL_IR_SWIZZLE 

Definition at line 707 of file d3dcompiler_private.h.

708{
718};
@ HLSL_IR_LOOP
@ HLSL_IR_SWIZZLE
@ HLSL_IR_IF
@ HLSL_IR_CONSTANT
@ HLSL_IR_CONSTRUCTOR
@ HLSL_IR_EXPR
@ HLSL_IR_JUMP
@ HLSL_IR_ASSIGNMENT
@ HLSL_IR_DEREF

◆ hlsl_matrix_majority

Enumerator
HLSL_COLUMN_MAJOR 
HLSL_ROW_MAJOR 

Definition at line 663 of file d3dcompiler_private.h.

664{
667};
@ HLSL_ROW_MAJOR
@ HLSL_COLUMN_MAJOR

◆ hlsl_sampler_dim

Enumerator
HLSL_SAMPLER_DIM_GENERIC 
HLSL_SAMPLER_DIM_1D 
HLSL_SAMPLER_DIM_2D 
HLSL_SAMPLER_DIM_3D 
HLSL_SAMPLER_DIM_CUBE 

Definition at line 654 of file d3dcompiler_private.h.

◆ hlsl_type_class

Enumerator
HLSL_CLASS_SCALAR 
HLSL_CLASS_VECTOR 
HLSL_CLASS_MATRIX 
HLSL_CLASS_LAST_NUMERIC 
HLSL_CLASS_STRUCT 
HLSL_CLASS_ARRAY 
HLSL_CLASS_OBJECT 

Definition at line 626 of file d3dcompiler_private.h.

◆ parse_assign_op

Enumerator
ASSIGN_OP_ASSIGN 
ASSIGN_OP_ADD 
ASSIGN_OP_SUB 
ASSIGN_OP_MUL 
ASSIGN_OP_DIV 
ASSIGN_OP_MOD 
ASSIGN_OP_LSHIFT 
ASSIGN_OP_RSHIFT 
ASSIGN_OP_AND 
ASSIGN_OP_OR 
ASSIGN_OP_XOR 

Definition at line 1021 of file d3dcompiler_private.h.

1022{
1034};
@ ASSIGN_OP_DIV
@ ASSIGN_OP_MUL
@ ASSIGN_OP_AND
@ ASSIGN_OP_MOD
@ ASSIGN_OP_XOR
@ ASSIGN_OP_OR
@ ASSIGN_OP_SUB
@ ASSIGN_OP_LSHIFT
@ ASSIGN_OP_ASSIGN
@ ASSIGN_OP_RSHIFT
@ ASSIGN_OP_ADD

◆ parse_status

Enumerator
PARSE_SUCCESS 
PARSE_WARN 
PARSE_ERR 

Definition at line 236 of file d3dcompiler_private.h.

237{
238 PARSE_SUCCESS = 0,
239 PARSE_WARN = 1,
240 PARSE_ERR = 2
241};
@ PARSE_WARN
@ PARSE_SUCCESS
@ PARSE_ERR

◆ parse_unary_op

Enumerator
UNARY_OP_PLUS 
UNARY_OP_MINUS 
UNARY_OP_LOGICNOT 
UNARY_OP_BITNOT 

Definition at line 1013 of file d3dcompiler_private.h.

1014{
1019};
@ UNARY_OP_LOGICNOT
@ UNARY_OP_BITNOT
@ UNARY_OP_PLUS
@ UNARY_OP_MINUS

◆ shader_type

Enumerator
ST_UNKNOWN 
ST_VERTEX 
ST_PIXEL 

Definition at line 51 of file d3dcompiler_private.h.

52{
56};
@ ST_VERTEX
@ ST_UNKNOWN
@ ST_PIXEL

Function Documentation

◆ add_constB()

BOOL add_constB ( struct bwriter_shader shader,
DWORD  reg,
BOOL  x 
)

Definition at line 178 of file bytecodewriter.c.

178 {
179 struct constant *newconst;
180
181 if(shader->num_cb) {
182 struct constant **newarray;
183 newarray = d3dcompiler_realloc(shader->constB,
184 sizeof(*shader->constB) * (shader->num_cb + 1));
185 if(!newarray) {
186 ERR("Failed to grow the constants array\n");
187 return FALSE;
188 }
189 shader->constB = newarray;
190 } else {
191 shader->constB = d3dcompiler_alloc(sizeof(*shader->constB));
192 if(!shader->constB) {
193 ERR("Failed to allocate the constants array\n");
194 return FALSE;
195 }
196 }
197
198 newconst = d3dcompiler_alloc(sizeof(*newconst));
199 if(!newconst) {
200 ERR("Failed to allocate a new constant\n");
201 return FALSE;
202 }
203 newconst->regnum = reg;
204 newconst->value[0].b = x;
205 shader->constB[shader->num_cb] = newconst;
206
207 shader->num_cb++;
208 return TRUE;
209}
#define ERR(fmt,...)
Definition: debug.h:110
static void * d3dcompiler_realloc(void *ptr, SIZE_T size)
static void * d3dcompiler_alloc(SIZE_T size)
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint shader
Definition: glext.h:6030
static int reg
Definition: i386-dis.c:1290
union constant::@237 value[4]

Referenced by asmparser_constB().

◆ add_constF()

BOOL add_constF ( struct bwriter_shader shader,
DWORD  reg,
float  x,
float  y,
float  z,
float  w 
)

Definition at line 106 of file bytecodewriter.c.

106 {
107 struct constant *newconst;
108
109 if(shader->num_cf) {
110 struct constant **newarray;
111 newarray = d3dcompiler_realloc(shader->constF,
112 sizeof(*shader->constF) * (shader->num_cf + 1));
113 if(!newarray) {
114 ERR("Failed to grow the constants array\n");
115 return FALSE;
116 }
117 shader->constF = newarray;
118 } else {
119 shader->constF = d3dcompiler_alloc(sizeof(*shader->constF));
120 if(!shader->constF) {
121 ERR("Failed to allocate the constants array\n");
122 return FALSE;
123 }
124 }
125
126 newconst = d3dcompiler_alloc(sizeof(*newconst));
127 if(!newconst) {
128 ERR("Failed to allocate a new constant\n");
129 return FALSE;
130 }
131 newconst->regnum = reg;
132 newconst->value[0].f = x;
133 newconst->value[1].f = y;
134 newconst->value[2].f = z;
135 newconst->value[3].f = w;
136 shader->constF[shader->num_cf] = newconst;
137
138 shader->num_cf++;
139 return TRUE;
140}
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble z
Definition: glext.h:5874

Referenced by asmparser_constF().

◆ add_constI()

BOOL add_constI ( struct bwriter_shader shader,
DWORD  reg,
INT  x,
INT  y,
INT  z,
INT  w 
)

Definition at line 142 of file bytecodewriter.c.

142 {
143 struct constant *newconst;
144
145 if(shader->num_ci) {
146 struct constant **newarray;
147 newarray = d3dcompiler_realloc(shader->constI,
148 sizeof(*shader->constI) * (shader->num_ci + 1));
149 if(!newarray) {
150 ERR("Failed to grow the constants array\n");
151 return FALSE;
152 }
153 shader->constI = newarray;
154 } else {
155 shader->constI = d3dcompiler_alloc(sizeof(*shader->constI));
156 if(!shader->constI) {
157 ERR("Failed to allocate the constants array\n");
158 return FALSE;
159 }
160 }
161
162 newconst = d3dcompiler_alloc(sizeof(*newconst));
163 if(!newconst) {
164 ERR("Failed to allocate a new constant\n");
165 return FALSE;
166 }
167 newconst->regnum = reg;
168 newconst->value[0].i = x;
169 newconst->value[1].i = y;
170 newconst->value[2].i = z;
171 newconst->value[3].i = w;
172 shader->constI[shader->num_ci] = newconst;
173
174 shader->num_ci++;
175 return TRUE;
176}

Referenced by asmparser_constI().

◆ add_declaration()

BOOL add_declaration ( struct hlsl_scope scope,
struct hlsl_ir_var decl,
BOOL  local_var 
)

Definition at line 761 of file utils.c.

762{
763 struct hlsl_ir_var *var;
764
765 LIST_FOR_EACH_ENTRY(var, &scope->vars, struct hlsl_ir_var, scope_entry)
766 {
767 if (!strcmp(decl->name, var->name))
768 return FALSE;
769 }
770 if (local_var && scope->upper->upper == hlsl_ctx.globals)
771 {
772 /* Check whether the variable redefines a function parameter. */
773 LIST_FOR_EACH_ENTRY(var, &scope->upper->vars, struct hlsl_ir_var, scope_entry)
774 {
775 if (!strcmp(decl->name, var->name))
776 return FALSE;
777 }
778 }
779
780 list_add_tail(&scope->vars, &decl->scope_entry);
781 return TRUE;
782}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
const char * var
Definition: shader.c:5666
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
const char * name
struct list vars
struct hlsl_scope * upper

◆ add_function_decl()

void add_function_decl ( struct wine_rb_tree funcs,
char name,
struct hlsl_ir_function_decl decl,
BOOL  intrinsic 
)

Definition at line 2282 of file utils.c.

2283{
2284 struct hlsl_ir_function *func;
2285 struct wine_rb_entry *func_entry, *old_entry;
2286
2287 func_entry = wine_rb_get(funcs, name);
2288 if (func_entry)
2289 {
2290 func = WINE_RB_ENTRY_VALUE(func_entry, struct hlsl_ir_function, entry);
2291 if (intrinsic != func->intrinsic)
2292 {
2293 if (intrinsic)
2294 {
2295 ERR("Redeclaring a user defined function as an intrinsic.\n");
2296 return;
2297 }
2298 TRACE("Function %s redeclared as a user defined function.\n", debugstr_a(name));
2299 func->intrinsic = intrinsic;
2302 }
2303 decl->func = func;
2304 if ((old_entry = wine_rb_get(&func->overloads, decl->parameters)))
2305 {
2306 struct hlsl_ir_function_decl *old_decl =
2308
2309 if (!decl->body)
2310 {
2311 free_function_decl(decl);
2313 return;
2314 }
2315 wine_rb_remove(&func->overloads, old_entry);
2316 free_function_decl(old_decl);
2317 }
2318 wine_rb_put(&func->overloads, decl->parameters, &decl->entry);
2320 return;
2321 }
2322 func = d3dcompiler_alloc(sizeof(*func));
2323 func->name = name;
2325 decl->func = func;
2326 wine_rb_put(&func->overloads, decl->parameters, &decl->entry);
2327 func->intrinsic = intrinsic;
2328 wine_rb_put(funcs, func->name, &func->entry);
2329}
static BOOL d3dcompiler_free(void *ptr)
#define NULL
Definition: types.h:112
static void free_function_decl_rb(struct wine_rb_entry *entry, void *context)
Definition: utils.c:2265
static int compare_function_decl_rb(const void *key, const struct wine_rb_entry *entry)
Definition: utils.c:1627
static void free_function_decl(struct hlsl_ir_function_decl *decl)
Definition: utils.c:2257
GLenum func
Definition: glext.h:6028
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
static void wine_rb_remove(struct wine_rb_tree *tree, struct wine_rb_entry *entry)
Definition: rbtree.h:283
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
static struct __wine_debug_functions funcs
Definition: debug.c:59
#define TRACE(s)
Definition: solgame.cpp:4
struct wine_rb_entry entry
struct hlsl_ir_function * func
Definition: name.c:39
Definition: rbtree.h:36

◆ add_instruction()

BOOL add_instruction ( struct bwriter_shader shader,
struct instruction instr 
)

Definition at line 75 of file bytecodewriter.c.

75 {
76 struct instruction **new_instructions;
77
78 if(!shader) return FALSE;
79
80 if(shader->instr_alloc_size == 0) {
81 shader->instr = d3dcompiler_alloc(sizeof(*shader->instr) * INSTRARRAY_INITIAL_SIZE);
82 if(!shader->instr) {
83 ERR("Failed to allocate the shader instruction array\n");
84 return FALSE;
85 }
86 shader->instr_alloc_size = INSTRARRAY_INITIAL_SIZE;
87 } else if(shader->instr_alloc_size == shader->num_instrs) {
88 new_instructions = d3dcompiler_realloc(shader->instr,
89 sizeof(*shader->instr) * (shader->instr_alloc_size) * 2);
90 if(!new_instructions) {
91 ERR("Failed to grow the shader instruction array\n");
92 return FALSE;
93 }
94 shader->instr = new_instructions;
95 shader->instr_alloc_size = shader->instr_alloc_size * 2;
96 } else if(shader->num_instrs > shader->instr_alloc_size) {
97 ERR("More instructions than allocated. This should not happen\n");
98 return FALSE;
99 }
100
101 shader->instr[shader->num_instrs] = instr;
102 shader->num_instrs++;
103 return TRUE;
104}
#define INSTRARRAY_INITIAL_SIZE

Referenced by asmparser_instr(), asmparser_sincos(), asmparser_texcoord(), asmparser_texcrd(), asmparser_texhelper(), asmparser_texkill(), and asmparser_texld14().

◆ alloc_instr()

struct instruction * alloc_instr ( unsigned int  srcs)

Definition at line 44 of file bytecodewriter.c.

44 {
45 struct instruction *ret = d3dcompiler_alloc(sizeof(*ret));
46 if(!ret) {
47 ERR("Failed to allocate memory for an instruction structure\n");
48 return NULL;
49 }
50
51 if(srcs) {
52 ret->src = d3dcompiler_alloc(srcs * sizeof(*ret->src));
53 if(!ret->src) {
54 ERR("Failed to allocate memory for instruction registers\n");
56 return NULL;
57 }
58 ret->num_srcs = srcs;
59 }
60 return ret;
61}
int ret

Referenced by asmparser_instr(), asmparser_sincos(), asmparser_texcoord(), asmparser_texcrd(), asmparser_texhelper(), asmparser_texkill(), and asmparser_texld14().

◆ asmparser_message()

◆ assignment_from_node()

static struct hlsl_ir_assignment * assignment_from_node ( const struct hlsl_ir_node node)
inlinestatic

Definition at line 1093 of file d3dcompiler_private.h.

1094{
1095 assert(node->type == HLSL_IR_ASSIGNMENT);
1097}
#define assert(x)
Definition: debug.h:53
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
Definition: dlist.c:348

Referenced by debug_dump_instr(), and free_instr().

◆ clone_hlsl_type()

struct hlsl_type * clone_hlsl_type ( struct hlsl_type old)

Definition at line 929 of file utils.c.

930{
931 struct hlsl_type *type;
932 struct hlsl_struct_field *old_field, *field;
933
934 type = d3dcompiler_alloc(sizeof(*type));
935 if (!type)
936 {
937 ERR("Out of memory\n");
938 return NULL;
939 }
940 if (old->name)
941 {
943 if (!type->name)
944 {
946 return NULL;
947 }
948 }
949 type->type = old->type;
950 type->base_type = old->base_type;
951 type->dimx = old->dimx;
952 type->dimy = old->dimy;
953 type->modifiers = old->modifiers;
954 type->sampler_dim = old->sampler_dim;
955 switch (old->type)
956 {
957 case HLSL_CLASS_ARRAY:
958 type->e.array.type = old->e.array.type;
959 type->e.array.elements_count = old->e.array.elements_count;
960 break;
962 type->e.elements = d3dcompiler_alloc(sizeof(*type->e.elements));
963 if (!type->e.elements)
964 {
965 d3dcompiler_free((void *)type->name);
967 return NULL;
968 }
969 list_init(type->e.elements);
970 LIST_FOR_EACH_ENTRY(old_field, old->e.elements, struct hlsl_struct_field, entry)
971 {
972 field = d3dcompiler_alloc(sizeof(*field));
973 if (!field)
974 {
975 LIST_FOR_EACH_ENTRY_SAFE(field, old_field, type->e.elements, struct hlsl_struct_field, entry)
976 {
977 d3dcompiler_free((void *)field->semantic);
978 d3dcompiler_free((void *)field->name);
980 }
981 d3dcompiler_free(type->e.elements);
982 d3dcompiler_free((void *)type->name);
984 return NULL;
985 }
986 field->type = clone_hlsl_type(old_field->type);
987 field->name = d3dcompiler_strdup(old_field->name);
988 if (old_field->semantic)
989 field->semantic = d3dcompiler_strdup(old_field->semantic);
990 field->modifiers = old_field->modifiers;
991 list_add_tail(type->e.elements, &field->entry);
992 }
993 break;
994 default:
995 break;
996 }
997
998 list_add_tail(&hlsl_ctx.types, &type->entry);
999 return type;
1000}
static void list_init(struct list_entry *head)
Definition: list.h:51
static char * d3dcompiler_strdup(const char *string)
struct hlsl_type * clone_hlsl_type(struct hlsl_type *old)
Definition: utils.c:929
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
char * name
Definition: compiler.c:66
Definition: parser.c:44
struct hlsl_type * type
unsigned int dimx
struct hlsl_type::@239::@240 array
struct list * elements
enum hlsl_base_type base_type
unsigned int modifiers
enum hlsl_sampler_dim sampler_dim
const char * name
enum hlsl_type_class type
union hlsl_type::@239 e
unsigned int dimy

Referenced by clone_hlsl_type().

◆ compare_hlsl_types()

BOOL compare_hlsl_types ( const struct hlsl_type t1,
const struct hlsl_type t2 
)

Definition at line 883 of file utils.c.

884{
885 if (t1 == t2)
886 return TRUE;
887
888 if (t1->type != t2->type)
889 return FALSE;
890 if (t1->base_type != t2->base_type)
891 return FALSE;
892 if (t1->base_type == HLSL_TYPE_SAMPLER && t1->sampler_dim != t2->sampler_dim)
893 return FALSE;
896 return FALSE;
897 if (t1->dimx != t2->dimx)
898 return FALSE;
899 if (t1->dimy != t2->dimy)
900 return FALSE;
901 if (t1->type == HLSL_CLASS_STRUCT)
902 {
903 struct list *t1cur, *t2cur;
904 struct hlsl_struct_field *t1field, *t2field;
905
906 t1cur = list_head(t1->e.elements);
907 t2cur = list_head(t2->e.elements);
908 while (t1cur && t2cur)
909 {
910 t1field = LIST_ENTRY(t1cur, struct hlsl_struct_field, entry);
911 t2field = LIST_ENTRY(t2cur, struct hlsl_struct_field, entry);
912 if (!compare_hlsl_types(t1field->type, t2field->type))
913 return FALSE;
914 if (strcmp(t1field->name, t2field->name))
915 return FALSE;
916 t1cur = list_next(t1->e.elements, t1cur);
917 t2cur = list_next(t2->e.elements, t2cur);
918 }
919 if (t1cur != t2cur)
920 return FALSE;
921 }
922 if (t1->type == HLSL_CLASS_ARRAY)
923 return t1->e.array.elements_count == t2->e.array.elements_count
924 && compare_hlsl_types(t1->e.array.type, t2->e.array.type);
925
926 return TRUE;
927}
Definition: list.h:37
#define HLSL_MODIFIERS_COMPARISON_MASK
BOOL compare_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2)
Definition: utils.c:883
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by compare_hlsl_types(), compatible_data_types(), expr_common_type(), implicit_compatible_data_types(), implicit_conversion(), make_assignment(), and new_expr().

◆ compatible_data_types()

BOOL compatible_data_types ( struct hlsl_type s1,
struct hlsl_type s2 
)

Definition at line 1007 of file utils.c.

1008{
1010 return FALSE;
1011
1012 if (t1->type <= HLSL_CLASS_LAST_NUMERIC)
1013 {
1014 /* Scalar vars can be cast to pretty much everything */
1015 if (t1->dimx == 1 && t1->dimy == 1)
1016 return TRUE;
1017
1018 if (t1->type == HLSL_CLASS_VECTOR && t2->type == HLSL_CLASS_VECTOR)
1019 return t1->dimx >= t2->dimx;
1020 }
1021
1022 /* The other way around is true too i.e. whatever to scalar */
1023 if (t2->type <= HLSL_CLASS_LAST_NUMERIC && t2->dimx == 1 && t2->dimy == 1)
1024 return TRUE;
1025
1026 if (t1->type == HLSL_CLASS_ARRAY)
1027 {
1028 if (compare_hlsl_types(t1->e.array.type, t2))
1029 /* e.g. float4[3] to float4 is allowed */
1030 return TRUE;
1031
1032 if (t2->type == HLSL_CLASS_ARRAY || t2->type == HLSL_CLASS_STRUCT)
1034 else
1036 }
1037
1038 if (t1->type == HLSL_CLASS_STRUCT)
1040
1041 if (t2->type == HLSL_CLASS_ARRAY || t2->type == HLSL_CLASS_STRUCT)
1043
1044 if (t1->type == HLSL_CLASS_MATRIX || t2->type == HLSL_CLASS_MATRIX)
1045 {
1046 if (t1->type == HLSL_CLASS_MATRIX && t2->type == HLSL_CLASS_MATRIX && t1->dimx >= t2->dimx && t1->dimy >= t2->dimy)
1047 return TRUE;
1048
1049 /* Matrix-vector conversion is apparently allowed if they have the same components count */
1050 if ((t1->type == HLSL_CLASS_VECTOR || t2->type == HLSL_CLASS_VECTOR)
1052 return TRUE;
1053 return FALSE;
1054 }
1055
1057 return TRUE;
1058 return FALSE;
1059}
unsigned int components_count_type(struct hlsl_type *type)
Definition: utils.c:857
static BOOL convertible_data_type(struct hlsl_type *type)
Definition: utils.c:1002

◆ compilation_message()

void compilation_message ( struct compilation_messages msg,
const char fmt,
__ms_va_list  args 
)

Definition at line 719 of file utils.c.

720{
721 char* buffer;
722 int rc, size;
723
724 if (msg->capacity == 0)
725 {
727 if (msg->string == NULL)
728 {
729 ERR("Error allocating memory for parser messages\n");
730 return;
731 }
733 }
734
735 while (1)
736 {
737 rc = vsnprintf(msg->string + msg->size,
738 msg->capacity - msg->size, fmt, args);
739
740 if (rc < 0 || rc >= msg->capacity - msg->size)
741 {
742 size = msg->capacity * 2;
744 if (buffer == NULL)
745 {
746 ERR("Error reallocating memory for parser messages\n");
747 return;
748 }
749 msg->string = buffer;
750 msg->capacity = size;
751 }
752 else
753 {
754 TRACE("%s", msg->string + msg->size);
755 msg->size += rc;
756 return;
757 }
758 }
759}
#define msg(x)
Definition: auth_time.c:54
#define MESSAGEBUFFER_INITIAL_SIZE
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
Definition: dsound.c:943
#define vsnprintf
Definition: tif_win32.c:406

◆ components_count_type()

unsigned int components_count_type ( struct hlsl_type type)

Definition at line 857 of file utils.c.

858{
859 unsigned int count = 0;
860 struct hlsl_struct_field *field;
861
862 if (type->type <= HLSL_CLASS_LAST_NUMERIC)
863 {
864 return type->dimx * type->dimy;
865 }
866 if (type->type == HLSL_CLASS_ARRAY)
867 {
868 return components_count_type(type->e.array.type) * type->e.array.elements_count;
869 }
870 if (type->type != HLSL_CLASS_STRUCT)
871 {
872 ERR("Unexpected data type %s.\n", debug_hlsl_type(type));
873 return 0;
874 }
875
877 {
879 }
880 return count;
881}
const char * debug_hlsl_type(const struct hlsl_type *type)
Definition: utils.c:1695
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by compatible_data_types(), components_count_type(), expr_compatible_data_types(), and implicit_compatible_data_types().

◆ constant_from_node()

static struct hlsl_ir_constant * constant_from_node ( const struct hlsl_ir_node node)
inlinestatic

Definition at line 1081 of file d3dcompiler_private.h.

1082{
1083 assert(node->type == HLSL_IR_CONSTANT);
1085}

Referenced by debug_dump_instr(), and free_instr().

◆ constructor_from_node()

static struct hlsl_ir_constructor * constructor_from_node ( const struct hlsl_ir_node node)
inlinestatic

Definition at line 1105 of file d3dcompiler_private.h.

Referenced by debug_dump_instr(), and free_instr().

◆ create_ps10_parser()

void create_ps10_parser ( struct asm_parser ret)

Definition at line 1426 of file asmparser.c.

1426 {
1427 TRACE_(parsed_shader)("ps_1_0\n");
1428
1429 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1430 if(!ret->shader) {
1431 ERR("Failed to allocate memory for the shader\n");
1432 set_parse_status(&ret->status, PARSE_ERR);
1433 return;
1434 }
1435
1436 ret->shader->type = ST_PIXEL;
1437 ret->shader->version = BWRITERPS_VERSION(1, 0);
1438 ret->funcs = &parser_ps_1_0123;
1439 gen_oldps_input(ret->shader, 4);
1440}
static const struct asmparser_backend parser_ps_1_0123
Definition: asmparser.c:1209
static void gen_oldps_input(struct bwriter_shader *shader, DWORD texcoords)
Definition: asmparser.c:1325
static void set_parse_status(enum parse_status *current, enum parse_status update)
#define BWRITERPS_VERSION(major, minor)
#define TRACE_(x)
Definition: compat.h:76

◆ create_ps11_parser()

void create_ps11_parser ( struct asm_parser ret)

Definition at line 1442 of file asmparser.c.

1442 {
1443 TRACE_(parsed_shader)("ps_1_1\n");
1444
1445 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1446 if(!ret->shader) {
1447 ERR("Failed to allocate memory for the shader\n");
1448 set_parse_status(&ret->status, PARSE_ERR);
1449 return;
1450 }
1451
1452 ret->shader->type = ST_PIXEL;
1453 ret->shader->version = BWRITERPS_VERSION(1, 1);
1454 ret->funcs = &parser_ps_1_0123;
1455 gen_oldps_input(ret->shader, 4);
1456}

◆ create_ps12_parser()

void create_ps12_parser ( struct asm_parser ret)

Definition at line 1458 of file asmparser.c.

1458 {
1459 TRACE_(parsed_shader)("ps_1_2\n");
1460
1461 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1462 if(!ret->shader) {
1463 ERR("Failed to allocate memory for the shader\n");
1464 set_parse_status(&ret->status, PARSE_ERR);
1465 return;
1466 }
1467
1468 ret->shader->type = ST_PIXEL;
1469 ret->shader->version = BWRITERPS_VERSION(1, 2);
1470 ret->funcs = &parser_ps_1_0123;
1471 gen_oldps_input(ret->shader, 4);
1472}

◆ create_ps13_parser()

void create_ps13_parser ( struct asm_parser ret)

Definition at line 1474 of file asmparser.c.

1474 {
1475 TRACE_(parsed_shader)("ps_1_3\n");
1476
1477 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1478 if(!ret->shader) {
1479 ERR("Failed to allocate memory for the shader\n");
1480 set_parse_status(&ret->status, PARSE_ERR);
1481 return;
1482 }
1483
1484 ret->shader->type = ST_PIXEL;
1485 ret->shader->version = BWRITERPS_VERSION(1, 3);
1486 ret->funcs = &parser_ps_1_0123;
1487 gen_oldps_input(ret->shader, 4);
1488}

◆ create_ps14_parser()

void create_ps14_parser ( struct asm_parser ret)

Definition at line 1490 of file asmparser.c.

1490 {
1491 TRACE_(parsed_shader)("ps_1_4\n");
1492
1493 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1494 if(!ret->shader) {
1495 ERR("Failed to allocate memory for the shader\n");
1496 set_parse_status(&ret->status, PARSE_ERR);
1497 return;
1498 }
1499
1500 ret->shader->type = ST_PIXEL;
1501 ret->shader->version = BWRITERPS_VERSION(1, 4);
1502 ret->funcs = &parser_ps_1_4;
1503 gen_oldps_input(ret->shader, 6);
1504}
static const struct asmparser_backend parser_ps_1_4
Definition: asmparser.c:1229

◆ create_ps20_parser()

void create_ps20_parser ( struct asm_parser ret)

Definition at line 1506 of file asmparser.c.

1506 {
1507 TRACE_(parsed_shader)("ps_2_0\n");
1508
1509 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1510 if(!ret->shader) {
1511 ERR("Failed to allocate memory for the shader\n");
1512 set_parse_status(&ret->status, PARSE_ERR);
1513 return;
1514 }
1515
1516 ret->shader->type = ST_PIXEL;
1517 ret->shader->version = BWRITERPS_VERSION(2, 0);
1518 ret->funcs = &parser_ps_2;
1519 gen_oldps_input(ret->shader, 8);
1520}
static const struct asmparser_backend parser_ps_2
Definition: asmparser.c:1249

◆ create_ps2x_parser()

void create_ps2x_parser ( struct asm_parser ret)

Definition at line 1522 of file asmparser.c.

1522 {
1523 TRACE_(parsed_shader)("ps_2_x\n");
1524
1525 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1526 if(!ret->shader) {
1527 ERR("Failed to allocate memory for the shader\n");
1528 set_parse_status(&ret->status, PARSE_ERR);
1529 return;
1530 }
1531
1532 ret->shader->type = ST_PIXEL;
1533 ret->shader->version = BWRITERPS_VERSION(2, 1);
1534 ret->funcs = &parser_ps_2_x;
1535 gen_oldps_input(ret->shader, 8);
1536}
static const struct asmparser_backend parser_ps_2_x
Definition: asmparser.c:1269

◆ create_ps30_parser()

void create_ps30_parser ( struct asm_parser ret)

Definition at line 1538 of file asmparser.c.

1538 {
1539 TRACE_(parsed_shader)("ps_3_0\n");
1540
1541 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1542 if(!ret->shader) {
1543 ERR("Failed to allocate memory for the shader\n");
1544 set_parse_status(&ret->status, PARSE_ERR);
1545 return;
1546 }
1547
1548 ret->shader->type = ST_PIXEL;
1549 ret->shader->version = BWRITERPS_VERSION(3, 0);
1550 ret->funcs = &parser_ps_3;
1551}
static const struct asmparser_backend parser_ps_3
Definition: asmparser.c:1289

◆ create_vs10_parser()

void create_vs10_parser ( struct asm_parser ret)

Definition at line 1347 of file asmparser.c.

1347 {
1348 TRACE_(parsed_shader)("vs_1_0\n");
1349
1350 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1351 if(!ret->shader) {
1352 ERR("Failed to allocate memory for the shader\n");
1353 set_parse_status(&ret->status, PARSE_ERR);
1354 return;
1355 }
1356
1357 ret->shader->type = ST_VERTEX;
1358 ret->shader->version = BWRITERVS_VERSION(1, 0);
1359 ret->funcs = &parser_vs_1;
1360 gen_oldvs_output(ret->shader);
1361}
static const struct asmparser_backend parser_vs_1
Definition: asmparser.c:1149
static void gen_oldvs_output(struct bwriter_shader *shader)
Definition: asmparser.c:1309
#define BWRITERVS_VERSION(major, minor)

◆ create_vs11_parser()

void create_vs11_parser ( struct asm_parser ret)

Definition at line 1363 of file asmparser.c.

1363 {
1364 TRACE_(parsed_shader)("vs_1_1\n");
1365
1366 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1367 if(!ret->shader) {
1368 ERR("Failed to allocate memory for the shader\n");
1369 set_parse_status(&ret->status, PARSE_ERR);
1370 return;
1371 }
1372
1373 ret->shader->type = ST_VERTEX;
1374 ret->shader->version = BWRITERVS_VERSION(1, 1);
1375 ret->funcs = &parser_vs_1;
1376 gen_oldvs_output(ret->shader);
1377}

◆ create_vs20_parser()

void create_vs20_parser ( struct asm_parser ret)

Definition at line 1379 of file asmparser.c.

1379 {
1380 TRACE_(parsed_shader)("vs_2_0\n");
1381
1382 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1383 if(!ret->shader) {
1384 ERR("Failed to allocate memory for the shader\n");
1385 set_parse_status(&ret->status, PARSE_ERR);
1386 return;
1387 }
1388
1389 ret->shader->type = ST_VERTEX;
1390 ret->shader->version = BWRITERVS_VERSION(2, 0);
1391 ret->funcs = &parser_vs_2;
1392 gen_oldvs_output(ret->shader);
1393}
static const struct asmparser_backend parser_vs_2
Definition: asmparser.c:1169

◆ create_vs2x_parser()

void create_vs2x_parser ( struct asm_parser ret)

Definition at line 1395 of file asmparser.c.

1395 {
1396 TRACE_(parsed_shader)("vs_2_x\n");
1397
1398 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1399 if(!ret->shader) {
1400 ERR("Failed to allocate memory for the shader\n");
1401 set_parse_status(&ret->status, PARSE_ERR);
1402 return;
1403 }
1404
1405 ret->shader->type = ST_VERTEX;
1406 ret->shader->version = BWRITERVS_VERSION(2, 1);
1407 ret->funcs = &parser_vs_2;
1408 gen_oldvs_output(ret->shader);
1409}

◆ create_vs30_parser()

void create_vs30_parser ( struct asm_parser ret)

Definition at line 1411 of file asmparser.c.

1411 {
1412 TRACE_(parsed_shader)("vs_3_0\n");
1413
1414 ret->shader = d3dcompiler_alloc(sizeof(*ret->shader));
1415 if(!ret->shader) {
1416 ERR("Failed to allocate memory for the shader\n");
1417 set_parse_status(&ret->status, PARSE_ERR);
1418 return;
1419 }
1420
1421 ret->shader->type = ST_VERTEX;
1422 ret->shader->version = BWRITERVS_VERSION(3, 0);
1423 ret->funcs = &parser_vs_3;
1424}
static const struct asmparser_backend parser_vs_3
Definition: asmparser.c:1189

◆ d3dcompiler_alloc()

◆ d3dcompiler_free()

◆ d3dcompiler_realloc()

static void * d3dcompiler_realloc ( void ptr,
SIZE_T  size 
)
inlinestatic

◆ d3dcompiler_strdup()

static char * d3dcompiler_strdup ( const char string)
inlinestatic

Definition at line 162 of file d3dcompiler_private.h.

163{
164 char *copy;
165 SIZE_T len;
166
167 if (!string)
168 return NULL;
169
170 len = strlen(string);
172 if (copy)
173 memcpy(copy, string, len + 1);
174 return copy;
175}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by clone_hlsl_type().

◆ debug_d3dcompiler_d3d_blob_part()

const char * debug_d3dcompiler_d3d_blob_part ( D3D_BLOB_PART  part)

Definition at line 106 of file utils.c.

107{
108 switch(part)
109 {
122 default:
123 FIXME("Unrecognized D3D_BLOB_PART %#x\n", part);
124 return "unrecognized";
125 }
126}
#define FIXME(fmt,...)
Definition: debug.h:111
@ D3D_BLOB_ALL_SIGNATURE_BLOB
Definition: d3dcompiler.h:91
@ D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB
Definition: d3dcompiler.h:89
@ D3D_BLOB_TEST_COMPILE_PERF
Definition: d3dcompiler.h:98
@ D3D_BLOB_TEST_ALTERNATE_SHADER
Definition: d3dcompiler.h:96
@ D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB
Definition: d3dcompiler.h:90
@ D3D_BLOB_XNA_SHADER
Definition: d3dcompiler.h:95
@ D3D_BLOB_TEST_COMPILE_DETAILS
Definition: d3dcompiler.h:97
@ D3D_BLOB_INPUT_SIGNATURE_BLOB
Definition: d3dcompiler.h:87
@ D3D_BLOB_OUTPUT_SIGNATURE_BLOB
Definition: d3dcompiler.h:88
@ D3D_BLOB_DEBUG_INFO
Definition: d3dcompiler.h:92
@ D3D_BLOB_XNA_PREPASS_SHADER
Definition: d3dcompiler.h:94
@ D3D_BLOB_LEGACY_SHADER
Definition: d3dcompiler.h:93
#define WINE_D3DCOMPILER_TO_STR(x)
Definition: utils.c:30

Referenced by check_blob_part(), d3dcompiler_get_blob_part(), and D3DGetBlobPart().

◆ debug_d3dcompiler_shader_variable_class()

const char * debug_d3dcompiler_shader_variable_class ( D3D_SHADER_VARIABLE_CLASS  c)

Definition at line 32 of file utils.c.

33{
34 switch (c)
35 {
44 default:
45 FIXME("Unrecognized D3D_SHADER_VARIABLE_CLASS %#x.\n", c);
46 return "unrecognized";
47 }
48}
@ D3D_SVC_VECTOR
Definition: d3dcommon.idl:111
@ D3D_SVC_MATRIX_COLUMNS
Definition: d3dcommon.idl:113
@ D3D_SVC_SCALAR
Definition: d3dcommon.idl:110
@ D3D_SVC_STRUCT
Definition: d3dcommon.idl:115
@ D3D_SVC_MATRIX_ROWS
Definition: d3dcommon.idl:112
@ D3D_SVC_OBJECT
Definition: d3dcommon.idl:114
@ D3D_SVC_INTERFACE_CLASS
Definition: d3dcommon.idl:116
@ D3D_SVC_INTERFACE_POINTER
Definition: d3dcommon.idl:117
const GLubyte * c
Definition: glext.h:8905

Referenced by d3dcompiler_parse_type().

◆ debug_d3dcompiler_shader_variable_type()

const char * debug_d3dcompiler_shader_variable_type ( D3D_SHADER_VARIABLE_TYPE  t)

Definition at line 50 of file utils.c.

51{
52 switch (t)
53 {
100 default:
101 FIXME("Unrecognized D3D_SHADER_VARIABLE_TYPE %#x.\n", t);
102 return "unrecognized";
103 }
104}
@ D3D_SVT_RWSTRUCTURED_BUFFER
Definition: d3dcommon.idl:193
@ D3D_SVT_INT
Definition: d3dcommon.idl:146
@ D3D_SVT_RWBUFFER
Definition: d3dcommon.idl:189
@ D3D_SVT_RWTEXTURE3D
Definition: d3dcommon.idl:188
@ D3D_SVT_BLEND
Definition: d3dcommon.idl:168
@ D3D_SVT_TEXTURECUBEARRAY
Definition: d3dcommon.idl:178
@ D3D_SVT_STRUCTURED_BUFFER
Definition: d3dcommon.idl:192
@ D3D_SVT_DOMAINSHADER
Definition: d3dcommon.idl:180
@ D3D_SVT_DEPTHSTENCILVIEW
Definition: d3dcommon.idl:175
@ D3D_SVT_APPEND_STRUCTURED_BUFFER
Definition: d3dcommon.idl:194
@ D3D_SVT_CBUFFER
Definition: d3dcommon.idl:170
@ D3D_SVT_UINT8
Definition: d3dcommon.idl:164
@ D3D_SVT_TEXTURE1DARRAY
Definition: d3dcommon.idl:172
@ D3D_SVT_RWTEXTURE1D
Definition: d3dcommon.idl:184
@ D3D_SVT_VERTEXSHADER
Definition: d3dcommon.idl:160
@ D3D_SVT_UINT
Definition: d3dcommon.idl:163
@ D3D_SVT_VOID
Definition: d3dcommon.idl:144
@ D3D_SVT_TEXTURE1D
Definition: d3dcommon.idl:150
@ D3D_SVT_FLOAT
Definition: d3dcommon.idl:147
@ D3D_SVT_RWTEXTURE2D
Definition: d3dcommon.idl:186
@ D3D_SVT_TEXTURE2DARRAY
Definition: d3dcommon.idl:173
@ D3D_SVT_DOUBLE
Definition: d3dcommon.idl:183
@ D3D_SVT_BUFFER
Definition: d3dcommon.idl:169
@ D3D_SVT_INTERFACE_POINTER
Definition: d3dcommon.idl:181
@ D3D_SVT_RASTERIZER
Definition: d3dcommon.idl:166
@ D3D_SVT_TEXTURECUBE
Definition: d3dcommon.idl:153
@ D3D_SVT_TEXTURE2D
Definition: d3dcommon.idl:151
@ D3D_SVT_DEPTHSTENCIL
Definition: d3dcommon.idl:167
@ D3D_SVT_RWTEXTURE2DARRAY
Definition: d3dcommon.idl:187
@ D3D_SVT_STRING
Definition: d3dcommon.idl:148
@ D3D_SVT_TEXTURE
Definition: d3dcommon.idl:149
@ D3D_SVT_BOOL
Definition: d3dcommon.idl:145
@ D3D_SVT_TEXTURE2DMS
Definition: d3dcommon.idl:176
@ D3D_SVT_BYTEADDRESS_BUFFER
Definition: d3dcommon.idl:190
@ D3D_SVT_SAMPLER
Definition: d3dcommon.idl:154
@ D3D_SVT_TEXTURE3D
Definition: d3dcommon.idl:152
@ D3D_SVT_TEXTURE2DMSARRAY
Definition: d3dcommon.idl:177
@ D3D_SVT_HULLSHADER
Definition: d3dcommon.idl:179
@ D3D_SVT_CONSUME_STRUCTURED_BUFFER
Definition: d3dcommon.idl:195
@ D3D_SVT_RENDERTARGETVIEW
Definition: d3dcommon.idl:174
@ D3D_SVT_TBUFFER
Definition: d3dcommon.idl:171
@ D3D_SVT_GEOMETRYSHADER
Definition: d3dcommon.idl:165
@ D3D_SVT_RWTEXTURE1DARRAY
Definition: d3dcommon.idl:185
@ D3D_SVT_RWBYTEADDRESS_BUFFER
Definition: d3dcommon.idl:191
@ D3D_SVT_COMPUTESHADER
Definition: d3dcommon.idl:182
@ D3D_SVT_PIXELSHADER
Definition: d3dcommon.idl:159
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by d3dcompiler_parse_type().

◆ debug_dump_ir_function_decl()

void debug_dump_ir_function_decl ( const struct hlsl_ir_function_decl func)

Definition at line 2086 of file utils.c.

2087{
2088 struct hlsl_ir_var *param;
2089
2090 TRACE("Dumping function %s.\n", debugstr_a(func->func->name));
2091 TRACE("Function parameters:\n");
2093 {
2095 TRACE("\n");
2096 }
2097 if (func->semantic)
2098 TRACE("Function semantic: %s\n", debugstr_a(func->semantic));
2099 if (func->body)
2100 {
2102 }
2103}
static void debug_dump_ir_var(const struct hlsl_ir_var *var)
Definition: utils.c:1791
static void debug_dump_instr_list(const struct list *list)
Definition: utils.c:1780
GLfloat param
Definition: glext.h:5796
struct list scope_entry param_entry

◆ debug_hlsl_type()

const char * debug_hlsl_type ( const struct hlsl_type type)

Definition at line 1695 of file utils.c.

1696{
1697 const char *name;
1698
1699 if (type->name)
1700 return debugstr_a(type->name);
1701
1702 if (type->type == HLSL_CLASS_STRUCT)
1703 return "<anonymous struct>";
1704
1705 if (type->type == HLSL_CLASS_ARRAY)
1706 {
1707 name = debug_base_type(type->e.array.type);
1708 return wine_dbg_sprintf("%s[%u]", name, type->e.array.elements_count);
1709 }
1710
1712
1713 if (type->type == HLSL_CLASS_SCALAR)
1714 return wine_dbg_sprintf("%s", name);
1715 if (type->type == HLSL_CLASS_VECTOR)
1716 return wine_dbg_sprintf("%s%u", name, type->dimx);
1717 if (type->type == HLSL_CLASS_MATRIX)
1718 return wine_dbg_sprintf("%s%ux%u", name, type->dimx, type->dimy);
1719 return "unexpected_type";
1720}
static const char * debug_base_type(const struct hlsl_type *type)
Definition: utils.c:1667
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296

Referenced by components_count_type(), debug_dump_ir_constructor(), debug_dump_ir_var(), debug_expr_op(), implicit_conversion(), make_assignment(), and new_expr().

◆ debug_modifiers()

const char * debug_modifiers ( DWORD  modifiers)

Definition at line 1722 of file utils.c.

1723{
1724 char string[110];
1725
1726 string[0] = 0;
1727 if (modifiers & HLSL_STORAGE_EXTERN)
1728 strcat(string, " extern"); /* 7 */
1729 if (modifiers & HLSL_STORAGE_NOINTERPOLATION)
1730 strcat(string, " nointerpolation"); /* 16 */
1731 if (modifiers & HLSL_MODIFIER_PRECISE)
1732 strcat(string, " precise"); /* 8 */
1733 if (modifiers & HLSL_STORAGE_SHARED)
1734 strcat(string, " shared"); /* 7 */
1735 if (modifiers & HLSL_STORAGE_GROUPSHARED)
1736 strcat(string, " groupshared"); /* 12 */
1737 if (modifiers & HLSL_STORAGE_STATIC)
1738 strcat(string, " static"); /* 7 */
1739 if (modifiers & HLSL_STORAGE_UNIFORM)
1740 strcat(string, " uniform"); /* 8 */
1741 if (modifiers & HLSL_STORAGE_VOLATILE)
1742 strcat(string, " volatile"); /* 9 */
1743 if (modifiers & HLSL_MODIFIER_CONST)
1744 strcat(string, " const"); /* 6 */
1745 if (modifiers & HLSL_MODIFIER_ROW_MAJOR)
1746 strcat(string, " row_major"); /* 10 */
1747 if (modifiers & HLSL_MODIFIER_COLUMN_MAJOR)
1748 strcat(string, " column_major"); /* 13 */
1750 strcat(string, " inout"); /* 6 */
1751 else if (modifiers & HLSL_MODIFIER_IN)
1752 strcat(string, " in"); /* 3 */
1753 else if (modifiers & HLSL_MODIFIER_OUT)
1754 strcat(string, " out"); /* 4 */
1755
1756 return wine_dbg_sprintf("%s", string[0] ? string + 1 : "");
1757}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define HLSL_MODIFIER_OUT
#define HLSL_STORAGE_UNIFORM
#define HLSL_STORAGE_EXTERN
#define HLSL_STORAGE_GROUPSHARED
#define HLSL_STORAGE_STATIC
#define HLSL_STORAGE_SHARED
#define HLSL_MODIFIER_IN
#define HLSL_STORAGE_NOINTERPOLATION

Referenced by debug_dump_ir_var().

◆ debug_print_comp()

const char * debug_print_comp ( DWORD  comp)

Definition at line 401 of file utils.c.

402{
403 switch (comp)
404 {
405 case BWRITER_COMPARISON_NONE: return "";
406 case BWRITER_COMPARISON_GT: return "_gt";
407 case BWRITER_COMPARISON_EQ: return "_eq";
408 case BWRITER_COMPARISON_GE: return "_ge";
409 case BWRITER_COMPARISON_LT: return "_lt";
410 case BWRITER_COMPARISON_NE: return "_ne";
411 case BWRITER_COMPARISON_LE: return "_le";
412 default: return "_unknown";
413 }
414}

Referenced by asmparser_instr().

◆ debug_print_dstmod()

const char * debug_print_dstmod ( DWORD  mod)

Definition at line 153 of file utils.c.

154{
155 switch (mod)
156 {
157 case 0:
158 return "";
160 return "_sat";
162 return "_pp";
164 return "_centroid";
166 return "_sat_pp";
168 return "_sat_centroid";
170 return "_pp_centroid";
172 return "_sat_pp_centroid";
173 default:
174 return "Unexpected modifier\n";
175 }
176}
static int mod
Definition: i386-dis.c:1288

Referenced by asmparser_instr(), and check_ps_dstmod().

◆ debug_print_dstreg()

const char * debug_print_dstreg ( const struct shader_reg reg)

Definition at line 330 of file utils.c.

331{
332 return wine_dbg_sprintf("%s%s%s", get_regname(reg),
334 debug_print_writemask(reg->u.writemask));
335}
static const char * debug_print_writemask(DWORD mask)
Definition: utils.c:258
static const char * get_regname(const struct shader_reg *reg)
Definition: utils.c:202
static const char * debug_print_relarg(const struct shader_reg *reg)
Definition: utils.c:315

Referenced by asmparser_dstreg_ps_1_0123(), asmparser_dstreg_ps_1_4(), asmparser_dstreg_ps_2(), asmparser_dstreg_ps_2_x(), asmparser_dstreg_ps_3(), asmparser_dstreg_vs_1(), asmparser_dstreg_vs_2(), asmparser_dstreg_vs_3(), and asmparser_instr().

◆ debug_print_opcode()

const char * debug_print_opcode ( DWORD  opcode)

Definition at line 416 of file utils.c.

417{
418 switch (opcode)
419 {
420 case BWRITERSIO_NOP: return "nop";
421 case BWRITERSIO_MOV: return "mov";
422 case BWRITERSIO_ADD: return "add";
423 case BWRITERSIO_SUB: return "sub";
424 case BWRITERSIO_MAD: return "mad";
425 case BWRITERSIO_MUL: return "mul";
426 case BWRITERSIO_RCP: return "rcp";
427 case BWRITERSIO_RSQ: return "rsq";
428 case BWRITERSIO_DP3: return "dp3";
429 case BWRITERSIO_DP4: return "dp4";
430 case BWRITERSIO_MIN: return "min";
431 case BWRITERSIO_MAX: return "max";
432 case BWRITERSIO_SLT: return "slt";
433 case BWRITERSIO_SGE: return "sge";
434 case BWRITERSIO_EXP: return "exp";
435 case BWRITERSIO_LOG: return "log";
436 case BWRITERSIO_LIT: return "lit";
437 case BWRITERSIO_DST: return "dst";
438 case BWRITERSIO_LRP: return "lrp";
439 case BWRITERSIO_FRC: return "frc";
440 case BWRITERSIO_M4x4: return "m4x4";
441 case BWRITERSIO_M4x3: return "m4x3";
442 case BWRITERSIO_M3x4: return "m3x4";
443 case BWRITERSIO_M3x3: return "m3x3";
444 case BWRITERSIO_M3x2: return "m3x2";
445 case BWRITERSIO_CALL: return "call";
446 case BWRITERSIO_CALLNZ: return "callnz";
447 case BWRITERSIO_LOOP: return "loop";
448 case BWRITERSIO_RET: return "ret";
449 case BWRITERSIO_ENDLOOP: return "endloop";
450 case BWRITERSIO_LABEL: return "label";
451 case BWRITERSIO_DCL: return "dcl";
452 case BWRITERSIO_POW: return "pow";
453 case BWRITERSIO_CRS: return "crs";
454 case BWRITERSIO_SGN: return "sgn";
455 case BWRITERSIO_ABS: return "abs";
456 case BWRITERSIO_NRM: return "nrm";
457 case BWRITERSIO_SINCOS: return "sincos";
458 case BWRITERSIO_REP: return "rep";
459 case BWRITERSIO_ENDREP: return "endrep";
460 case BWRITERSIO_IF: return "if";
461 case BWRITERSIO_IFC: return "ifc";
462 case BWRITERSIO_ELSE: return "else";
463 case BWRITERSIO_ENDIF: return "endif";
464 case BWRITERSIO_BREAK: return "break";
465 case BWRITERSIO_BREAKC: return "breakc";
466 case BWRITERSIO_MOVA: return "mova";
467 case BWRITERSIO_DEFB: return "defb";
468 case BWRITERSIO_DEFI: return "defi";
469 case BWRITERSIO_TEXCOORD: return "texcoord";
470 case BWRITERSIO_TEXKILL: return "texkill";
471 case BWRITERSIO_TEX: return "tex";
472 case BWRITERSIO_TEXBEM: return "texbem";
473 case BWRITERSIO_TEXBEML: return "texbeml";
474 case BWRITERSIO_TEXREG2AR: return "texreg2ar";
475 case BWRITERSIO_TEXREG2GB: return "texreg2gb";
476 case BWRITERSIO_TEXM3x2PAD: return "texm3x2pad";
477 case BWRITERSIO_TEXM3x2TEX: return "texm3x2tex";
478 case BWRITERSIO_TEXM3x3PAD: return "texm3x3pad";
479 case BWRITERSIO_TEXM3x3TEX: return "texm3x3tex";
480 case BWRITERSIO_TEXM3x3SPEC: return "texm3x3vspec";
481 case BWRITERSIO_TEXM3x3VSPEC: return "texm3x3vspec";
482 case BWRITERSIO_EXPP: return "expp";
483 case BWRITERSIO_LOGP: return "logp";
484 case BWRITERSIO_CND: return "cnd";
485 case BWRITERSIO_DEF: return "def";
486 case BWRITERSIO_TEXREG2RGB: return "texreg2rgb";
487 case BWRITERSIO_TEXDP3TEX: return "texdp3tex";
488 case BWRITERSIO_TEXM3x2DEPTH: return "texm3x2depth";
489 case BWRITERSIO_TEXDP3: return "texdp3";
490 case BWRITERSIO_TEXM3x3: return "texm3x3";
491 case BWRITERSIO_TEXDEPTH: return "texdepth";
492 case BWRITERSIO_CMP: return "cmp";
493 case BWRITERSIO_BEM: return "bem";
494 case BWRITERSIO_DP2ADD: return "dp2add";
495 case BWRITERSIO_DSX: return "dsx";
496 case BWRITERSIO_DSY: return "dsy";
497 case BWRITERSIO_TEXLDD: return "texldd";
498 case BWRITERSIO_SETP: return "setp";
499 case BWRITERSIO_TEXLDL: return "texldl";
500 case BWRITERSIO_BREAKP: return "breakp";
501 case BWRITERSIO_PHASE: return "phase";
502
503 case BWRITERSIO_TEXLDP: return "texldp";
504 case BWRITERSIO_TEXLDB: return "texldb";
505
506 default: return "unknown";
507 }
508}

Referenced by asmparser_instr(), and call_instr_handler().

◆ debug_print_shift()

const char * debug_print_shift ( DWORD  shift)

Definition at line 178 of file utils.c.

179{
180 static const char * const shiftstrings[] =
181 {
182 "",
183 "_x2",
184 "_x4",
185 "_x8",
186 "_x16",
187 "_x32",
188 "",
189 "",
190 "",
191 "",
192 "",
193 "",
194 "_d16",
195 "_d8",
196 "_d4",
197 "_d2",
198 };
199 return shiftstrings[shift];
200}
#define shift
Definition: input.c:1755

Referenced by asmparser_instr().

◆ debug_print_srcmod()

◆ debug_print_srcreg()

const char * debug_print_srcreg ( const struct shader_reg reg)

Definition at line 337 of file utils.c.

338{
339 switch (reg->srcmod)
340 {
341 case BWRITERSPSM_NONE:
342 return wine_dbg_sprintf("%s%s%s", get_regname(reg),
344 debug_print_swizzle(reg->u.swizzle));
345 case BWRITERSPSM_NEG:
346 return wine_dbg_sprintf("-%s%s%s", get_regname(reg),
348 debug_print_swizzle(reg->u.swizzle));
349 case BWRITERSPSM_BIAS:
350 return wine_dbg_sprintf("%s%s_bias%s", get_regname(reg),
352 debug_print_swizzle(reg->u.swizzle));
354 return wine_dbg_sprintf("-%s%s_bias%s", get_regname(reg),
356 debug_print_swizzle(reg->u.swizzle));
357 case BWRITERSPSM_SIGN:
358 return wine_dbg_sprintf("%s%s_bx2%s", get_regname(reg),
360 debug_print_swizzle(reg->u.swizzle));
362 return wine_dbg_sprintf("-%s%s_bx2%s", get_regname(reg),
364 debug_print_swizzle(reg->u.swizzle));
365 case BWRITERSPSM_COMP:
366 return wine_dbg_sprintf("1 - %s%s%s", get_regname(reg),
368 debug_print_swizzle(reg->u.swizzle));
369 case BWRITERSPSM_X2:
370 return wine_dbg_sprintf("%s%s_x2%s", get_regname(reg),
372 debug_print_swizzle(reg->u.swizzle));
374 return wine_dbg_sprintf("-%s%s_x2%s", get_regname(reg),
376 debug_print_swizzle(reg->u.swizzle));
377 case BWRITERSPSM_DZ:
378 return wine_dbg_sprintf("%s%s_dz%s", get_regname(reg),
380 debug_print_swizzle(reg->u.swizzle));
381 case BWRITERSPSM_DW:
382 return wine_dbg_sprintf("%s%s_dw%s", get_regname(reg),
384 debug_print_swizzle(reg->u.swizzle));
385 case BWRITERSPSM_ABS:
386 return wine_dbg_sprintf("%s%s_abs%s", get_regname(reg),
388 debug_print_swizzle(reg->u.swizzle));
390 return wine_dbg_sprintf("-%s%s_abs%s", get_regname(reg),
392 debug_print_swizzle(reg->u.swizzle));
393 case BWRITERSPSM_NOT:
394 return wine_dbg_sprintf("!%s%s%s", get_regname(reg),
396 debug_print_swizzle(reg->u.swizzle));
397 }
398 return "Unknown modifier";
399}
static const char * debug_print_swizzle(DWORD arg)
Definition: utils.c:274

Referenced by asmparser_instr(), asmparser_srcreg_ps_1_0123(), asmparser_srcreg_ps_1_4(), asmparser_srcreg_ps_2(), asmparser_srcreg_ps_2_x(), asmparser_srcreg_ps_3(), asmparser_srcreg_vs_1(), asmparser_srcreg_vs_2(), and asmparser_srcreg_vs_3().

◆ deref_from_node()

static struct hlsl_ir_deref * deref_from_node ( const struct hlsl_ir_node node)
inlinestatic

Definition at line 1075 of file d3dcompiler_private.h.

1076{
1077 assert(node->type == HLSL_IR_DEREF);
1078 return CONTAINING_RECORD(node, struct hlsl_ir_deref, node);
1079}

Referenced by debug_dump_instr(), free_instr(), and make_assignment().

◆ dxbc_add_section()

HRESULT dxbc_add_section ( struct dxbc dxbc,
DWORD  tag,
const char data,
DWORD  data_size 
)

Definition at line 529 of file utils.c.

530{
531 TRACE("dxbc %p, tag %s, size %#x.\n", dxbc, debugstr_an((const char *)&tag, 4), data_size);
532
533 if (dxbc->count >= dxbc->size)
534 {
535 struct dxbc_section *new_sections;
536 DWORD new_size = dxbc->size << 1;
537
538 new_sections = HeapReAlloc(GetProcessHeap(), 0, dxbc->sections, new_size * sizeof(*dxbc->sections));
539 if (!new_sections)
540 {
541 ERR("Failed to allocate dxbc section memory\n");
542 return E_OUTOFMEMORY;
543 }
544
545 dxbc->sections = new_sections;
546 dxbc->size = new_size;
547 }
548
549 dxbc->sections[dxbc->count].tag = tag;
550 dxbc->sections[dxbc->count].data_size = data_size;
551 dxbc->sections[dxbc->count].data = data;
552 ++dxbc->count;
553
554 return S_OK;
555}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define S_OK
Definition: intsafe.h:52
struct dxbc_section * sections
Definition: ecma_167.h:138

Referenced by d3dcompiler_get_blob_part(), d3dcompiler_strip_shader(), and dxbc_parse().

◆ dxbc_destroy()

void dxbc_destroy ( struct dxbc dxbc)

Definition at line 648 of file utils.c.

649{
650 TRACE("dxbc %p.\n", dxbc);
651
653}

Referenced by d3dcompiler_get_blob_part(), d3dcompiler_shader_reflection_init(), and d3dcompiler_strip_shader().

◆ dxbc_init()

HRESULT dxbc_init ( struct dxbc dxbc,
unsigned int  size 
)

Definition at line 557 of file utils.c.

558{
559 TRACE("dxbc %p, size %u.\n", dxbc, size);
560
561 /* use a good starting value for the size if none specified */
562 if (!size) size = 2;
563
564 dxbc->sections = HeapAlloc(GetProcessHeap(), 0, size * sizeof(*dxbc->sections));
565 if (!dxbc->sections)
566 {
567 ERR("Failed to allocate dxbc section memory\n");
568 return E_OUTOFMEMORY;
569 }
570
571 dxbc->size = size;
572 dxbc->count = 0;
573
574 return S_OK;
575}

Referenced by d3dcompiler_get_blob_part(), d3dcompiler_strip_shader(), and dxbc_parse().

◆ dxbc_parse()

HRESULT dxbc_parse ( const char data,
SIZE_T  data_size,
struct dxbc dxbc 
)

Definition at line 577