ReactOS 0.4.17-dev-966-gf06eace
shader_sm1.c
Go to the documentation of this file.
1/*
2 * Copyright 2002-2003 Jason Edmeades
3 * Copyright 2002-2003 Raphael Junqueira
4 * Copyright 2004 Christian Costa
5 * Copyright 2005 Oliver Stieber
6 * Copyright 2006 Ivan Gyurdiev
7 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers
8 * Copyright 2009 Henri Verbeet for CodeWeavers
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include "wined3d_private.h"
26
28
29/* DCL usage masks */
30#define WINED3D_SM1_DCL_USAGE_SHIFT 0
31#define WINED3D_SM1_DCL_USAGE_MASK (0xfu << WINED3D_SM1_DCL_USAGE_SHIFT)
32#define WINED3D_SM1_DCL_USAGE_INDEX_SHIFT 16
33#define WINED3D_SM1_DCL_USAGE_INDEX_MASK (0xfu << WINED3D_SM1_DCL_USAGE_INDEX_SHIFT)
34
35/* DCL sampler type */
36#define WINED3D_SM1_RESOURCE_TYPE_SHIFT 27
37#define WINED3D_SM1_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM1_RESOURCE_TYPE_SHIFT)
38
39/* Opcode-related masks */
40#define WINED3D_SM1_OPCODE_MASK 0x0000ffff
41
42#define WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT 16
43#define WINED3D_SM1_INSTRUCTION_FLAGS_MASK (0xffu << WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT)
44
45#define WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT 24
46#define WINED3D_SM1_INSTRUCTION_LENGTH_MASK (0xfu << WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT)
47
48#define WINED3D_SM1_COISSUE (0x1u << 30)
49
50#define WINED3D_SM1_COMMENT_SIZE_SHIFT 16
51#define WINED3D_SM1_COMMENT_SIZE_MASK (0x7fffu << WINED3D_SM1_COMMENT_SIZE_SHIFT)
52
53#define WINED3D_SM1_INSTRUCTION_PREDICATED (0x1u << 28)
54
55/* Register number mask */
56#define WINED3D_SM1_REGISTER_NUMBER_MASK 0x000007ff
57
58/* Register type masks */
59#define WINED3D_SM1_REGISTER_TYPE_SHIFT 28
60#define WINED3D_SM1_REGISTER_TYPE_MASK (0x7u << WINED3D_SM1_REGISTER_TYPE_SHIFT)
61#define WINED3D_SM1_REGISTER_TYPE_SHIFT2 8
62#define WINED3D_SM1_REGISTER_TYPE_MASK2 (0x18u << WINED3D_SM1_REGISTER_TYPE_SHIFT2)
63
64/* Relative addressing mask */
65#define WINED3D_SM1_ADDRESS_MODE_SHIFT 13
66#define WINED3D_SM1_ADDRESS_MODE_MASK (0x1u << WINED3D_SM1_ADDRESS_MODE_SHIFT)
67
68/* Destination modifier mask */
69#define WINED3D_SM1_DST_MODIFIER_SHIFT 20
70#define WINED3D_SM1_DST_MODIFIER_MASK (0xfu << WINED3D_SM1_DST_MODIFIER_SHIFT)
71
72/* Destination shift mask */
73#define WINED3D_SM1_DSTSHIFT_SHIFT 24
74#define WINED3D_SM1_DSTSHIFT_MASK (0xfu << WINED3D_SM1_DSTSHIFT_SHIFT)
75
76/* Write mask */
77#define WINED3D_SM1_WRITEMASK_SHIFT 16
78#define WINED3D_SM1_WRITEMASK_MASK (0xfu << WINED3D_SM1_WRITEMASK_SHIFT)
79
80/* Swizzle mask */
81#define WINED3D_SM1_SWIZZLE_SHIFT 16
82#define WINED3D_SM1_SWIZZLE_MASK (0xffu << WINED3D_SM1_SWIZZLE_SHIFT)
83
84/* Source modifier mask */
85#define WINED3D_SM1_SRC_MODIFIER_SHIFT 24
86#define WINED3D_SM1_SRC_MODIFIER_MASK (0xfu << WINED3D_SM1_SRC_MODIFIER_SHIFT)
87
88#define WINED3D_SM1_END 0x0000ffff
89
90#define WINED3D_SM1_VERSION_MAJOR(version) (((version) >> 8) & 0xff)
91#define WINED3D_SM1_VERSION_MINOR(version) (((version) >> 0) & 0xff)
92
94{
97};
98
100{
106};
107
109{
159
193
197};
198
200{
202 unsigned int dst_count;
203 unsigned int param_count;
207};
208
210{
213 const DWORD *start;
214
221};
222
223/* This table is not order or position dependent. */
225{
226 /* Arithmetic */
227 {WINED3D_SM1_OP_NOP, 0, 0, WINED3DSIH_NOP, 0, 0 },
228 {WINED3D_SM1_OP_MOV, 1, 2, WINED3DSIH_MOV, 0, 0 },
230 {WINED3D_SM1_OP_ADD, 1, 3, WINED3DSIH_ADD, 0, 0 },
231 {WINED3D_SM1_OP_SUB, 1, 3, WINED3DSIH_SUB, 0, 0 },
232 {WINED3D_SM1_OP_MAD, 1, 4, WINED3DSIH_MAD, 0, 0 },
233 {WINED3D_SM1_OP_MUL, 1, 3, WINED3DSIH_MUL, 0, 0 },
234 {WINED3D_SM1_OP_RCP, 1, 2, WINED3DSIH_RCP, 0, 0 },
235 {WINED3D_SM1_OP_RSQ, 1, 2, WINED3DSIH_RSQ, 0, 0 },
236 {WINED3D_SM1_OP_DP3, 1, 3, WINED3DSIH_DP3, 0, 0 },
237 {WINED3D_SM1_OP_DP4, 1, 3, WINED3DSIH_DP4, 0, 0 },
238 {WINED3D_SM1_OP_MIN, 1, 3, WINED3DSIH_MIN, 0, 0 },
239 {WINED3D_SM1_OP_MAX, 1, 3, WINED3DSIH_MAX, 0, 0 },
240 {WINED3D_SM1_OP_SLT, 1, 3, WINED3DSIH_SLT, 0, 0 },
241 {WINED3D_SM1_OP_SGE, 1, 3, WINED3DSIH_SGE, 0, 0 },
242 {WINED3D_SM1_OP_ABS, 1, 2, WINED3DSIH_ABS, 0, 0 },
243 {WINED3D_SM1_OP_EXP, 1, 2, WINED3DSIH_EXP, 0, 0 },
244 {WINED3D_SM1_OP_LOG, 1, 2, WINED3DSIH_LOG, 0, 0 },
245 {WINED3D_SM1_OP_EXPP, 1, 2, WINED3DSIH_EXPP, 0, 0 },
246 {WINED3D_SM1_OP_LOGP, 1, 2, WINED3DSIH_LOGP, 0, 0 },
247 {WINED3D_SM1_OP_LIT, 1, 2, WINED3DSIH_LIT, 0, 0 },
248 {WINED3D_SM1_OP_DST, 1, 3, WINED3DSIH_DST, 0, 0 },
249 {WINED3D_SM1_OP_LRP, 1, 4, WINED3DSIH_LRP, 0, 0 },
250 {WINED3D_SM1_OP_FRC, 1, 2, WINED3DSIH_FRC, 0, 0 },
251 {WINED3D_SM1_OP_POW, 1, 3, WINED3DSIH_POW, 0, 0 },
252 {WINED3D_SM1_OP_CRS, 1, 3, WINED3DSIH_CRS, 0, 0 },
255 {WINED3D_SM1_OP_NRM, 1, 2, WINED3DSIH_NRM, 0, 0 },
258 /* Matrix */
259 {WINED3D_SM1_OP_M4x4, 1, 3, WINED3DSIH_M4x4, 0, 0 },
260 {WINED3D_SM1_OP_M4x3, 1, 3, WINED3DSIH_M4x3, 0, 0 },
261 {WINED3D_SM1_OP_M3x4, 1, 3, WINED3DSIH_M3x4, 0, 0 },
262 {WINED3D_SM1_OP_M3x3, 1, 3, WINED3DSIH_M3x3, 0, 0 },
263 {WINED3D_SM1_OP_M3x2, 1, 3, WINED3DSIH_M3x2, 0, 0 },
264 /* Declare registers */
265 {WINED3D_SM1_OP_DCL, 0, 2, WINED3DSIH_DCL, 0, 0 },
266 /* Constant definitions */
267 {WINED3D_SM1_OP_DEF, 1, 5, WINED3DSIH_DEF, 0, 0 },
268 {WINED3D_SM1_OP_DEFB, 1, 2, WINED3DSIH_DEFB, 0, 0 },
269 {WINED3D_SM1_OP_DEFI, 1, 5, WINED3DSIH_DEFI, 0, 0 },
270 /* Flow control */
286
287 {WINED3D_SM1_OP_SETP, 1, 3, WINED3DSIH_SETP, 0, 0 },
289 {0, 0, 0, WINED3DSIH_TABLE_SIZE, 0, 0 },
290};
291
293{
294 /* Arithmetic */
295 {WINED3D_SM1_OP_NOP, 0, 0, WINED3DSIH_NOP, 0, 0 },
296 {WINED3D_SM1_OP_MOV, 1, 2, WINED3DSIH_MOV, 0, 0 },
297 {WINED3D_SM1_OP_ADD, 1, 3, WINED3DSIH_ADD, 0, 0 },
298 {WINED3D_SM1_OP_SUB, 1, 3, WINED3DSIH_SUB, 0, 0 },
299 {WINED3D_SM1_OP_MAD, 1, 4, WINED3DSIH_MAD, 0, 0 },
300 {WINED3D_SM1_OP_MUL, 1, 3, WINED3DSIH_MUL, 0, 0 },
301 {WINED3D_SM1_OP_RCP, 1, 2, WINED3DSIH_RCP, 0, 0 },
302 {WINED3D_SM1_OP_RSQ, 1, 2, WINED3DSIH_RSQ, 0, 0 },
303 {WINED3D_SM1_OP_DP3, 1, 3, WINED3DSIH_DP3, 0, 0 },
304 {WINED3D_SM1_OP_DP4, 1, 3, WINED3DSIH_DP4, 0, 0 },
305 {WINED3D_SM1_OP_MIN, 1, 3, WINED3DSIH_MIN, 0, 0 },
306 {WINED3D_SM1_OP_MAX, 1, 3, WINED3DSIH_MAX, 0, 0 },
307 {WINED3D_SM1_OP_SLT, 1, 3, WINED3DSIH_SLT, 0, 0 },
308 {WINED3D_SM1_OP_SGE, 1, 3, WINED3DSIH_SGE, 0, 0 },
309 {WINED3D_SM1_OP_ABS, 1, 2, WINED3DSIH_ABS, 0, 0 },
310 {WINED3D_SM1_OP_EXP, 1, 2, WINED3DSIH_EXP, 0, 0 },
311 {WINED3D_SM1_OP_LOG, 1, 2, WINED3DSIH_LOG, 0, 0 },
312 {WINED3D_SM1_OP_EXPP, 1, 2, WINED3DSIH_EXPP, 0, 0 },
313 {WINED3D_SM1_OP_LOGP, 1, 2, WINED3DSIH_LOGP, 0, 0 },
314 {WINED3D_SM1_OP_DST, 1, 3, WINED3DSIH_DST, 0, 0 },
315 {WINED3D_SM1_OP_LRP, 1, 4, WINED3DSIH_LRP, 0, 0 },
316 {WINED3D_SM1_OP_FRC, 1, 2, WINED3DSIH_FRC, 0, 0 },
319 {WINED3D_SM1_OP_POW, 1, 3, WINED3DSIH_POW, 0, 0 },
320 {WINED3D_SM1_OP_CRS, 1, 3, WINED3DSIH_CRS, 0, 0 },
321 {WINED3D_SM1_OP_NRM, 1, 2, WINED3DSIH_NRM, 0, 0 },
325 /* Matrix */
326 {WINED3D_SM1_OP_M4x4, 1, 3, WINED3DSIH_M4x4, 0, 0 },
327 {WINED3D_SM1_OP_M4x3, 1, 3, WINED3DSIH_M4x3, 0, 0 },
328 {WINED3D_SM1_OP_M3x4, 1, 3, WINED3DSIH_M3x4, 0, 0 },
329 {WINED3D_SM1_OP_M3x3, 1, 3, WINED3DSIH_M3x3, 0, 0 },
330 {WINED3D_SM1_OP_M3x2, 1, 3, WINED3DSIH_M3x2, 0, 0 },
331 /* Register declarations */
332 {WINED3D_SM1_OP_DCL, 0, 2, WINED3DSIH_DCL, 0, 0 },
333 /* Flow control */
349 /* Constant definitions */
350 {WINED3D_SM1_OP_DEF, 1, 5, WINED3DSIH_DEF, 0, 0 },
351 {WINED3D_SM1_OP_DEFB, 1, 2, WINED3DSIH_DEFB, 0, 0 },
352 {WINED3D_SM1_OP_DEFI, 1, 5, WINED3DSIH_DEFI, 0, 0 },
353 /* Texture */
381 {WINED3D_SM1_OP_SETP, 1, 3, WINED3DSIH_SETP, 0, 0 },
384 {0, 0, 0, WINED3DSIH_TABLE_SIZE, 0, 0 },
385};
386
388{
389 /* WINED3D_SM1_RESOURCE_UNKNOWN */ WINED3D_SHADER_RESOURCE_NONE,
390 /* WINED3D_SM1_RESOURCE_TEXTURE_1D */ WINED3D_SHADER_RESOURCE_TEXTURE_1D,
391 /* WINED3D_SM1_RESOURCE_TEXTURE_2D */ WINED3D_SHADER_RESOURCE_TEXTURE_2D,
392 /* WINED3D_SM1_RESOURCE_TEXTURE_CUBE */ WINED3D_SHADER_RESOURCE_TEXTURE_CUBE,
393 /* WINED3D_SM1_RESOURCE_TEXTURE_3D */ WINED3D_SHADER_RESOURCE_TEXTURE_3D,
394};
395
396/* Read a parameter opcode from the input stream,
397 * and possibly a relative addressing token.
398 * Return the number of tokens read */
399static unsigned int shader_get_param(const struct wined3d_sm1_data *priv, const DWORD *ptr,
400 unsigned int *token, unsigned int *addr_token)
401{
402 unsigned int count = 1;
403
404 *token = *ptr;
405
406 /* PS >= 3.0 have relative addressing (with token)
407 * VS >= 2.0 have relative addressing (with token)
408 * VS >= 1.0 < 2.0 have relative addressing (without token)
409 * The version check below should work in general */
411 {
412 if (priv->shader_version.major < 2)
413 {
414 *addr_token = (1u << 31)
418 }
419 else
420 {
421 *addr_token = *(ptr + 1);
422 ++count;
423 }
424 }
425
426 return count;
427}
428
429static const struct wined3d_sm1_opcode_info *shader_get_opcode(const struct wined3d_sm1_data *priv, unsigned int token)
430{
431 unsigned int shader_version = WINED3D_SHADER_VERSION(priv->shader_version.major, priv->shader_version.minor);
433 unsigned int i = 0;
434
436 {
438 && shader_version >= opcode_table[i].min_version
439 && (!opcode_table[i].max_version || shader_version <= opcode_table[i].max_version))
440 {
441 return &opcode_table[i];
442 }
443 ++i;
444 }
445
446 FIXME("Unsupported opcode %#x, token 0x%08x, shader version %#x.\n",
447 token & WINED3D_SM1_OPCODE_MASK, token, shader_version);
448
449 return NULL;
450}
451
452/* Return the number of parameters to skip for an opcode */
453static unsigned int shader_skip_opcode(const struct wined3d_sm1_data *priv,
454 const struct wined3d_sm1_opcode_info *opcode_info, DWORD opcode_token)
455{
456 unsigned int length;
457 /* Shaders >= 2.0 may contain address tokens, but fortunately they
458 * have a useful length mask - use it here. Shaders 1.0 contain no such tokens */
460 return (priv->shader_version.major >= 2) ? length : opcode_info->param_count;
461}
462
463static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_param *rel_addr,
465{
468 src->reg.data_type = WINED3D_DATA_FLOAT;
469 src->reg.idx[0].offset = param & WINED3D_SM1_REGISTER_NUMBER_MASK;
470 src->reg.idx[0].rel_addr = rel_addr;
471 src->reg.idx[1].offset = ~0U;
472 src->reg.idx[1].rel_addr = NULL;
475}
476
477static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_param *rel_addr,
479{
482 dst->reg.data_type = WINED3D_DATA_FLOAT;
483 dst->reg.idx[0].offset = param & WINED3D_SM1_REGISTER_NUMBER_MASK;
484 dst->reg.idx[0].rel_addr = rel_addr;
485 dst->reg.idx[1].offset = ~0U;
486 dst->reg.idx[1].rel_addr = NULL;
490}
491
492/* Read the parameters of an unrecognized opcode from the input stream
493 * Return the number of tokens read.
494 *
495 * Note: This function assumes source or destination token format.
496 * It will not work with specially-formatted tokens like DEF or DCL,
497 * but hopefully those would be recognized */
498static unsigned int shader_skip_unrecognized(const struct wined3d_sm1_data *priv, const DWORD *ptr)
499{
500 unsigned int tokens_read = 0, i = 0;
501
502 /* TODO: Think of a good name for 0x80000000 and replace it with a constant */
503 while (*ptr & 0x80000000)
504 {
505 unsigned int token, addr_token = 0;
506 struct wined3d_shader_src_param rel_addr;
507
508 tokens_read += shader_get_param(priv, ptr, &token, &addr_token);
509 ptr += tokens_read;
510
511 FIXME("Unrecognized opcode param: token=0x%08x addr_token=0x%08x.\n", token, addr_token);
512
514 shader_parse_src_param(addr_token, NULL, &rel_addr);
515
516 if (!i)
517 {
519
521 }
522 else
523 {
525
527 }
528 ++i;
529 }
530 return tokens_read;
531}
532
533static void *shader_sm1_init(const DWORD *byte_code, size_t byte_code_size,
534 const struct wined3d_shader_signature *output_signature)
535{
536 struct wined3d_sm1_data *priv;
538
539 TRACE("Version: 0x%08lx.\n", *byte_code);
540
541 major = WINED3D_SM1_VERSION_MAJOR(*byte_code);
542 minor = WINED3D_SM1_VERSION_MINOR(*byte_code);
544 {
545 WARN("Invalid shader version %u.%u (%#lx).\n", major, minor, *byte_code);
546 return NULL;
547 }
548
549 if (!(priv = malloc(sizeof(*priv))))
550 return NULL;
551
552 if (output_signature->element_count)
553 FIXME("SM 1-3 shader shouldn't have output signatures.\n");
554
555 switch (*byte_code >> 16)
556 {
557 case WINED3D_SM1_VS:
560 break;
561
562 case WINED3D_SM1_PS:
565 break;
566
567 default:
568 FIXME("Unrecognized shader type %#lx.\n", *byte_code >> 16);
569 free(priv);
570 return NULL;
571 }
572 priv->shader_version.major = WINED3D_SM1_VERSION_MAJOR(*byte_code);
573 priv->shader_version.minor = WINED3D_SM1_VERSION_MINOR(*byte_code);
574
575 priv->start = &byte_code[1];
576
577 return priv;
578}
579
580static void shader_sm1_free(void *data)
581{
582 free(data);
583}
584
586{
587 struct wined3d_sm1_data *priv = data;
588
589 *ptr = priv->start;
591}
592
593static void shader_sm1_read_src_param(struct wined3d_sm1_data *priv, const DWORD **ptr,
595{
596 unsigned int token, addr_token;
597
598 *ptr += shader_get_param(priv, *ptr, &token, &addr_token);
600 {
603 }
604 else
605 {
607 }
608}
609
610static void shader_sm1_read_dst_param(struct wined3d_sm1_data *priv, const DWORD **ptr,
612{
613 unsigned int token, addr_token;
614
615 *ptr += shader_get_param(priv, *ptr, &token, &addr_token);
617 {
620 }
621 else
622 {
624 }
625}
626
627static void shader_sm1_read_semantic(const DWORD **ptr, struct wined3d_shader_semantic *semantic)
628{
629 enum wined3d_sm1_resource_type resource_type;
630 DWORD usage_token = *(*ptr)++;
631 DWORD dst_token = *(*ptr)++;
632
633 semantic->usage = (usage_token & WINED3D_SM1_DCL_USAGE_MASK) >> WINED3D_SM1_DCL_USAGE_SHIFT;
635 resource_type = (usage_token & WINED3D_SM1_RESOURCE_TYPE_MASK) >> WINED3D_SM1_RESOURCE_TYPE_SHIFT;
636 if (resource_type >= ARRAY_SIZE(resource_type_table))
637 {
638 FIXME("Unhandled resource type %#x.\n", resource_type);
640 }
641 else
642 {
643 semantic->resource_type = resource_type_table[resource_type];
644 }
646 shader_parse_dst_param(dst_token, NULL, &semantic->reg);
647}
648
651{
652 unsigned int count = type == WINED3D_IMMCONST_VEC4 ? 4 : 1;
653 src_param->reg.type = WINED3DSPR_IMMCONST;
654 src_param->reg.data_type = data_type;
655 src_param->reg.idx[0].offset = ~0U;
656 src_param->reg.idx[0].rel_addr = NULL;
657 src_param->reg.idx[1].offset = ~0U;
658 src_param->reg.idx[1].rel_addr = NULL;
659 src_param->reg.immconst_type = type;
660 memcpy(src_param->reg.u.immconst_data, *ptr, count * sizeof(DWORD));
662 src_param->modifiers = 0;
663
664 *ptr += count;
665}
666
668{
669 DWORD token = **ptr;
670 const char *comment;
671 UINT size;
672
674 {
676 comment = (const char *)++(*ptr);
677 *ptr += size;
678
679 if (size > 1 && *(const DWORD *)comment == WINEMAKEFOURCC('T', 'E', 'X', 'T'))
680 {
681 const char *end = comment + size * sizeof(token);
682 const char *p = comment + sizeof(token);
683 const char *line = p;
684
685 TRACE("// TEXT\n");
686 while (p != end)
687 {
688 if (*p == '\n')
689 {
690 UINT len = p - line;
691 if (len && *(p - 1) == '\r') --len;
692 TRACE("// %s\n", debugstr_an(line, len));
693 line = ++p;
694 }
695 else ++p;
696 }
697 if (line != p)
698 TRACE("// %s\n", debugstr_an(line, p - line));
699 }
700 else if (size)
701 TRACE("// %s\n", debugstr_an(comment, size * sizeof(token)));
702 else
703 break;
704
705 token = **ptr;
706 }
707}
708
710{
712 {
713 if (ins->flags)
714 {
715 FIXME("Ignoring unexpected instruction flags %#x for %s.\n",
717 ins->flags = 0;
718 }
719 }
720}
721
723{
724 const struct wined3d_sm1_opcode_info *opcode_info;
725 struct wined3d_sm1_data *priv = data;
726 unsigned int opcode_token;
727 unsigned int i;
728 const DWORD *p;
729
731
732 opcode_token = *(*ptr)++;
733 if (!(opcode_info = shader_get_opcode(priv, opcode_token)))
734 {
735 FIXME("Unrecognized opcode: token=0x%08x.\n", opcode_token);
737 *ptr += shader_skip_unrecognized(priv, *ptr);
738 return;
739 }
740
741 ins->handler_idx = opcode_info->handler_idx;
743 ins->coissue = opcode_token & WINED3D_SM1_COISSUE;
744 ins->predicate = opcode_token & WINED3D_SM1_INSTRUCTION_PREDICATED ? &priv->pred_param : NULL;
745 ins->dst_count = opcode_info->dst_count ? 1 : 0;
746 ins->dst = &priv->dst_param;
747 ins->src_count = opcode_info->param_count - opcode_info->dst_count;
748 ins->src = priv->src_param;
749 memset(&ins->texel_offset, 0, sizeof(ins->texel_offset));
750
751 p = *ptr;
752 *ptr += shader_skip_opcode(priv, opcode_info, opcode_token);
753
754 if (ins->handler_idx == WINED3DSIH_DCL)
755 {
757 }
758 else if (ins->handler_idx == WINED3DSIH_DEF)
759 {
760 shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr);
762 }
763 else if (ins->handler_idx == WINED3DSIH_DEFB)
764 {
765 shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr);
767 }
768 else if (ins->handler_idx == WINED3DSIH_DEFI)
769 {
770 shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr);
772 }
773 else
774 {
775 /* Destination token */
776 if (ins->dst_count)
777 shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr);
778
779 /* Predication token */
780 if (ins->predicate)
781 shader_sm1_read_src_param(priv, &p, &priv->pred_param, &priv->pred_rel_addr);
782
783 /* Other source tokens */
784 for (i = 0; i < ins->src_count; ++i)
785 shader_sm1_read_src_param(priv, &p, &priv->src_param[i], &priv->src_rel_addr[i]);
786 }
787
789}
790
791static BOOL shader_sm1_is_end(void *data, const DWORD **ptr)
792{
794
795 if (**ptr == WINED3D_SM1_END)
796 {
797 ++(*ptr);
798 return TRUE;
799 }
800
801 return FALSE;
802}
803
805{
811};
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define U(x)
Definition: wordpad.c:45
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
const char * debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
Definition: shader.c:301
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum dst
Definition: glext.h:6340
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
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
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 * u
Definition: glfuncs.h:240
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 token
Definition: glfuncs.h:210
enum wined3d_data_type data_type
Definition: glsl_shader.c:71
unsigned int UINT
Definition: sysinfo.c:13
unsigned min_version
Definition: lex.c:39
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
#define comment(fmt, arg1)
Definition: rebar.c:847
#define memset(x, y, z)
Definition: compat.h:39
static const struct wined3d_sm1_opcode_info ps_opcode_table[]
Definition: shader_sm1.c:292
#define WINED3D_SM1_VERSION_MINOR(version)
Definition: shader_sm1.c:91
#define WINED3D_SM1_SRC_MODIFIER_SHIFT
Definition: shader_sm1.c:85
#define WINED3D_SM1_INSTRUCTION_FLAGS_MASK
Definition: shader_sm1.c:43
static void shader_sm1_read_immconst(const DWORD **ptr, struct wined3d_shader_src_param *src_param, enum wined3d_immconst_type type, enum wined3d_data_type data_type)
Definition: shader_sm1.c:649
#define WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT
Definition: shader_sm1.c:42
static void shader_sm1_free(void *data)
Definition: shader_sm1.c:580
#define WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT
Definition: shader_sm1.c:45
wined3d_sm1_opcode
Definition: shader_sm1.c:109
@ WINED3D_SM1_OP_MOV
Definition: shader_sm1.c:111
@ WINED3D_SM1_OP_SGN
Definition: shader_sm1.c:144
@ WINED3D_SM1_OP_MAD
Definition: shader_sm1.c:114
@ WINED3D_SM1_OP_SINCOS
Definition: shader_sm1.c:147
@ WINED3D_SM1_OP_MAX
Definition: shader_sm1.c:121
@ WINED3D_SM1_OP_BREAKC
Definition: shader_sm1.c:155
@ WINED3D_SM1_OP_TEXDP3TEX
Definition: shader_sm1.c:179
@ WINED3D_SM1_OP_TEXDP3
Definition: shader_sm1.c:181
@ WINED3D_SM1_OP_NOP
Definition: shader_sm1.c:110
@ WINED3D_SM1_OP_ENDLOOP
Definition: shader_sm1.c:139
@ WINED3D_SM1_OP_FRC
Definition: shader_sm1.c:129
@ WINED3D_SM1_OP_LIT
Definition: shader_sm1.c:126
@ WINED3D_SM1_OP_M3x2
Definition: shader_sm1.c:134
@ WINED3D_SM1_OP_SETP
Definition: shader_sm1.c:190
@ WINED3D_SM1_OP_TEXM3x2PAD
Definition: shader_sm1.c:167
@ WINED3D_SM1_OP_TEXDEPTH
Definition: shader_sm1.c:183
@ WINED3D_SM1_OP_TEXM3x3TEX
Definition: shader_sm1.c:170
@ WINED3D_SM1_OP_TEX
Definition: shader_sm1.c:162
@ WINED3D_SM1_OP_DSX
Definition: shader_sm1.c:187
@ WINED3D_SM1_OP_IFC
Definition: shader_sm1.c:151
@ WINED3D_SM1_OP_M4x4
Definition: shader_sm1.c:130
@ WINED3D_SM1_OP_TEXM3x3
Definition: shader_sm1.c:182
@ WINED3D_SM1_OP_MUL
Definition: shader_sm1.c:115
@ WINED3D_SM1_OP_TEXM3x3VSPEC
Definition: shader_sm1.c:173
@ WINED3D_SM1_OP_SLT
Definition: shader_sm1.c:122
@ WINED3D_SM1_OP_MOVA
Definition: shader_sm1.c:156
@ WINED3D_SM1_OP_TEXM3x3SPEC
Definition: shader_sm1.c:172
@ WINED3D_SM1_OP_SGE
Definition: shader_sm1.c:123
@ WINED3D_SM1_OP_PHASE
Definition: shader_sm1.c:194
@ WINED3D_SM1_OP_BREAK
Definition: shader_sm1.c:154
@ WINED3D_SM1_OP_RCP
Definition: shader_sm1.c:116
@ WINED3D_SM1_OP_DEFB
Definition: shader_sm1.c:157
@ WINED3D_SM1_OP_LOGP
Definition: shader_sm1.c:175
@ WINED3D_SM1_OP_TEXCOORD
Definition: shader_sm1.c:160
@ WINED3D_SM1_OP_BEM
Definition: shader_sm1.c:185
@ WINED3D_SM1_OP_LABEL
Definition: shader_sm1.c:140
@ WINED3D_SM1_OP_TEXBEML
Definition: shader_sm1.c:164
@ WINED3D_SM1_OP_END
Definition: shader_sm1.c:196
@ WINED3D_SM1_OP_M3x3
Definition: shader_sm1.c:133
@ WINED3D_SM1_OP_ENDIF
Definition: shader_sm1.c:153
@ WINED3D_SM1_OP_LRP
Definition: shader_sm1.c:128
@ WINED3D_SM1_OP_REP
Definition: shader_sm1.c:148
@ WINED3D_SM1_OP_LOOP
Definition: shader_sm1.c:137
@ WINED3D_SM1_OP_DCL
Definition: shader_sm1.c:141
@ WINED3D_SM1_OP_CND
Definition: shader_sm1.c:176
@ WINED3D_SM1_OP_RET
Definition: shader_sm1.c:138
@ WINED3D_SM1_OP_CMP
Definition: shader_sm1.c:184
@ WINED3D_SM1_OP_LOG
Definition: shader_sm1.c:125
@ WINED3D_SM1_OP_POW
Definition: shader_sm1.c:142
@ WINED3D_SM1_OP_TEXM3x3DIFF
Definition: shader_sm1.c:171
@ WINED3D_SM1_OP_M4x3
Definition: shader_sm1.c:131
@ WINED3D_SM1_OP_CALL
Definition: shader_sm1.c:135
@ WINED3D_SM1_OP_DP4
Definition: shader_sm1.c:119
@ WINED3D_SM1_OP_TEXREG2RGB
Definition: shader_sm1.c:178
@ WINED3D_SM1_OP_EXPP
Definition: shader_sm1.c:174
@ WINED3D_SM1_OP_DSY
Definition: shader_sm1.c:188
@ WINED3D_SM1_OP_NRM
Definition: shader_sm1.c:146
@ WINED3D_SM1_OP_SUB
Definition: shader_sm1.c:113
@ WINED3D_SM1_OP_TEXM3x2TEX
Definition: shader_sm1.c:168
@ WINED3D_SM1_OP_DEFI
Definition: shader_sm1.c:158
@ WINED3D_SM1_OP_IF
Definition: shader_sm1.c:150
@ WINED3D_SM1_OP_DP3
Definition: shader_sm1.c:118
@ WINED3D_SM1_OP_RSQ
Definition: shader_sm1.c:117
@ WINED3D_SM1_OP_DP2ADD
Definition: shader_sm1.c:186
@ WINED3D_SM1_OP_EXP
Definition: shader_sm1.c:124
@ WINED3D_SM1_OP_ABS
Definition: shader_sm1.c:145
@ WINED3D_SM1_OP_ADD
Definition: shader_sm1.c:112
@ WINED3D_SM1_OP_TEXLDD
Definition: shader_sm1.c:189
@ WINED3D_SM1_OP_CRS
Definition: shader_sm1.c:143
@ WINED3D_SM1_OP_ENDREP
Definition: shader_sm1.c:149
@ WINED3D_SM1_OP_DST
Definition: shader_sm1.c:127
@ WINED3D_SM1_OP_MIN
Definition: shader_sm1.c:120
@ WINED3D_SM1_OP_ELSE
Definition: shader_sm1.c:152
@ WINED3D_SM1_OP_COMMENT
Definition: shader_sm1.c:195
@ WINED3D_SM1_OP_TEXBEM
Definition: shader_sm1.c:163
@ WINED3D_SM1_OP_TEXM3x2DEPTH
Definition: shader_sm1.c:180
@ WINED3D_SM1_OP_BREAKP
Definition: shader_sm1.c:192
@ WINED3D_SM1_OP_TEXLDL
Definition: shader_sm1.c:191
@ WINED3D_SM1_OP_CALLNZ
Definition: shader_sm1.c:136
@ WINED3D_SM1_OP_DEF
Definition: shader_sm1.c:177
@ WINED3D_SM1_OP_TEXREG2GB
Definition: shader_sm1.c:166
@ WINED3D_SM1_OP_TEXKILL
Definition: shader_sm1.c:161
@ WINED3D_SM1_OP_TEXM3x3PAD
Definition: shader_sm1.c:169
@ WINED3D_SM1_OP_TEXREG2AR
Definition: shader_sm1.c:165
@ WINED3D_SM1_OP_M3x4
Definition: shader_sm1.c:132
static const struct wined3d_sm1_opcode_info vs_opcode_table[]
Definition: shader_sm1.c:224
#define WINED3D_SM1_REGISTER_TYPE_SHIFT2
Definition: shader_sm1.c:61
static void shader_sm1_read_dst_param(struct wined3d_sm1_data *priv, const DWORD **ptr, struct wined3d_shader_dst_param *dst_param, struct wined3d_shader_src_param *dst_rel_addr)
Definition: shader_sm1.c:610
#define WINED3D_SM1_VERSION_MAJOR(version)
Definition: shader_sm1.c:90
static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_param *rel_addr, struct wined3d_shader_src_param *src)
Definition: shader_sm1.c:463
#define WINED3D_SM1_RESOURCE_TYPE_MASK
Definition: shader_sm1.c:37
static unsigned int shader_skip_unrecognized(const struct wined3d_sm1_data *priv, const DWORD *ptr)
Definition: shader_sm1.c:498
static void shader_sm1_validate_instruction(struct wined3d_shader_instruction *ins)
Definition: shader_sm1.c:709
#define WINED3D_SM1_DCL_USAGE_SHIFT
Definition: shader_sm1.c:30
#define WINED3D_SM1_REGISTER_TYPE_SHIFT
Definition: shader_sm1.c:59
#define WINED3D_SM1_RESOURCE_TYPE_SHIFT
Definition: shader_sm1.c:36
#define WINED3D_SM1_DST_MODIFIER_MASK
Definition: shader_sm1.c:70
static void shader_sm1_read_comment(const DWORD **ptr)
Definition: shader_sm1.c:667
static unsigned int shader_get_param(const struct wined3d_sm1_data *priv, const DWORD *ptr, unsigned int *token, unsigned int *addr_token)
Definition: shader_sm1.c:399
wined3d_sm1_resource_type
Definition: shader_sm1.c:100
@ WINED3D_SM1_RESOURCE_TEXTURE_1D
Definition: shader_sm1.c:102
@ WINED3D_SM1_RESOURCE_UNKNOWN
Definition: shader_sm1.c:101
@ WINED3D_SM1_RESOURCE_TEXTURE_CUBE
Definition: shader_sm1.c:104
@ WINED3D_SM1_RESOURCE_TEXTURE_3D
Definition: shader_sm1.c:105
@ WINED3D_SM1_RESOURCE_TEXTURE_2D
Definition: shader_sm1.c:103
#define WINED3D_SM1_COMMENT_SIZE_MASK
Definition: shader_sm1.c:51
static unsigned int shader_skip_opcode(const struct wined3d_sm1_data *priv, const struct wined3d_sm1_opcode_info *opcode_info, DWORD opcode_token)
Definition: shader_sm1.c:453
#define WINED3D_SM1_REGISTER_TYPE_MASK2
Definition: shader_sm1.c:62
#define WINED3D_SM1_REGISTER_TYPE_MASK
Definition: shader_sm1.c:60
static const struct wined3d_sm1_opcode_info * shader_get_opcode(const struct wined3d_sm1_data *priv, unsigned int token)
Definition: shader_sm1.c:429
#define WINED3D_SM1_DCL_USAGE_MASK
Definition: shader_sm1.c:31
#define WINED3D_SM1_COISSUE
Definition: shader_sm1.c:48
#define WINED3D_SM1_WRITEMASK_MASK
Definition: shader_sm1.c:78
#define WINED3D_SM1_DCL_USAGE_INDEX_SHIFT
Definition: shader_sm1.c:32
#define WINED3D_SM1_INSTRUCTION_LENGTH_MASK
Definition: shader_sm1.c:46
#define WINED3D_SM1_END
Definition: shader_sm1.c:88
static void * shader_sm1_init(const DWORD *byte_code, size_t byte_code_size, const struct wined3d_shader_signature *output_signature)
Definition: shader_sm1.c:533
#define WINED3D_SM1_SRC_MODIFIER_MASK
Definition: shader_sm1.c:86
static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_param *rel_addr, struct wined3d_shader_dst_param *dst)
Definition: shader_sm1.c:477
#define WINED3D_SM1_DST_MODIFIER_SHIFT
Definition: shader_sm1.c:69
#define WINED3D_SM1_DCL_USAGE_INDEX_MASK
Definition: shader_sm1.c:33
static BOOL shader_sm1_is_end(void *data, const DWORD **ptr)
Definition: shader_sm1.c:791
const struct wined3d_shader_frontend sm1_shader_frontend
Definition: shader_sm1.c:804
#define WINED3D_SM1_ADDRESS_MODE_SHIFT
Definition: shader_sm1.c:65
#define WINED3D_SM1_SWIZZLE_MASK
Definition: shader_sm1.c:82
#define WINED3D_SM1_COMMENT_SIZE_SHIFT
Definition: shader_sm1.c:50
#define WINED3D_SM1_WRITEMASK_SHIFT
Definition: shader_sm1.c:77
static void shader_sm1_read_instruction(void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins)
Definition: shader_sm1.c:722
static enum wined3d_shader_resource_type resource_type_table[]
Definition: shader_sm1.c:387
#define WINED3D_SM1_DSTSHIFT_MASK
Definition: shader_sm1.c:74
static void shader_sm1_read_header(void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version)
Definition: shader_sm1.c:585
static void shader_sm1_read_src_param(struct wined3d_sm1_data *priv, const DWORD **ptr, struct wined3d_shader_src_param *src_param, struct wined3d_shader_src_param *src_rel_addr)
Definition: shader_sm1.c:593
#define WINED3D_SM1_OPCODE_MASK
Definition: shader_sm1.c:40
#define WINED3D_SM1_SWIZZLE_SHIFT
Definition: shader_sm1.c:81
#define WINED3D_SM1_INSTRUCTION_PREDICATED
Definition: shader_sm1.c:53
#define WINED3D_SM1_REGISTER_NUMBER_MASK
Definition: shader_sm1.c:56
static void shader_sm1_read_semantic(const DWORD **ptr, struct wined3d_shader_semantic *semantic)
Definition: shader_sm1.c:627
wined3d_sm1_address_mode_type
Definition: shader_sm1.c:94
@ WINED3D_SM1_ADDRESS_MODE_RELATIVE
Definition: shader_sm1.c:96
@ WINED3D_SM1_ADDRESS_MODE_ABSOLUTE
Definition: shader_sm1.c:95
#define WINED3D_SM1_DSTSHIFT_SHIFT
Definition: shader_sm1.c:73
static const struct wined3d_sm4_opcode_info opcode_table[]
Definition: shader_sm4.c:912
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
#define TRACE(s)
Definition: solgame.cpp:4
Definition: parser.c:49
const struct wined3d_shader_src_param * src
union wined3d_shader_instruction::@348 declaration
struct wined3d_shader_semantic semantic
const struct wined3d_shader_dst_param * dst
const struct wined3d_shader_src_param * predicate
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
struct wined3d_shader_texel_offset texel_offset
struct wined3d_shader_dst_param reg
enum wined3d_decl_usage usage
enum wined3d_data_type resource_data_type
enum wined3d_shader_resource_type resource_type
struct wined3d_shader_register reg
struct wined3d_shader_src_param pred_rel_addr
Definition: shader_sm1.c:216
struct wined3d_shader_dst_param dst_param
Definition: shader_sm1.c:220
struct wined3d_shader_version shader_version
Definition: shader_sm1.c:211
struct wined3d_shader_src_param src_rel_addr[4]
Definition: shader_sm1.c:215
struct wined3d_shader_src_param dst_rel_addr
Definition: shader_sm1.c:217
struct wined3d_shader_src_param src_param[4]
Definition: shader_sm1.c:218
const struct wined3d_sm1_opcode_info * opcode_table
Definition: shader_sm1.c:212
struct wined3d_shader_src_param pred_param
Definition: shader_sm1.c:219
const DWORD * start
Definition: shader_sm1.c:213
enum wined3d_sm1_opcode opcode
Definition: shader_sm1.c:201
unsigned int param_count
Definition: shader_sm1.c:203
unsigned int dst_count
Definition: shader_sm1.c:202
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
Definition: shader_sm1.c:204
#define WINEMAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: wined3d.h:121
@ WINED3D_SHADER_TYPE_PIXEL
Definition: wined3d.h:841
@ WINED3D_SHADER_TYPE_VERTEX
Definition: wined3d.h:842
wined3d_data_type
@ WINED3D_DATA_UINT
@ WINED3D_DATA_INT
@ WINED3D_DATA_FLOAT
WINED3D_SHADER_INSTRUCTION_HANDLER
@ WINED3DSIH_SINCOS
@ WINED3DSIH_LIT
@ WINED3DSIH_DP4
@ WINED3DSIH_TEXDEPTH
@ WINED3DSIH_MUL
@ WINED3DSIH_M3x3
@ WINED3DSIH_CALLNZ
@ WINED3DSIH_TEXREG2RGB
@ WINED3DSIH_TEXLDL
@ WINED3DSIH_DEFI
@ WINED3DSIH_ABS
@ WINED3DSIH_LRP
@ WINED3DSIH_DST
@ WINED3DSIH_TEXREG2AR
@ WINED3DSIH_TEXM3x3PAD
@ WINED3DSIH_TEXREG2GB
@ WINED3DSIH_LOOP
@ WINED3DSIH_M3x4
@ WINED3DSIH_SUB
@ WINED3DSIH_RCP
@ WINED3DSIH_NOP
@ WINED3DSIH_ENDIF
@ WINED3DSIH_TEXM3x3TEX
@ WINED3DSIH_EXP
@ WINED3DSIH_TEXM3x3VSPEC
@ WINED3DSIH_IF
@ WINED3DSIH_LOG
@ WINED3DSIH_TEXM3x2DEPTH
@ WINED3DSIH_MOV
@ WINED3DSIH_NRM
@ WINED3DSIH_CRS
@ WINED3DSIH_TEXM3x3
@ WINED3DSIH_ELSE
@ WINED3DSIH_DEFB
@ WINED3DSIH_RSQ
@ WINED3DSIH_DP2ADD
@ WINED3DSIH_TEXM3x2TEX
@ WINED3DSIH_ADD
@ WINED3DSIH_BREAK
@ WINED3DSIH_FRC
@ WINED3DSIH_DSX
@ WINED3DSIH_DCL
@ WINED3DSIH_CALL
@ WINED3DSIH_ENDREP
@ WINED3DSIH_BEM
@ WINED3DSIH_TEXDP3TEX
@ WINED3DSIH_TEXBEML
@ WINED3DSIH_TEXM3x3SPEC
@ WINED3DSIH_BREAKC
@ WINED3DSIH_SETP
@ WINED3DSIH_BREAKP
@ WINED3DSIH_TEXBEM
@ WINED3DSIH_M3x2
@ WINED3DSIH_MIN
@ WINED3DSIH_TEXLDD
@ WINED3DSIH_TABLE_SIZE
@ WINED3DSIH_SLT
@ WINED3DSIH_DP3
@ WINED3DSIH_REP
@ WINED3DSIH_RET
@ WINED3DSIH_IFC
@ WINED3DSIH_ENDLOOP
@ WINED3DSIH_DSY
@ WINED3DSIH_TEXDP3
@ WINED3DSIH_MOVA
@ WINED3DSIH_DEF
@ WINED3DSIH_CMP
@ WINED3DSIH_TEXKILL
@ WINED3DSIH_POW
@ WINED3DSIH_CND
@ WINED3DSIH_M4x3
@ WINED3DSIH_TEXM3x2PAD
@ WINED3DSIH_MAD
@ WINED3DSIH_TEX
@ WINED3DSIH_EXPP
@ WINED3DSIH_LABEL
@ WINED3DSIH_SGE
@ WINED3DSIH_M4x4
@ WINED3DSIH_TEXM3x3DIFF
@ WINED3DSIH_SGN
@ WINED3DSIH_LOGP
@ WINED3DSIH_TEXCOORD
@ WINED3DSIH_MAX
@ WINED3DSIH_PHASE
#define WINED3D_SM1_VS
#define WINED3D_SM1_PS
wined3d_shader_resource_type
@ WINED3D_SHADER_RESOURCE_TEXTURE_3D
@ WINED3D_SHADER_RESOURCE_TEXTURE_2D
@ WINED3D_SHADER_RESOURCE_NONE
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBE
@ WINED3D_SHADER_RESOURCE_TEXTURE_1D
#define WINED3D_SHADER_VERSION(major, minor)
@ WINED3DSPR_IMMCONST
@ WINED3DSPR_ADDR
#define WINED3DSP_NOSWIZZLE
wined3d_immconst_type
@ WINED3D_IMMCONST_VEC4
@ WINED3D_IMMCONST_SCALAR
unsigned char BYTE
Definition: xxhash.c:193