Commit d567a030 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3dx9: Shader assembler <= ps_1_3 support.

parent 8ce3ecea
......@@ -329,26 +329,22 @@ version_marker: VER_VS10
| VER_PS10
{
TRACE("Pixel shader 1.0\n");
set_parse_status(&asm_ctx, PARSE_ERR);
YYABORT;
create_ps10_parser(&asm_ctx);
}
| VER_PS11
{
TRACE("Pixel shader 1.1\n");
set_parse_status(&asm_ctx, PARSE_ERR);
YYABORT;
create_ps11_parser(&asm_ctx);
}
| VER_PS12
{
TRACE("Pixel shader 1.2\n");
set_parse_status(&asm_ctx, PARSE_ERR);
YYABORT;
create_ps12_parser(&asm_ctx);
}
| VER_PS13
{
TRACE("Pixel shader 1.3\n");
set_parse_status(&asm_ctx, PARSE_ERR);
YYABORT;
create_ps13_parser(&asm_ctx);
}
| VER_PS14
{
......
......@@ -323,6 +323,10 @@ 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);
......@@ -639,6 +643,12 @@ typedef enum _BWRITERDECLUSAGE {
BWRITERDECLUSAGE_SAMPLE
} BWRITERDECLUSAGE;
/* ps 1.x texture registers mappings */
#define T0_REG 2
#define T1_REG 3
#define T2_REG 4
#define T3_REG 5
struct bwriter_shader *SlAssembleShader(const char *text, char **messages);
DWORD SlWriteBytecode(const struct bwriter_shader *shader, int dxversion, DWORD **result);
void SlDeleteShader(struct bwriter_shader *shader);
......
......@@ -132,6 +132,11 @@ static void ps_1_1_test(void) {
{0xffff0101, 0x00000042, 0xb00f0000, 0x00000002, 0x80070000, 0x80e40000,
0x80e40001, 0x40000001, 0x80080000, 0xb0e40000, 0x0000ffff}
},
{ /* shader 1 */
"ps.1.1\n"
"mov_d4 r0, r1\n",
{0xffff0101, 0x00000001, 0x8e0f0000, 0x80e40001, 0x0000ffff}
},
};
exec_tests("ps_1_1", tests, sizeof(tests) / sizeof(tests[0]));
......@@ -478,6 +483,43 @@ static void ps_1_3_test(void) {
"mov_x4_sat r0.a, -r1_bx2.a\n",
{0xffff0103, 0x00000001, 0x82180000, 0x85ff0001, 0x0000ffff}
},
{ /* shader 30 */
"ps_1_3\n"
"texcoord_x2 t0\n",
{0xffff0103, 0x00000040, 0xb10f0000, 0x0000ffff}
},
{ /* shader 31 */
"ps_1_3\n"
"tex_x2 t0\n",
{0xffff0103, 0x00000042, 0xb10f0000, 0x0000ffff}
},
{ /* shader 32 */
"ps_1_3\n"
"texreg2ar_x4 t0, t1\n",
{0xffff0103, 0x00000045, 0xb20f0000, 0xb0e40001, 0x0000ffff}
},
{ /* shader 33 */
"ps_1_3\n"
"texbem_d4 t1, t0\n",
{0xffff0103, 0x00000043, 0xbe0f0001, 0xb0e40000, 0x0000ffff}
},
{ /* shader 34 */
"ps_1_3\n"
"tex t0\n"
"texm3x3pad_x2 t1, t0\n"
"texm3x3pad_x2 t2, t0\n"
"texm3x3tex_x2 t3, t0\n",
{0xffff0103, 0x00000042, 0xb00f0000, 0x00000049, 0xb10f0001, 0xb0e40000,
0x00000049, 0xb10f0002, 0xb0e40000, 0x0000004a, 0xb10f0003, 0xb0e40000,
0x0000ffff}
},
{ /* shader 35 */
"ps_1_3\n"
"tex t0\n"
"texdp3tex_x8 t1, t0\n",
{0xffff0103, 0x00000042, 0xb00f0000, 0x00000053, 0xb30f0001, 0xb0e40000,
0x0000ffff}
},
};
exec_tests("ps_1_3", tests, sizeof(tests) / sizeof(tests[0]));
......@@ -1661,9 +1703,9 @@ static void assembleshader_test(void) {
START_TEST(asm)
{
preproc_test();
todo_wine ps_1_1_test();
ps_1_1_test();
vs_1_1_test();
todo_wine ps_1_3_test();
ps_1_3_test();
ps_1_4_test();
vs_2_0_test();
vs_2_x_test();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment