ReactOS 0.4.15-dev-7674-gc0b4db1
asmparser.c File Reference
#include "wine/debug.h"
#include "d3dcompiler_private.h"
Include dependency graph for asmparser.c:

Go to the source code of this file.

Classes

struct  allowed_reg_type
 

Macros

#define OT0_REG   0
 
#define OT1_REG   1
 
#define OT2_REG   2
 
#define OT3_REG   3
 
#define OT4_REG   4
 
#define OT5_REG   5
 
#define OT6_REG   6
 
#define OT7_REG   7
 
#define OPOS_REG   8
 
#define OFOG_REG   9
 
#define OFOG_WRITEMASK   BWRITERSP_WRITEMASK_0
 
#define OPTS_REG   9
 
#define OPTS_WRITEMASK   BWRITERSP_WRITEMASK_1
 
#define OD0_REG   10
 
#define OD1_REG   11
 
#define C0_VARYING   0
 
#define C1_VARYING   1
 
#define T0_VARYING   2
 
#define T1_VARYING   3
 
#define T2_VARYING   4
 
#define T3_VARYING   5
 
#define T4_VARYING   6
 
#define T5_VARYING   7
 
#define T6_VARYING   8
 
#define T7_VARYING   9
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (asmshader)
 
 WINE_DECLARE_DEBUG_CHANNEL (parsed_shader)
 
static void asmparser_end (struct asm_parser *This)
 
static void asmparser_constF (struct asm_parser *This, DWORD reg, float x, float y, float z, float w)
 
static void asmparser_constB (struct asm_parser *This, DWORD reg, BOOL x)
 
static void asmparser_constI (struct asm_parser *This, DWORD reg, INT x, INT y, INT z, INT w)
 
static void asmparser_dcl_output (struct asm_parser *This, DWORD usage, DWORD num, const struct shader_reg *reg)
 
static void asmparser_dcl_output_unsupported (struct asm_parser *This, DWORD usage, DWORD num, const struct shader_reg *reg)
 
static void asmparser_dcl_input (struct asm_parser *This, DWORD usage, DWORD num, DWORD mod, const struct shader_reg *reg)
 
static void asmparser_dcl_input_ps_2 (struct asm_parser *This, DWORD usage, DWORD num, DWORD mod, const struct shader_reg *reg)
 
static void asmparser_dcl_input_unsupported (struct asm_parser *This, DWORD usage, DWORD num, DWORD mod, const struct shader_reg *reg)
 
static void asmparser_dcl_sampler (struct asm_parser *This, DWORD samptype, DWORD mod, DWORD regnum, unsigned int line_no)
 
static void asmparser_dcl_sampler_unsupported (struct asm_parser *This, DWORD samptype, DWORD mod, DWORD regnum, unsigned int line_no)
 
static void asmparser_sincos (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
 
static struct shader_reg map_oldps_register (const struct shader_reg *reg, BOOL tex_varying)
 
static void asmparser_texcoord (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
 
static void asmparser_texcrd (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
 
static void asmparser_texkill (struct asm_parser *This, const struct shader_reg *dst)
 
static void asmparser_texhelper (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
 
static void asmparser_tex (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst)
 
static void asmparser_texld14 (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
 
static void asmparser_texreg2ar (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
 
static void asmparser_texreg2gb (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
 
static void asmparser_texreg2rgb (struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
 
static void asmparser_instr (struct asm_parser *This, DWORD opcode, DWORD mod, DWORD shift, enum bwriter_comparison_type comp, const struct shader_reg *dst, const struct src_regs *srcs, int expectednsrcs)
 
static struct shader_reg map_oldvs_register (const struct shader_reg *reg)
 
static void check_legacy_srcmod (struct asm_parser *This, DWORD srcmod)
 
static void check_abs_srcmod (struct asm_parser *This, DWORD srcmod)
 
static void check_loop_swizzle (struct asm_parser *This, const struct shader_reg *src)
 
static void check_shift_dstmod (struct asm_parser *This, DWORD shift)
 
static void check_ps_dstmod (struct asm_parser *This, DWORD dstmod)
 
static BOOL check_reg_type (const struct shader_reg *reg, const struct allowed_reg_type *allowed)
 
static void asmparser_srcreg_vs_1 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_vs_2 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_vs_3 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_ps_1_0123 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_ps_1_4 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_ps_2 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_ps_2_x (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_srcreg_ps_3 (struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
 
static void asmparser_dstreg_vs_1 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_vs_2 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_vs_3 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_ps_1_0123 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_ps_1_4 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_ps_2 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_ps_2_x (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_dstreg_ps_3 (struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
 
static void asmparser_predicate_supported (struct asm_parser *This, const struct shader_reg *predicate)
 
static void asmparser_predicate_unsupported (struct asm_parser *This, const struct shader_reg *predicate)
 
static void asmparser_coissue_supported (struct asm_parser *This)
 
static void asmparser_coissue_unsupported (struct asm_parser *This)
 
static void gen_oldvs_output (struct bwriter_shader *shader)
 
static void gen_oldps_input (struct bwriter_shader *shader, DWORD texcoords)
 
void create_vs10_parser (struct asm_parser *ret)
 
void create_vs11_parser (struct asm_parser *ret)
 
void create_vs20_parser (struct asm_parser *ret)
 
void create_vs2x_parser (struct asm_parser *ret)
 
void create_vs30_parser (struct asm_parser *ret)
 
void create_ps10_parser (struct asm_parser *ret)
 
void create_ps11_parser (struct asm_parser *ret)
 
void create_ps12_parser (struct asm_parser *ret)
 
void create_ps13_parser (struct asm_parser *ret)
 
void create_ps14_parser (struct asm_parser *ret)
 
void create_ps20_parser (struct asm_parser *ret)
 
void create_ps2x_parser (struct asm_parser *ret)
 
void create_ps30_parser (struct asm_parser *ret)
 

Variables

static const struct allowed_reg_type vs_1_reg_allowed []
 
static const struct allowed_reg_type vs_2_reg_allowed []
 
static const struct allowed_reg_type vs_3_reg_allowed []
 
static const struct allowed_reg_type ps_1_0123_reg_allowed []
 
static const struct allowed_reg_type ps_1_4_reg_allowed []
 
static const struct allowed_reg_type ps_2_0_reg_allowed []
 
static const struct allowed_reg_type ps_2_x_reg_allowed []
 
static const struct allowed_reg_type ps_3_reg_allowed []
 
static const struct asmparser_backend parser_vs_1
 
static const struct asmparser_backend parser_vs_2
 
static const struct asmparser_backend parser_vs_3
 
static const struct asmparser_backend parser_ps_1_0123
 
static const struct asmparser_backend parser_ps_1_4
 
static const struct asmparser_backend parser_ps_2
 
static const struct asmparser_backend parser_ps_2_x
 
static const struct asmparser_backend parser_ps_3
 

Macro Definition Documentation

◆ C0_VARYING

#define C0_VARYING   0

Definition at line 55 of file asmparser.c.

◆ C1_VARYING

#define C1_VARYING   1

Definition at line 56 of file asmparser.c.

◆ OD0_REG

#define OD0_REG   10

Definition at line 51 of file asmparser.c.

◆ OD1_REG

#define OD1_REG   11

Definition at line 52 of file asmparser.c.

◆ OFOG_REG

#define OFOG_REG   9

Definition at line 47 of file asmparser.c.

◆ OFOG_WRITEMASK

#define OFOG_WRITEMASK   BWRITERSP_WRITEMASK_0

Definition at line 48 of file asmparser.c.

◆ OPOS_REG

#define OPOS_REG   8

Definition at line 46 of file asmparser.c.

◆ OPTS_REG

#define OPTS_REG   9

Definition at line 49 of file asmparser.c.

◆ OPTS_WRITEMASK

#define OPTS_WRITEMASK   BWRITERSP_WRITEMASK_1

Definition at line 50 of file asmparser.c.

◆ OT0_REG

#define OT0_REG   0

Definition at line 38 of file asmparser.c.

◆ OT1_REG

#define OT1_REG   1

Definition at line 39 of file asmparser.c.

◆ OT2_REG

#define OT2_REG   2

Definition at line 40 of file asmparser.c.

◆ OT3_REG

#define OT3_REG   3

Definition at line 41 of file asmparser.c.

◆ OT4_REG

#define OT4_REG   4

Definition at line 42 of file asmparser.c.

◆ OT5_REG

#define OT5_REG   5

Definition at line 43 of file asmparser.c.

◆ OT6_REG

#define OT6_REG   6

Definition at line 44 of file asmparser.c.

◆ OT7_REG

#define OT7_REG   7

Definition at line 45 of file asmparser.c.

◆ T0_VARYING

#define T0_VARYING   2

Definition at line 57 of file asmparser.c.

◆ T1_VARYING

#define T1_VARYING   3

Definition at line 58 of file asmparser.c.

◆ T2_VARYING

#define T2_VARYING   4

Definition at line 59 of file asmparser.c.

◆ T3_VARYING

#define T3_VARYING   5

Definition at line 60 of file asmparser.c.

◆ T4_VARYING

#define T4_VARYING   6

Definition at line 61 of file asmparser.c.

◆ T5_VARYING

#define T5_VARYING   7

Definition at line 62 of file asmparser.c.

◆ T6_VARYING

#define T6_VARYING   8

Definition at line 63 of file asmparser.c.

◆ T7_VARYING

#define T7_VARYING   9

Definition at line 64 of file asmparser.c.

Function Documentation

◆ asmparser_coissue_supported()

static void asmparser_coissue_supported ( struct asm_parser This)
static

Definition at line 1134 of file asmparser.c.

1134 {
1135 /* this sets the coissue flag of the last instruction added to the shader */
1136 if(!This->shader) return;
1137 if(This->shader->num_instrs == 0){
1138 asmparser_message(This, "Line %u: Coissue flag on the first shader instruction\n", This->line_no);
1139 set_parse_status(&This->status, PARSE_ERR);
1140 }
1141 This->shader->instr[This->shader->num_instrs-1]->coissue = TRUE;
1142}
static void set_parse_status(enum parse_status *current, enum parse_status update)
void WINAPIV asmparser_message(struct asm_parser *ctx, const char *fmt,...) PRINTF_ATTR(2
@ PARSE_ERR
#define TRUE
Definition: types.h:120

◆ asmparser_coissue_unsupported()

static void asmparser_coissue_unsupported ( struct asm_parser This)
static

Definition at line 1144 of file asmparser.c.

1144 {
1145 asmparser_message(This, "Line %u: Coissue is only supported in pixel shaders versions <= 1.4\n", This->line_no);
1146 set_parse_status(&This->status, PARSE_ERR);
1147}

◆ asmparser_constB()

static void asmparser_constB ( struct asm_parser This,
DWORD  reg,
BOOL  x 
)
static

Definition at line 84 of file asmparser.c.

84 {
85 if(!This->shader) return;
86 TRACE("Adding boolean constant %u at pos %u\n", reg, This->shader->num_cb);
87 TRACE_(parsed_shader)("def b%u, %s\n", reg, x ? "true" : "false");
88 if(!add_constB(This->shader, reg, x)) {
89 ERR("Out of memory\n");
91 }
92}
#define ERR(fmt,...)
Definition: debug.h:110
BOOL add_constB(struct bwriter_shader *shader, DWORD reg, BOOL x)
#define TRACE_(x)
Definition: compat.h:76
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static int reg
Definition: i386-dis.c:1290
#define TRACE(s)
Definition: solgame.cpp:4

◆ asmparser_constF()

static void asmparser_constF ( struct asm_parser This,
DWORD  reg,
float  x,
float  y,
float  z,
float  w 
)
static

Definition at line 74 of file asmparser.c.

74 {
75 if(!This->shader) return;
76 TRACE("Adding float constant %u at pos %u\n", reg, This->shader->num_cf);
77 TRACE_(parsed_shader)("def c%u, %f, %f, %f, %f\n", reg, x, y, z, w);
78 if(!add_constF(This->shader, reg, x, y, z, w)) {
79 ERR("Out of memory\n");
81 }
82}
BOOL add_constF(struct bwriter_shader *shader, DWORD reg, float x, float y, float z, float w)
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

◆ asmparser_constI()

static void asmparser_constI ( struct asm_parser This,
DWORD  reg,
INT  x,
INT  y,
INT  z,
INT  w 
)
static

Definition at line 94 of file asmparser.c.

94 {
95 if(!This->shader) return;
96 TRACE("Adding integer constant %u at pos %u\n", reg, This->shader->num_ci);
97 TRACE_(parsed_shader)("def i%u, %d, %d, %d, %d\n", reg, x, y, z, w);
98 if(!add_constI(This->shader, reg, x, y, z, w)) {
99 ERR("Out of memory\n");
101 }
102}
BOOL add_constI(struct bwriter_shader *shader, DWORD reg, INT x, INT y, INT z, INT w)

◆ asmparser_dcl_input()

static void asmparser_dcl_input ( struct asm_parser This,
DWORD  usage,
DWORD  num,
DWORD  mod,
const struct shader_reg reg 
)
static

Definition at line 123 of file asmparser.c.

124 {
125 struct instruction instr;
126
127 if(!This->shader) return;
128 if(mod != 0 &&
129 (This->shader->version != BWRITERPS_VERSION(3, 0) ||
132 asmparser_message(This, "Line %u: Unsupported modifier in dcl instruction\n", This->line_no);
134 return;
135 }
136
137 /* Check register type and modifiers */
138 instr.dstmod = mod;
139 instr.shift = 0;
140 This->funcs->dstreg(This, &instr, reg);
141
142 if(!record_declaration(This->shader, usage, num, mod, FALSE, reg->regnum, reg->u.writemask, FALSE)) {
143 ERR("Out of memory\n");
145 }
146}
BOOL record_declaration(struct bwriter_shader *shader, DWORD usage, DWORD usage_idx, DWORD mod, BOOL output, DWORD regnum, DWORD writemask, BOOL builtin)
@ BWRITERSPDM_PARTIALPRECISION
@ BWRITERSPDM_MSAMPCENTROID
#define BWRITERPS_VERSION(major, minor)
#define FALSE
Definition: types.h:117
GLuint GLuint num
Definition: glext.h:9618
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static int mod
Definition: i386-dis.c:1288

◆ asmparser_dcl_input_ps_2()

static void asmparser_dcl_input_ps_2 ( struct asm_parser This,
DWORD  usage,
DWORD  num,
DWORD  mod,
const struct shader_reg reg 
)
static

Definition at line 148 of file asmparser.c.

149 {
150 struct instruction instr;
151
152 if(!This->shader) return;
153 instr.dstmod = mod;
154 instr.shift = 0;
155 This->funcs->dstreg(This, &instr, reg);
156 if(!record_declaration(This->shader, usage, num, mod, FALSE, instr.dst.regnum, instr.dst.u.writemask, FALSE)) {
157 ERR("Out of memory\n");
159 }
160}

◆ asmparser_dcl_input_unsupported()

static void asmparser_dcl_input_unsupported ( struct asm_parser This,
DWORD  usage,
DWORD  num,
DWORD  mod,
const struct shader_reg reg 
)
static

Definition at line 162 of file asmparser.c.

164{
165 asmparser_message(This, "Line %u: Input declaration unsupported in this shader version\n", This->line_no);
167}

◆ asmparser_dcl_output()

static void asmparser_dcl_output ( struct asm_parser This,
DWORD  usage,
DWORD  num,
const struct shader_reg reg 
)
static

Definition at line 104 of file asmparser.c.

105 {
106 if(!This->shader) return;
107 if(This->shader->type == ST_PIXEL) {
108 asmparser_message(This, "Line %u: Output register declared in a pixel shader\n", This->line_no);
110 }
111 if(!record_declaration(This->shader, usage, num, 0, TRUE, reg->regnum, reg->u.writemask, FALSE)) {
112 ERR("Out of memory\n");
114 }
115}
@ ST_PIXEL

◆ asmparser_dcl_output_unsupported()

static void asmparser_dcl_output_unsupported ( struct asm_parser This,
DWORD  usage,
DWORD  num,
const struct shader_reg reg 
)
static

Definition at line 117 of file asmparser.c.

118 {
119 asmparser_message(This, "Line %u: Output declaration unsupported in this shader version\n", This->line_no);
121}

◆ asmparser_dcl_sampler()

static void asmparser_dcl_sampler ( struct asm_parser This,
DWORD  samptype,
DWORD  mod,
DWORD  regnum,
unsigned int  line_no 
)
static

Definition at line 169 of file asmparser.c.

171 {
172 if(!This->shader) return;
173 if(mod != 0 &&
174 (This->shader->version != BWRITERPS_VERSION(3, 0) ||
177 asmparser_message(This, "Line %u: Unsupported modifier in dcl instruction\n", This->line_no);
179 return;
180 }
181 if(!record_sampler(This->shader, samptype, mod, regnum)) {
182 ERR("Out of memory\n");
184 }
185}
BOOL record_sampler(struct bwriter_shader *shader, DWORD samptype, DWORD mod, DWORD regnum)

◆ asmparser_dcl_sampler_unsupported()

static void asmparser_dcl_sampler_unsupported ( struct asm_parser This,
DWORD  samptype,
DWORD  mod,
DWORD  regnum,
unsigned int  line_no 
)
static

Definition at line 187 of file asmparser.c.

189{
190 asmparser_message(This, "Line %u: Sampler declaration unsupported in this shader version\n", This->line_no);
192}

◆ asmparser_dstreg_ps_1_0123()

static void asmparser_dstreg_ps_1_0123 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1039 of file asmparser.c.

1041 {
1042 struct shader_reg reg;
1043
1045 asmparser_message(This, "Line %u: Destination register %s not supported in PS 1\n",
1046 This->line_no,
1048 set_parse_status(&This->status, PARSE_ERR);
1049 }
1051 instr->dst = reg;
1052 instr->has_dst = TRUE;
1053}
static const struct allowed_reg_type ps_1_0123_reg_allowed[]
Definition: asmparser.c:848
static BOOL check_reg_type(const struct shader_reg *reg, const struct allowed_reg_type *allowed)
Definition: asmparser.c:723
static struct shader_reg map_oldps_register(const struct shader_reg *reg, BOOL tex_varying)
Definition: asmparser.c:228
const char * debug_print_dstreg(const struct shader_reg *reg) DECLSPEC_HIDDEN
Definition: utils.c:330
GLenum GLenum dst
Definition: glext.h:6340
struct shader_reg dst

◆ asmparser_dstreg_ps_1_4()

static void asmparser_dstreg_ps_1_4 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1055 of file asmparser.c.

1057 {
1058 struct shader_reg reg;
1059
1061 asmparser_message(This, "Line %u: Destination register %s not supported in PS 1\n",
1062 This->line_no,
1064 set_parse_status(&This->status, PARSE_ERR);
1065 }
1067 instr->dst = reg;
1068 instr->has_dst = TRUE;
1069}
static const struct allowed_reg_type ps_1_4_reg_allowed[]
Definition: asmparser.c:872

◆ asmparser_dstreg_ps_2()

static void asmparser_dstreg_ps_2 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1071 of file asmparser.c.

1073 {
1074 struct shader_reg reg;
1075
1077 asmparser_message(This, "Line %u: Destination register %s not supported in PS 2.0\n",
1078 This->line_no,
1080 set_parse_status(&This->status, PARSE_ERR);
1081 }
1082 check_shift_dstmod(This, instr->shift);
1084 instr->dst = reg;
1085 instr->has_dst = TRUE;
1086}
static void check_shift_dstmod(struct asm_parser *This, DWORD shift)
Definition: asmparser.c:699
static const struct allowed_reg_type ps_2_0_reg_allowed[]
Definition: asmparser.c:896

◆ asmparser_dstreg_ps_2_x()

static void asmparser_dstreg_ps_2_x ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1088 of file asmparser.c.

1090 {
1091 struct shader_reg reg;
1092
1094 asmparser_message(This, "Line %u: Destination register %s not supported in PS 2.x\n",
1095 This->line_no,
1097 set_parse_status(&This->status, PARSE_ERR);
1098 }
1099 check_shift_dstmod(This, instr->shift);
1101 instr->dst = reg;
1102 instr->has_dst = TRUE;
1103}
static const struct allowed_reg_type ps_2_x_reg_allowed[]
Definition: asmparser.c:926

◆ asmparser_dstreg_ps_3()

static void asmparser_dstreg_ps_3 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1105 of file asmparser.c.

1107 {
1109 asmparser_message(This, "Line %u: Destination register %s not supported in PS 3.0\n",
1110 This->line_no,
1112 set_parse_status(&This->status, PARSE_ERR);
1113 }
1114 check_shift_dstmod(This, instr->shift);
1115 instr->dst = *dst;
1116 instr->has_dst = TRUE;
1117}
static const struct allowed_reg_type ps_3_reg_allowed[]
Definition: asmparser.c:958

◆ asmparser_dstreg_vs_1()

static void asmparser_dstreg_vs_1 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 988 of file asmparser.c.

990 {
991 struct shader_reg reg;
992
994 asmparser_message(This, "Line %u: Destination register %s not supported in VS 1\n",
995 This->line_no,
998 }
999 check_ps_dstmod(This, instr->dstmod);
1000 check_shift_dstmod(This, instr->shift);
1002 instr->dst = reg;
1003 instr->has_dst = TRUE;
1004}
static void check_ps_dstmod(struct asm_parser *This, DWORD dstmod)
Definition: asmparser.c:707
static const struct allowed_reg_type vs_1_reg_allowed[]
Definition: asmparser.c:745
static struct shader_reg map_oldvs_register(const struct shader_reg *reg)
Definition: asmparser.c:607

◆ asmparser_dstreg_vs_2()

static void asmparser_dstreg_vs_2 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1006 of file asmparser.c.

1008 {
1009 struct shader_reg reg;
1010
1012 asmparser_message(This, "Line %u: Destination register %s not supported in VS 2.0\n",
1013 This->line_no,
1015 set_parse_status(&This->status, PARSE_ERR);
1016 }
1017 check_ps_dstmod(This, instr->dstmod);
1018 check_shift_dstmod(This, instr->shift);
1020 instr->dst = reg;
1021 instr->has_dst = TRUE;
1022}
static const struct allowed_reg_type vs_2_reg_allowed[]
Definition: asmparser.c:785

◆ asmparser_dstreg_vs_3()

static void asmparser_dstreg_vs_3 ( struct asm_parser This,
struct instruction instr,
const struct shader_reg dst 
)
static

Definition at line 1024 of file asmparser.c.

1026 {
1028 asmparser_message(This, "Line %u: Destination register %s not supported in VS 3.0\n",
1029 This->line_no,
1031 set_parse_status(&This->status, PARSE_ERR);
1032 }
1033 check_ps_dstmod(This, instr->dstmod);
1034 check_shift_dstmod(This, instr->shift);
1035 instr->dst = *dst;
1036 instr->has_dst = TRUE;
1037}
static const struct allowed_reg_type vs_3_reg_allowed[]
Definition: asmparser.c:819

◆ asmparser_end()

static void asmparser_end ( struct asm_parser This)
static

Definition at line 70 of file asmparser.c.

70 {
71 TRACE("Finalizing shader\n");
72}

◆ asmparser_instr()

static void asmparser_instr ( struct asm_parser This,
DWORD  opcode,
DWORD  mod,
DWORD  shift,
enum bwriter_comparison_type  comp,
const struct shader_reg dst,
const struct src_regs srcs,
int  expectednsrcs 
)
static

Definition at line 502 of file asmparser.c.

505{
506 struct instruction *instr;
507 unsigned int i;
508 BOOL firstreg = TRUE;
509 unsigned int src_count = srcs ? srcs->count : 0;
510
511 if(!This->shader) return;
512
513 TRACE_(parsed_shader)("%s%s%s%s ", debug_print_opcode(opcode),
516 debug_print_comp(comp));
517 if(dst) {
518 TRACE_(parsed_shader)("%s", debug_print_dstreg(dst));
519 firstreg = FALSE;
520 }
521 for(i = 0; i < src_count; i++) {
522 if(!firstreg) TRACE_(parsed_shader)(", ");
523 else firstreg = FALSE;
524 TRACE_(parsed_shader)("%s", debug_print_srcreg(&srcs->reg[i]));
525 }
526 TRACE_(parsed_shader)("\n");
527
528 /* Check for instructions with different syntaxes in different shader versions */
529 switch(opcode) {
531 /* The syntax changes between vs 2 and the other shader versions */
532 if(This->shader->version == BWRITERVS_VERSION(2, 0) ||
533 This->shader->version == BWRITERVS_VERSION(2, 1)) {
535 return;
536 }
537 /* Use the default handling */
538 break;
540 /* texcoord/texcrd are two instructions present only in PS <= 1.3 and PS 1.4 respectively */
541 if(This->shader->version == BWRITERPS_VERSION(1, 4))
543 else asmparser_texcoord(This, mod, shift, dst, srcs);
544 return;
545 case BWRITERSIO_TEX:
546 /* this encodes both the tex PS 1.x instruction and the
547 texld 1.4/2.0+ instruction */
548 if(This->shader->version == BWRITERPS_VERSION(1, 0) ||
549 This->shader->version == BWRITERPS_VERSION(1, 1) ||
550 This->shader->version == BWRITERPS_VERSION(1, 2) ||
551 This->shader->version == BWRITERPS_VERSION(1, 3)) {
553 return;
554 }
555 else if(This->shader->version == BWRITERPS_VERSION(1, 4)) {
557 return;
558 }
559 /* else fallback to the standard behavior */
560 break;
561 }
562
563 if(src_count != expectednsrcs) {
564 asmparser_message(This, "Line %u: Wrong number of source registers\n", This->line_no);
566 return;
567 }
568
569 /* Handle PS 1.x instructions, "regularizing" them */
570 switch(opcode) {
573 return;
575 asmparser_texreg2ar(This, mod, shift, dst, &srcs->reg[0]);
576 return;
578 asmparser_texreg2gb(This, mod, shift, dst, &srcs->reg[0]);
579 return;
581 asmparser_texreg2rgb(This, mod, shift, dst, &srcs->reg[0]);
582 return;
583 }
584
585 instr = alloc_instr(src_count);
586 if(!instr) {
587 ERR("Error allocating memory for the instruction\n");
589 return;
590 }
591
592 instr->opcode = opcode;
593 instr->dstmod = mod;
594 instr->shift = shift;
595 instr->comptype = comp;
596 if(dst) This->funcs->dstreg(This, instr, dst);
597 for(i = 0; i < src_count; i++) {
598 This->funcs->srcreg(This, instr, i, &srcs->reg[i]);
599 }
600
601 if(!add_instruction(This->shader, instr)) {
602 ERR("Out of memory\n");
604 }
605}
static void asmparser_texreg2rgb(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
Definition: asmparser.c:484
static void asmparser_texcoord(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
Definition: asmparser.c:271
static void asmparser_sincos(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
Definition: asmparser.c:194
static void asmparser_tex(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst)
Definition: asmparser.c:408
static void asmparser_texreg2gb(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
Definition: asmparser.c:473
static void asmparser_texcrd(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
Definition: asmparser.c:308
static void asmparser_texreg2ar(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
Definition: asmparser.c:462
static void asmparser_texld14(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct src_regs *srcs)
Definition: asmparser.c:417
static void asmparser_texkill(struct asm_parser *This, const struct shader_reg *dst)
Definition: asmparser.c:341
struct instruction * alloc_instr(unsigned int srcs)
BOOL add_instruction(struct bwriter_shader *shader, struct instruction *instr)
const char * debug_print_srcreg(const struct shader_reg *reg) DECLSPEC_HIDDEN
Definition: utils.c:337
const char * debug_print_comp(DWORD comp) DECLSPEC_HIDDEN
Definition: utils.c:401
const char * debug_print_opcode(DWORD opcode) DECLSPEC_HIDDEN
Definition: utils.c:416
const char * debug_print_shift(DWORD shift) DECLSPEC_HIDDEN
Definition: utils.c:178
#define BWRITERVS_VERSION(major, minor)
@ BWRITERSIO_TEX
@ BWRITERSIO_TEXREG2AR
@ BWRITERSIO_TEXCOORD
@ BWRITERSIO_TEXREG2RGB
@ BWRITERSIO_SINCOS
@ BWRITERSIO_TEXKILL
@ BWRITERSIO_TEXREG2GB
const char * debug_print_dstmod(DWORD mod) DECLSPEC_HIDDEN
Definition: utils.c:153
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define shift
Definition: input.c:1755
enum bwriter_comparison_type comptype
unsigned int count
struct shader_reg reg[MAX_SRC_REGS]

◆ asmparser_predicate_supported()

static void asmparser_predicate_supported ( struct asm_parser This,
const struct shader_reg predicate 
)
static

Definition at line 1119 of file asmparser.c.

1120 {
1121 /* this sets the predicate of the last instruction added to the shader */
1122 if(!This->shader) return;
1123 if(This->shader->num_instrs == 0) ERR("Predicate without an instruction\n");
1124 This->shader->instr[This->shader->num_instrs - 1]->has_predicate = TRUE;
1125 This->shader->instr[This->shader->num_instrs - 1]->predicate = *predicate;
1126}

◆ asmparser_predicate_unsupported()

static void asmparser_predicate_unsupported ( struct asm_parser This,
const struct shader_reg predicate 
)
static

Definition at line 1128 of file asmparser.c.

1129 {
1130 asmparser_message(This, "Line %u: Predicate not supported in < VS 2.0 or PS 2.x\n", This->line_no);
1131 set_parse_status(&This->status, PARSE_ERR);
1132}

◆ asmparser_sincos()

static void asmparser_sincos ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct src_regs srcs 
)
static

Definition at line 194 of file asmparser.c.

196 {
197 struct instruction *instr;
198
199 if(!srcs || srcs->count != 3) {
200 asmparser_message(This, "Line %u: sincos (vs 2) has an incorrect number of source registers\n", This->line_no);
202 return;
203 }
204
205 instr = alloc_instr(3);
206 if(!instr) {
207 ERR("Error allocating memory for the instruction\n");
209 return;
210 }
211
212 instr->opcode = BWRITERSIO_SINCOS;
213 instr->dstmod = mod;
214 instr->shift = shift;
215 instr->comptype = 0;
216
217 This->funcs->dstreg(This, instr, dst);
218 This->funcs->srcreg(This, instr, 0, &srcs->reg[0]);
219 This->funcs->srcreg(This, instr, 1, &srcs->reg[1]);
220 This->funcs->srcreg(This, instr, 2, &srcs->reg[2]);
221
222 if(!add_instruction(This->shader, instr)) {
223 ERR("Out of memory\n");
225 }
226}

Referenced by asmparser_instr().

◆ asmparser_srcreg_ps_1_0123()

static void asmparser_srcreg_ps_1_0123 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 856 of file asmparser.c.

858 {
859 struct shader_reg reg;
860
862 asmparser_message(This, "Line %u: Source register %s not supported in <== PS 1.3\n",
863 This->line_no,
866 }
867 check_abs_srcmod(This, src->srcmod);
869 instr->src[num] = reg;
870}
static void check_abs_srcmod(struct asm_parser *This, DWORD srcmod)
Definition: asmparser.c:680
GLenum src
Definition: glext.h:6340
struct shader_reg * src

◆ asmparser_srcreg_ps_1_4()

static void asmparser_srcreg_ps_1_4 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 880 of file asmparser.c.

882 {
883 struct shader_reg reg;
884
886 asmparser_message(This, "Line %u: Source register %s not supported in PS 1.4\n",
887 This->line_no,
890 }
891 check_abs_srcmod(This, src->srcmod);
893 instr->src[num] = reg;
894}

◆ asmparser_srcreg_ps_2()

static void asmparser_srcreg_ps_2 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 909 of file asmparser.c.

911 {
912 struct shader_reg reg;
913
915 asmparser_message(This, "Line %u: Source register %s not supported in PS 2.0\n",
916 This->line_no,
919 }
920 check_legacy_srcmod(This, src->srcmod);
921 check_abs_srcmod(This, src->srcmod);
923 instr->src[num] = reg;
924}
static void check_legacy_srcmod(struct asm_parser *This, DWORD srcmod)
Definition: asmparser.c:667

◆ asmparser_srcreg_ps_2_x()

static void asmparser_srcreg_ps_2_x ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 941 of file asmparser.c.

943 {
944 struct shader_reg reg;
945
947 asmparser_message(This, "Line %u: Source register %s not supported in PS 2.x\n",
948 This->line_no,
951 }
952 check_legacy_srcmod(This, src->srcmod);
953 check_abs_srcmod(This, src->srcmod);
955 instr->src[num] = reg;
956}

◆ asmparser_srcreg_ps_3()

static void asmparser_srcreg_ps_3 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 974 of file asmparser.c.

976 {
978 asmparser_message(This, "Line %u: Source register %s not supported in PS 3.0\n",
979 This->line_no,
982 }
984 check_legacy_srcmod(This, src->srcmod);
985 instr->src[num] = *src;
986}
static void check_loop_swizzle(struct asm_parser *This, const struct shader_reg *src)
Definition: asmparser.c:689

◆ asmparser_srcreg_vs_1()

static void asmparser_srcreg_vs_1 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 768 of file asmparser.c.

770 {
771 struct shader_reg reg;
772
774 asmparser_message(This, "Line %u: Source register %s not supported in VS 1\n",
775 This->line_no,
778 }
779 check_legacy_srcmod(This, src->srcmod);
780 check_abs_srcmod(This, src->srcmod);
782 instr->src[num] = reg;
783}

◆ asmparser_srcreg_vs_2()

static void asmparser_srcreg_vs_2 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 801 of file asmparser.c.

803 {
804 struct shader_reg reg;
805
807 asmparser_message(This, "Line %u: Source register %s not supported in VS 2\n",
808 This->line_no,
811 }
813 check_legacy_srcmod(This, src->srcmod);
814 check_abs_srcmod(This, src->srcmod);
816 instr->src[num] = reg;
817}

◆ asmparser_srcreg_vs_3()

static void asmparser_srcreg_vs_3 ( struct asm_parser This,
struct instruction instr,
int  num,
const struct shader_reg src 
)
static

Definition at line 834 of file asmparser.c.

836 {
838 asmparser_message(This, "Line %u: Source register %s not supported in VS 3.0\n",
839 This->line_no,
842 }
844 check_legacy_srcmod(This, src->srcmod);
845 instr->src[num] = *src;
846}

◆ asmparser_tex()

static void asmparser_tex ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst 
)
static

Definition at line 408 of file asmparser.c.

409 {
410 struct shader_reg src;
411
412 /* The first source register is the varying containing the coordinate */
415}
static void asmparser_texhelper(struct asm_parser *This, DWORD mod, DWORD shift, const struct shader_reg *dst, const struct shader_reg *src0)
Definition: asmparser.c:372

Referenced by asmparser_instr().

◆ asmparser_texcoord()

static void asmparser_texcoord ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct src_regs srcs 
)
static

Definition at line 271 of file asmparser.c.

273 {
274 struct instruction *instr;
275
276 if(srcs) {
277 asmparser_message(This, "Line %u: Source registers in texcoord instruction\n", This->line_no);
279 return;
280 }
281
282 instr = alloc_instr(1);
283 if(!instr) {
284 ERR("Error allocating memory for the instruction\n");
286 return;
287 }
288
289 /* texcoord copies the texture coord data into a temporary register-like
290 * readable form. In newer shader models this equals a MOV from v0 to r0,
291 * record it as this.
292 */
293 instr->opcode = BWRITERSIO_MOV;
294 instr->dstmod = mod | BWRITERSPDM_SATURATE; /* texcoord clamps to [0;1] */
295 instr->shift = shift;
296 instr->comptype = 0;
297
298 This->funcs->dstreg(This, instr, dst);
299 /* The src reg needs special care */
300 instr->src[0] = map_oldps_register(dst, TRUE);
301
302 if(!add_instruction(This->shader, instr)) {
303 ERR("Out of memory\n");
305 }
306}
@ BWRITERSPDM_SATURATE
@ BWRITERSIO_MOV

Referenced by asmparser_instr().

◆ asmparser_texcrd()

static void asmparser_texcrd ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct src_regs srcs 
)
static

Definition at line 308 of file asmparser.c.

310 {
311 struct instruction *instr;
312
313 if(!srcs || srcs->count != 1) {
314 asmparser_message(This, "Line %u: Wrong number of source registers in texcrd instruction\n", This->line_no);
316 return;
317 }
318
319 instr = alloc_instr(1);
320 if(!instr) {
321 ERR("Error allocating memory for the instruction\n");
323 return;
324 }
325
326 /* The job of texcrd is done by mov in later shader versions */
327 instr->opcode = BWRITERSIO_MOV;
328 instr->dstmod = mod;
329 instr->shift = shift;
330 instr->comptype = 0;
331
332 This->funcs->dstreg(This, instr, dst);
333 This->funcs->srcreg(This, instr, 0, &srcs->reg[0]);
334
335 if(!add_instruction(This->shader, instr)) {
336 ERR("Out of memory\n");
338 }
339}

Referenced by asmparser_instr().

◆ asmparser_texhelper()

static void asmparser_texhelper ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct shader_reg src0 
)
static

Definition at line 372 of file asmparser.c.

374 {
375 struct instruction *instr = alloc_instr(2);
376
377 if(!instr) {
378 ERR("Error allocating memory for the instruction\n");
380 return;
381 }
382
383 instr->opcode = BWRITERSIO_TEX;
384 instr->dstmod = mod;
385 instr->shift = shift;
386 instr->comptype = 0;
387 /* The dest register can be mapped normally to a temporary register */
388 This->funcs->dstreg(This, instr, dst);
389 /* Use the src passed as parameter by the specific instruction handler */
390 instr->src[0] = *src0;
391
392 /* The 2nd source register is the sampler register with the
393 * destination's regnum
394 */
395 ZeroMemory(&instr->src[1], sizeof(instr->src[1]));
396 instr->src[1].type = BWRITERSPR_SAMPLER;
397 instr->src[1].regnum = dst->regnum;
398 instr->src[1].u.swizzle = BWRITERVS_NOSWIZZLE;
399 instr->src[1].srcmod = BWRITERSPSM_NONE;
400 instr->src[1].rel_reg = NULL;
401
402 if(!add_instruction(This->shader, instr)) {
403 ERR("Out of memory\n");
405 }
406}
@ BWRITERSPSM_NONE
#define BWRITERVS_NOSWIZZLE
@ BWRITERSPR_SAMPLER
#define NULL
Definition: types.h:112
#define ZeroMemory
Definition: winbase.h:1712

Referenced by asmparser_tex(), asmparser_texreg2ar(), asmparser_texreg2gb(), and asmparser_texreg2rgb().

◆ asmparser_texkill()

static void asmparser_texkill ( struct asm_parser This,
const struct shader_reg dst 
)
static

Definition at line 341 of file asmparser.c.

342 {
343 struct instruction *instr = alloc_instr(0);
344
345 if(!instr) {
346 ERR("Error allocating memory for the instruction\n");
348 return;
349 }
350
351 instr->opcode = BWRITERSIO_TEXKILL;
352 instr->dstmod = 0;
353 instr->shift = 0;
354 instr->comptype = 0;
355
356 /* Do not run the dst register through the normal
357 * register conversion. If used with ps_1_0 to ps_1_3
358 * the texture coordinate from that register is used,
359 * not the temporary register value. In ps_1_4 and
360 * ps_2_0 t0 is always a varying and temporaries can
361 * be used with texkill.
362 */
363 instr->dst = map_oldps_register(dst, TRUE);
364 instr->has_dst = TRUE;
365
366 if(!add_instruction(This->shader, instr)) {
367 ERR("Out of memory\n");
369 }
370}

Referenced by asmparser_instr().

◆ asmparser_texld14()

static void asmparser_texld14 ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct src_regs srcs 
)
static

Definition at line 417 of file asmparser.c.

419 {
420 struct instruction *instr;
421
422 if(!srcs || srcs->count != 1) {
423 asmparser_message(This, "Line %u: texld (PS 1.4) has a wrong number of source registers\n", This->line_no);
425 return;
426 }
427
428 instr = alloc_instr(2);
429 if(!instr) {
430 ERR("Error allocating memory for the instruction\n");
432 return;
433 }
434
435 /* This code is recording a texld instruction, not tex. However,
436 * texld borrows the opcode of tex
437 */
438 instr->opcode = BWRITERSIO_TEX;
439 instr->dstmod = mod;
440 instr->shift = shift;
441 instr->comptype = 0;
442
443 This->funcs->dstreg(This, instr, dst);
444 This->funcs->srcreg(This, instr, 0, &srcs->reg[0]);
445
446 /* The 2nd source register is the sampler register with the
447 * destination's regnum
448 */
449 ZeroMemory(&instr->src[1], sizeof(instr->src[1]));
450 instr->src[1].type = BWRITERSPR_SAMPLER;
451 instr->src[1].regnum = dst->regnum;
452 instr->src[1].u.swizzle = BWRITERVS_NOSWIZZLE;
453 instr->src[1].srcmod = BWRITERSPSM_NONE;
454 instr->src[1].rel_reg = NULL;
455
456 if(!add_instruction(This->shader, instr)) {
457 ERR("Out of memory\n");
459 }
460}

Referenced by asmparser_instr().

◆ asmparser_texreg2ar()

static void asmparser_texreg2ar ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct shader_reg src0 
)
static

Definition at line 462 of file asmparser.c.

464 {
465 struct shader_reg src;
466
468 /* Supply the correct swizzle */
471}
#define BWRITERVS_Y_X
#define BWRITERVS_W_X
#define BWRITERVS_Z_X
#define BWRITERVS_X_W

Referenced by asmparser_instr().

◆ asmparser_texreg2gb()

static void asmparser_texreg2gb ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct shader_reg src0 
)
static

Definition at line 473 of file asmparser.c.

475 {
476 struct shader_reg src;
477
479 /* Supply the correct swizzle */
482}
#define BWRITERVS_Z_Z
#define BWRITERVS_Y_Z
#define BWRITERVS_W_Z
#define BWRITERVS_X_Y

Referenced by asmparser_instr().

◆ asmparser_texreg2rgb()

static void asmparser_texreg2rgb ( struct asm_parser This,
DWORD  mod,
DWORD  shift,
const struct shader_reg dst,
const struct shader_reg src0 
)
static

Definition at line 484 of file asmparser.c.

486 {
487 struct shader_reg src;
488
490 /* Supply the correct swizzle */
493}
#define BWRITERVS_X_X
#define BWRITERVS_Y_Y

Referenced by asmparser_instr().

◆ check_abs_srcmod()

static void check_abs_srcmod ( struct asm_parser This,
DWORD  srcmod 
)
static

Definition at line 680 of file asmparser.c.

680 {
681 if(srcmod == BWRITERSPSM_ABS || srcmod == BWRITERSPSM_ABSNEG) {
682 asmparser_message(This, "Line %u: Source modifier %s not supported in this shader version\n",
683 This->line_no,
684 debug_print_srcmod(srcmod));
686 }
687}
@ BWRITERSPSM_ABS
@ BWRITERSPSM_ABSNEG
const char * debug_print_srcmod(DWORD mod) DECLSPEC_HIDDEN
Definition: utils.c:128

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

◆ check_legacy_srcmod()

static void check_legacy_srcmod ( struct asm_parser This,
DWORD  srcmod 
)
static

Definition at line 667 of file asmparser.c.

667 {
668 if(srcmod == BWRITERSPSM_BIAS || srcmod == BWRITERSPSM_BIASNEG ||
669 srcmod == BWRITERSPSM_SIGN || srcmod == BWRITERSPSM_SIGNNEG ||
670 srcmod == BWRITERSPSM_COMP || srcmod == BWRITERSPSM_X2 ||
671 srcmod == BWRITERSPSM_X2NEG || srcmod == BWRITERSPSM_DZ ||
672 srcmod == BWRITERSPSM_DW) {
673 asmparser_message(This, "Line %u: Source modifier %s not supported in this shader version\n",
674 This->line_no,
675 debug_print_srcmod(srcmod));
677 }
678}
@ BWRITERSPSM_COMP
@ BWRITERSPSM_X2
@ BWRITERSPSM_BIAS
@ BWRITERSPSM_X2NEG
@ BWRITERSPSM_SIGNNEG
@ BWRITERSPSM_BIASNEG
@ BWRITERSPSM_DZ
@ BWRITERSPSM_SIGN
@ BWRITERSPSM_DW

Referenced by 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().

◆ check_loop_swizzle()

static void check_loop_swizzle ( struct asm_parser This,
const struct shader_reg src 
)
static

Definition at line 689 of file asmparser.c.

690 {
691 if((src->type == BWRITERSPR_LOOP && src->u.swizzle != BWRITERVS_NOSWIZZLE) ||
692 (src->rel_reg && src->rel_reg->type == BWRITERSPR_LOOP &&
693 src->rel_reg->u.swizzle != BWRITERVS_NOSWIZZLE)) {
694 asmparser_message(This, "Line %u: Swizzle not allowed on aL register\n", This->line_no);
696 }
697}
@ BWRITERSPR_LOOP

Referenced by asmparser_srcreg_ps_3(), asmparser_srcreg_vs_2(), and asmparser_srcreg_vs_3().

◆ check_ps_dstmod()

static void check_ps_dstmod ( struct asm_parser This,
DWORD  dstmod 
)
static

Definition at line 707 of file asmparser.c.

707 {
708 if(dstmod == BWRITERSPDM_PARTIALPRECISION ||
709 dstmod == BWRITERSPDM_MSAMPCENTROID) {
710 asmparser_message(This, "Line %u: Instruction modifier %s not supported in this shader version\n",
711 This->line_no,
712 debug_print_dstmod(dstmod));
714 }
715}

Referenced by asmparser_dstreg_vs_1(), asmparser_dstreg_vs_2(), and asmparser_dstreg_vs_3().

◆ check_reg_type()

static BOOL check_reg_type ( const struct shader_reg reg,
const struct allowed_reg_type allowed 
)
static

Definition at line 723 of file asmparser.c.

724 {
725 unsigned int i = 0;
726
727 while(allowed[i].type != ~0U) {
728 if(reg->type == allowed[i].type) {
729 if(reg->rel_reg) {
730 if(allowed[i].reladdr)
731 return TRUE; /* The relative addressing register
732 can have a negative value, we
733 can't check the register index */
734 return FALSE;
735 }
736 if(reg->regnum < allowed[i].count) return TRUE;
737 return FALSE;
738 }
739 i++;
740 }
741 return FALSE;
742}
#define U(x)
Definition: wordpad.c:45
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

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(), 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().

◆ check_shift_dstmod()

static void check_shift_dstmod ( struct asm_parser This,
DWORD  shift 
)
static

Definition at line 699 of file asmparser.c.

699 {
700 if(shift != 0) {
701 asmparser_message(This, "Line %u: Shift modifiers not supported in this shader version\n",
702 This->line_no);
704 }
705}

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

◆ 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 * d3dcompiler_alloc(SIZE_T size)
int ret

◆ 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
@ ST_VERTEX

◆ 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

◆ gen_oldps_input()

static void gen_oldps_input ( struct bwriter_shader shader,
DWORD  texcoords 
)
static

Definition at line 1325 of file asmparser.c.

1325 {
1326 switch(texcoords) {
1328 /* fall through */
1330 /* fall through */
1332 /* fall through */
1334 /* fall through */
1336 /* fall through */
1338 /* fall through */
1340 /* fall through */
1342 };
1345}
#define T5_VARYING
Definition: asmparser.c:62
#define T2_VARYING
Definition: asmparser.c:59
#define T1_VARYING
Definition: asmparser.c:58
#define T0_VARYING
Definition: asmparser.c:57
#define T7_VARYING
Definition: asmparser.c:64
#define C0_VARYING
Definition: asmparser.c:55
#define C1_VARYING
Definition: asmparser.c:56
#define T3_VARYING
Definition: asmparser.c:60
#define T4_VARYING
Definition: asmparser.c:61
#define T6_VARYING
Definition: asmparser.c:63
@ BWRITERDECLUSAGE_COLOR
@ BWRITERDECLUSAGE_TEXCOORD
#define BWRITERSP_WRITEMASK_ALL
GLuint shader
Definition: glext.h:6030

Referenced by create_ps10_parser(), create_ps11_parser(), create_ps12_parser(), create_ps13_parser(), create_ps14_parser(), create_ps20_parser(), and create_ps2x_parser().

◆ gen_oldvs_output()

static void gen_oldvs_output ( struct bwriter_shader shader)
static

Definition at line 1309 of file asmparser.c.

1309 {
1323}
#define OT2_REG
Definition: asmparser.c:40
#define OT6_REG
Definition: asmparser.c:44
#define OT0_REG
Definition: asmparser.c:38
#define OPTS_WRITEMASK
Definition: asmparser.c:50
#define OD1_REG
Definition: asmparser.c:52
#define OFOG_WRITEMASK
Definition: asmparser.c:48
#define OPTS_REG
Definition: asmparser.c:49
#define OT4_REG
Definition: asmparser.c:42
#define OFOG_REG
Definition: asmparser.c:47
#define OD0_REG
Definition: asmparser.c:51
#define OT5_REG
Definition: asmparser.c:43
#define OPOS_REG
Definition: asmparser.c:46
#define OT1_REG
Definition: asmparser.c:39
#define OT7_REG
Definition: asmparser.c:45
#define OT3_REG
Definition: asmparser.c:41
@ BWRITERDECLUSAGE_FOG
@ BWRITERDECLUSAGE_PSIZE
@ BWRITERDECLUSAGE_POSITION

Referenced by create_vs10_parser(), create_vs11_parser(), create_vs20_parser(), and create_vs2x_parser().

◆ map_oldps_register()

static struct shader_reg map_oldps_register ( const struct shader_reg reg,
BOOL  tex_varying 
)
static

Definition at line 228 of file asmparser.c.

228 {
229 struct shader_reg ret;
230 switch(reg->type) {
232 if(tex_varying) {
233 ret = *reg;
234 ret.type = BWRITERSPR_INPUT;
235 switch(reg->regnum) {
236 case 0: ret.regnum = T0_VARYING; break;
237 case 1: ret.regnum = T1_VARYING; break;
238 case 2: ret.regnum = T2_VARYING; break;
239 case 3: ret.regnum = T3_VARYING; break;
240 case 4: ret.regnum = T4_VARYING; break;
241 case 5: ret.regnum = T5_VARYING; break;
242 case 6: ret.regnum = T6_VARYING; break;
243 case 7: ret.regnum = T7_VARYING; break;
244 default:
245 FIXME("Unexpected TEXTURE register t%u\n", reg->regnum);
246 return *reg;
247 }
248 return ret;
249 } else {
250 ret = *reg;
251 ret.type = BWRITERSPR_TEMP;
252 switch(reg->regnum) {
253 case 0: ret.regnum = T0_REG; break;
254 case 1: ret.regnum = T1_REG; break;
255 case 2: ret.regnum = T2_REG; break;
256 case 3: ret.regnum = T3_REG; break;
257 default:
258 FIXME("Unexpected TEXTURE register t%u\n", reg->regnum);
259 return *reg;
260 }
261 return ret;
262 }
263
264 /* case BWRITERSPR_INPUT - Identical mapping of 1.x/2.0 color varyings
265 to 3.0 ones */
266
267 default: return *reg;
268 }
269}
#define FIXME(fmt,...)
Definition: debug.h:111
#define T3_REG
#define T1_REG
#define T0_REG
@ BWRITERSPR_TEXTURE
@ BWRITERSPR_TEMP
@ BWRITERSPR_INPUT
#define T2_REG

Referenced by asmparser_dstreg_ps_1_0123(), asmparser_dstreg_ps_1_4(), asmparser_dstreg_ps_2(), asmparser_dstreg_ps_2_x(), asmparser_srcreg_ps_1_0123(), asmparser_srcreg_ps_1_4(), asmparser_srcreg_ps_2(), asmparser_srcreg_ps_2_x(), asmparser_tex(), asmparser_texcoord(), asmparser_texkill(), asmparser_texreg2ar(), asmparser_texreg2gb(), and asmparser_texreg2rgb().

◆ map_oldvs_register()

static struct shader_reg map_oldvs_register ( const struct shader_reg reg)
static

Definition at line 607 of file asmparser.c.

607 {
608 struct shader_reg ret;
609 switch(reg->type) {
611 ret = *reg;
612 ret.type = BWRITERSPR_OUTPUT;
613 switch(reg->regnum) {
615 ret.regnum = OPOS_REG;
616 break;
617 case BWRITERSRO_FOG:
618 ret.regnum = OFOG_REG;
619 ret.u.writemask = OFOG_WRITEMASK;
620 break;
622 ret.regnum = OPTS_REG;
623 ret.u.writemask = OPTS_WRITEMASK;
624 break;
625 default:
626 FIXME("Unhandled RASTOUT register %u\n", reg->regnum);
627 return *reg;
628 }
629 return ret;
630
632 ret = *reg;
633 ret.type = BWRITERSPR_OUTPUT;
634 switch(reg->regnum) {
635 case 0: ret.regnum = OT0_REG; break;
636 case 1: ret.regnum = OT1_REG; break;
637 case 2: ret.regnum = OT2_REG; break;
638 case 3: ret.regnum = OT3_REG; break;
639 case 4: ret.regnum = OT4_REG; break;
640 case 5: ret.regnum = OT5_REG; break;
641 case 6: ret.regnum = OT6_REG; break;
642 case 7: ret.regnum = OT7_REG; break;
643 default:
644 FIXME("Unhandled TEXCRDOUT regnum %u\n", reg->regnum);
645 return *reg;
646 }
647 return ret;
648
650 ret = *reg;
651 ret.type = BWRITERSPR_OUTPUT;
652 switch(reg->regnum) {
653 case 0: ret.regnum = OD0_REG; break;
654 case 1: ret.regnum = OD1_REG; break;
655 default:
656 FIXME("Unhandled ATTROUT regnum %u\n", reg->regnum);
657 return *reg;
658 }
659 return ret;
660
661 default: return *reg;
662 }
663}
@ BWRITERSRO_POSITION
@ BWRITERSRO_FOG
@ BWRITERSRO_POINT_SIZE
@ BWRITERSPR_TEXCRDOUT
@ BWRITERSPR_RASTOUT
@ BWRITERSPR_ATTROUT
@ BWRITERSPR_OUTPUT

Referenced by asmparser_dstreg_vs_1(), asmparser_dstreg_vs_2(), asmparser_srcreg_vs_1(), and asmparser_srcreg_vs_2().

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( parsed_shader  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( asmshader  )

Variable Documentation

◆ parser_ps_1_0123

const struct asmparser_backend parser_ps_1_0123
static
Initial value:
= {
}
static void asmparser_dcl_input_unsupported(struct asm_parser *This, DWORD usage, DWORD num, DWORD mod, const struct shader_reg *reg)
Definition: asmparser.c:162
static void asmparser_constI(struct asm_parser *This, DWORD reg, INT x, INT y, INT z, INT w)
Definition: asmparser.c:94
static void asmparser_dstreg_ps_1_0123(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1039
static void asmparser_dcl_output_unsupported(struct asm_parser *This, DWORD usage, DWORD num, const struct shader_reg *reg)
Definition: asmparser.c:117
static void asmparser_end(struct asm_parser *This)
Definition: asmparser.c:70
static void asmparser_predicate_unsupported(struct asm_parser *This, const struct shader_reg *predicate)
Definition: asmparser.c:1128
static void asmparser_dcl_sampler_unsupported(struct asm_parser *This, DWORD samptype, DWORD mod, DWORD regnum, unsigned int line_no)
Definition: asmparser.c:187
static void asmparser_constB(struct asm_parser *This, DWORD reg, BOOL x)
Definition: asmparser.c:84
static void asmparser_srcreg_ps_1_0123(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:856
static void asmparser_coissue_supported(struct asm_parser *This)
Definition: asmparser.c:1134
static void asmparser_constF(struct asm_parser *This, DWORD reg, float x, float y, float z, float w)
Definition: asmparser.c:74
static void asmparser_instr(struct asm_parser *This, DWORD opcode, DWORD mod, DWORD shift, enum bwriter_comparison_type comp, const struct shader_reg *dst, const struct src_regs *srcs, int expectednsrcs)
Definition: asmparser.c:502

Definition at line 1209 of file asmparser.c.

Referenced by create_ps10_parser(), create_ps11_parser(), create_ps12_parser(), and create_ps13_parser().

◆ parser_ps_1_4

const struct asmparser_backend parser_ps_1_4
static
Initial value:
= {
}
static void asmparser_srcreg_ps_1_4(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:880
static void asmparser_dstreg_ps_1_4(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1055

Definition at line 1229 of file asmparser.c.

Referenced by create_ps14_parser().

◆ parser_ps_2

const struct asmparser_backend parser_ps_2
static
Initial value:
= {
}
static void asmparser_coissue_unsupported(struct asm_parser *This)
Definition: asmparser.c:1144
static void asmparser_dstreg_ps_2(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1071
static void asmparser_srcreg_ps_2(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:909
static void asmparser_dcl_input_ps_2(struct asm_parser *This, DWORD usage, DWORD num, DWORD mod, const struct shader_reg *reg)
Definition: asmparser.c:148
static void asmparser_dcl_sampler(struct asm_parser *This, DWORD samptype, DWORD mod, DWORD regnum, unsigned int line_no)
Definition: asmparser.c:169

Definition at line 1249 of file asmparser.c.

Referenced by create_ps20_parser().

◆ parser_ps_2_x

const struct asmparser_backend parser_ps_2_x
static
Initial value:
= {
}
static void asmparser_dstreg_ps_2_x(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1088
static void asmparser_predicate_supported(struct asm_parser *This, const struct shader_reg *predicate)
Definition: asmparser.c:1119
static void asmparser_srcreg_ps_2_x(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:941

Definition at line 1269 of file asmparser.c.

Referenced by create_ps2x_parser().

◆ parser_ps_3

const struct asmparser_backend parser_ps_3
static
Initial value:
= {
}
static void asmparser_dcl_input(struct asm_parser *This, DWORD usage, DWORD num, DWORD mod, const struct shader_reg *reg)
Definition: asmparser.c:123
static void asmparser_srcreg_ps_3(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:974
static void asmparser_dstreg_ps_3(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1105

Definition at line 1289 of file asmparser.c.

Referenced by create_ps30_parser().

◆ parser_vs_1

const struct asmparser_backend parser_vs_1
static
Initial value:
= {
}
static void asmparser_srcreg_vs_1(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:768
static void asmparser_dstreg_vs_1(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:988

Definition at line 1149 of file asmparser.c.

Referenced by create_vs10_parser(), and create_vs11_parser().

◆ parser_vs_2

const struct asmparser_backend parser_vs_2
static
Initial value:
= {
}
static void asmparser_dstreg_vs_2(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1006
static void asmparser_srcreg_vs_2(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:801

Definition at line 1169 of file asmparser.c.

Referenced by create_vs20_parser(), and create_vs2x_parser().

◆ parser_vs_3

const struct asmparser_backend parser_vs_3
static
Initial value:
= {
}
static void asmparser_dstreg_vs_3(struct asm_parser *This, struct instruction *instr, const struct shader_reg *dst)
Definition: asmparser.c:1024
static void asmparser_srcreg_vs_3(struct asm_parser *This, struct instruction *instr, int num, const struct shader_reg *src)
Definition: asmparser.c:834
static void asmparser_dcl_output(struct asm_parser *This, DWORD usage, DWORD num, const struct shader_reg *reg)
Definition: asmparser.c:104

Definition at line 1189 of file asmparser.c.

Referenced by create_vs30_parser().

◆ ps_1_0123_reg_allowed

const struct allowed_reg_type ps_1_0123_reg_allowed[]
static
Initial value:
= {
{ ~0U, 0 }
}
@ BWRITERSPR_CONST

Definition at line 848 of file asmparser.c.

Referenced by asmparser_dstreg_ps_1_0123(), and asmparser_srcreg_ps_1_0123().

◆ ps_1_4_reg_allowed

const struct allowed_reg_type ps_1_4_reg_allowed[]
static
Initial value:
= {
{ ~0U, 0 }
}

Definition at line 872 of file asmparser.c.

Referenced by asmparser_dstreg_ps_1_4(), and asmparser_srcreg_ps_1_4().

◆ ps_2_0_reg_allowed

const struct allowed_reg_type ps_2_0_reg_allowed[]
static
Initial value:
= {
{ ~0U, 0 }
}
@ BWRITERSPR_CONSTINT
@ BWRITERSPR_CONSTBOOL
@ BWRITERSPR_COLOROUT
@ BWRITERSPR_DEPTHOUT

Definition at line 896 of file asmparser.c.

Referenced by asmparser_dstreg_ps_2(), and asmparser_srcreg_ps_2().

◆ ps_2_x_reg_allowed

const struct allowed_reg_type ps_2_x_reg_allowed[]
static
Initial value:

Definition at line 926 of file asmparser.c.

Referenced by asmparser_dstreg_ps_2_x(), and asmparser_srcreg_ps_2_x().

◆ ps_3_reg_allowed

const struct allowed_reg_type ps_3_reg_allowed[]
static
Initial value:

Definition at line 958 of file asmparser.c.

Referenced by asmparser_dstreg_ps_3(), and asmparser_srcreg_ps_3().

◆ vs_1_reg_allowed

const struct allowed_reg_type vs_1_reg_allowed[]
static
Initial value:

Definition at line 745 of file asmparser.c.

Referenced by asmparser_dstreg_vs_1(), and asmparser_srcreg_vs_1().

◆ vs_2_reg_allowed

const struct allowed_reg_type vs_2_reg_allowed[]
static
Initial value:

Definition at line 785 of file asmparser.c.

Referenced by asmparser_dstreg_vs_2(), and asmparser_srcreg_vs_2().

◆ vs_3_reg_allowed

const struct allowed_reg_type vs_3_reg_allowed[]
static
Initial value:

Definition at line 819 of file asmparser.c.

Referenced by asmparser_dstreg_vs_3(), and asmparser_srcreg_vs_3().