33#define WINED3D_SM1_DCL_USAGE_SHIFT 0
34#define WINED3D_SM1_DCL_USAGE_MASK (0xfu << WINED3D_SM1_DCL_USAGE_SHIFT)
35#define WINED3D_SM1_DCL_USAGE_INDEX_SHIFT 16
36#define WINED3D_SM1_DCL_USAGE_INDEX_MASK (0xfu << WINED3D_SM1_DCL_USAGE_INDEX_SHIFT)
39#define WINED3D_SM1_RESOURCE_TYPE_SHIFT 27
40#define WINED3D_SM1_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM1_RESOURCE_TYPE_SHIFT)
43#define WINED3D_SM1_OPCODE_MASK 0x0000ffff
45#define WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT 16
46#define WINED3D_SM1_INSTRUCTION_FLAGS_MASK (0xffu << WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT)
48#define WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT 24
49#define WINED3D_SM1_INSTRUCTION_LENGTH_MASK (0xfu << WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT)
51#define WINED3D_SM1_COISSUE (0x1u << 30)
53#define WINED3D_SM1_COMMENT_SIZE_SHIFT 16
54#define WINED3D_SM1_COMMENT_SIZE_MASK (0x7fffu << WINED3D_SM1_COMMENT_SIZE_SHIFT)
56#define WINED3D_SM1_INSTRUCTION_PREDICATED (0x1u << 28)
59#define WINED3D_SM1_REGISTER_NUMBER_MASK 0x000007ff
62#define WINED3D_SM1_REGISTER_TYPE_SHIFT 28
63#define WINED3D_SM1_REGISTER_TYPE_MASK (0x7u << WINED3D_SM1_REGISTER_TYPE_SHIFT)
64#define WINED3D_SM1_REGISTER_TYPE_SHIFT2 8
65#define WINED3D_SM1_REGISTER_TYPE_MASK2 (0x18u << WINED3D_SM1_REGISTER_TYPE_SHIFT2)
68#define WINED3D_SM1_ADDRESS_MODE_SHIFT 13
69#define WINED3D_SM1_ADDRESS_MODE_MASK (0x1u << WINED3D_SM1_ADDRESS_MODE_SHIFT)
72#define WINED3D_SM1_DST_MODIFIER_SHIFT 20
73#define WINED3D_SM1_DST_MODIFIER_MASK (0xfu << WINED3D_SM1_DST_MODIFIER_SHIFT)
76#define WINED3D_SM1_DSTSHIFT_SHIFT 24
77#define WINED3D_SM1_DSTSHIFT_MASK (0xfu << WINED3D_SM1_DSTSHIFT_SHIFT)
80#define WINED3D_SM1_WRITEMASK_SHIFT 16
81#define WINED3D_SM1_WRITEMASK_MASK (0xfu << WINED3D_SM1_WRITEMASK_SHIFT)
84#define WINED3D_SM1_SWIZZLE_SHIFT 16
85#define WINED3D_SM1_SWIZZLE_MASK (0xffu << WINED3D_SM1_SWIZZLE_SHIFT)
88#define WINED3D_SM1_SRC_MODIFIER_SHIFT 24
89#define WINED3D_SM1_SRC_MODIFIER_MASK (0xfu << WINED3D_SM1_SRC_MODIFIER_SHIFT)
91#define WINED3D_SM1_END 0x0000ffff
93#define WINED3D_SM1_VERSION_MAJOR(version) (((version) >> 8) & 0xff)
94#define WINED3D_SM1_VERSION_MINOR(version) (((version) >> 0) & 0xff)
405 unsigned int count = 1;
417 *addr_token = (1u << 31)
424 *addr_token = *(
ptr + 1);
449 FIXME(
"Unsupported opcode %#x, token 0x%08x, shader version %#x.\n",
473 src->reg.idx[0].rel_addr = rel_addr;
475 src->reg.idx[1].rel_addr =
NULL;
487 dst->reg.idx[0].rel_addr = rel_addr;
489 dst->reg.idx[1].rel_addr =
NULL;
503 unsigned int tokens_read = 0,
i = 0;
506 while (*
ptr & 0x80000000)
514 FIXME(
"Unrecognized opcode param: token=0x%08x addr_token=0x%08x.\n",
token, addr_token);
542 TRACE(
"Version: 0x%08x.\n", *byte_code);
548 WARN(
"Invalid shader version %u.%u (%#x).\n",
major,
minor, *byte_code);
556 FIXME(
"SM 1-3 shader shouldn't have output signatures.\n");
558 switch (*byte_code >> 16)
571 FIXME(
"Unrecognized shader type %#x.\n", *byte_code >> 16);
578 priv->
start = &byte_code[1];
633 DWORD usage_token = *(*ptr)++;
634 DWORD dst_token = *(*ptr)++;
641 FIXME(
"Unhandled resource type %#x.\n", resource_type);
686 const char *
line =
p;
694 if (
len && *(
p - 1) ==
'\r') --
len;
718 FIXME(
"Ignoring unexpected instruction flags %#x for %s.\n",
735 opcode_token = *(*ptr)++;
738 FIXME(
"Unrecognized opcode: token=0x%08x.\n", opcode_token);
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
const char * debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
static __inline const char * debugstr_an(const char *s, int n)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLsizei GLsizei * length
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
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
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
#define memcpy(s1, s2, n)
#define comment(fmt, arg1)
static const struct wined3d_sm1_opcode_info ps_opcode_table[]
#define WINED3D_SM1_VERSION_MINOR(version)
#define WINED3D_SM1_SRC_MODIFIER_SHIFT
#define WINED3D_SM1_INSTRUCTION_FLAGS_MASK
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)
#define WINED3D_SM1_INSTRUCTION_FLAGS_SHIFT
static void shader_sm1_free(void *data)
#define WINED3D_SM1_INSTRUCTION_LENGTH_SHIFT
@ WINED3D_SM1_OP_TEXDP3TEX
@ WINED3D_SM1_OP_TEXM3x2PAD
@ WINED3D_SM1_OP_TEXDEPTH
@ WINED3D_SM1_OP_TEXM3x3TEX
@ WINED3D_SM1_OP_TEXM3x3VSPEC
@ WINED3D_SM1_OP_TEXM3x3SPEC
@ WINED3D_SM1_OP_TEXCOORD
@ WINED3D_SM1_OP_TEXM3x3DIFF
@ WINED3D_SM1_OP_TEXREG2RGB
@ WINED3D_SM1_OP_TEXM3x2TEX
@ WINED3D_SM1_OP_TEXM3x2DEPTH
@ WINED3D_SM1_OP_TEXREG2GB
@ WINED3D_SM1_OP_TEXM3x3PAD
@ WINED3D_SM1_OP_TEXREG2AR
static const struct wined3d_sm1_opcode_info vs_opcode_table[]
#define WINED3D_SM1_REGISTER_TYPE_SHIFT2
static const struct wined3d_sm1_opcode_info * shader_get_opcode(const struct wined3d_sm1_data *priv, DWORD token)
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)
#define WINED3D_SM1_VERSION_MAJOR(version)
static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_param *rel_addr, struct wined3d_shader_src_param *src)
#define WINED3D_SM1_RESOURCE_TYPE_MASK
static unsigned int shader_skip_unrecognized(const struct wined3d_sm1_data *priv, const DWORD *ptr)
static void shader_sm1_validate_instruction(struct wined3d_shader_instruction *ins)
#define WINED3D_SM1_DCL_USAGE_SHIFT
#define WINED3D_SM1_REGISTER_TYPE_SHIFT
#define WINED3D_SM1_RESOURCE_TYPE_SHIFT
#define WINED3D_SM1_DST_MODIFIER_MASK
static void shader_sm1_read_comment(const DWORD **ptr)
wined3d_sm1_resource_type
@ WINED3D_SM1_RESOURCE_TEXTURE_1D
@ WINED3D_SM1_RESOURCE_UNKNOWN
@ WINED3D_SM1_RESOURCE_TEXTURE_CUBE
@ WINED3D_SM1_RESOURCE_TEXTURE_3D
@ WINED3D_SM1_RESOURCE_TEXTURE_2D
#define WINED3D_SM1_COMMENT_SIZE_MASK
static unsigned int shader_skip_opcode(const struct wined3d_sm1_data *priv, const struct wined3d_sm1_opcode_info *opcode_info, DWORD opcode_token)
#define WINED3D_SM1_REGISTER_TYPE_MASK2
#define WINED3D_SM1_REGISTER_TYPE_MASK
static unsigned int shader_get_param(const struct wined3d_sm1_data *priv, const DWORD *ptr, DWORD *token, DWORD *addr_token)
#define WINED3D_SM1_DCL_USAGE_MASK
#define WINED3D_SM1_COISSUE
#define WINED3D_SM1_WRITEMASK_MASK
#define WINED3D_SM1_DCL_USAGE_INDEX_SHIFT
#define WINED3D_SM1_INSTRUCTION_LENGTH_MASK
static void * shader_sm1_init(const DWORD *byte_code, size_t byte_code_size, const struct wined3d_shader_signature *output_signature)
#define WINED3D_SM1_SRC_MODIFIER_MASK
static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_param *rel_addr, struct wined3d_shader_dst_param *dst)
#define WINED3D_SM1_DST_MODIFIER_SHIFT
#define WINED3D_SM1_DCL_USAGE_INDEX_MASK
static BOOL shader_sm1_is_end(void *data, const DWORD **ptr)
const struct wined3d_shader_frontend sm1_shader_frontend
#define WINED3D_SM1_ADDRESS_MODE_SHIFT
#define WINED3D_SM1_SWIZZLE_MASK
#define WINED3D_SM1_COMMENT_SIZE_SHIFT
#define WINED3D_SM1_WRITEMASK_SHIFT
static void shader_sm1_read_instruction(void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins)
static enum wined3d_shader_resource_type resource_type_table[]
#define WINED3D_SM1_DSTSHIFT_MASK
static void shader_sm1_read_header(void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version)
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)
#define WINED3D_SM1_OPCODE_MASK
#define WINED3D_SM1_SWIZZLE_SHIFT
#define WINED3D_SM1_INSTRUCTION_PREDICATED
#define WINED3D_SM1_REGISTER_NUMBER_MASK
static void shader_sm1_read_semantic(const DWORD **ptr, struct wined3d_shader_semantic *semantic)
wined3d_sm1_address_mode_type
@ WINED3D_SM1_ADDRESS_MODE_RELATIVE
@ WINED3D_SM1_ADDRESS_MODE_ABSOLUTE
#define WINED3D_SM1_DSTSHIFT_SHIFT
static const struct wined3d_sm4_opcode_info opcode_table[]
const struct wined3d_shader_src_param * src
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
union wined3d_shader_instruction::@275 declaration
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
struct wined3d_shader_dst_param dst_param
struct wined3d_shader_version shader_version
struct wined3d_shader_src_param src_rel_addr[4]
struct wined3d_shader_src_param dst_rel_addr
struct wined3d_shader_src_param src_param[4]
const struct wined3d_sm1_opcode_info * opcode_table
struct wined3d_shader_src_param pred_param
enum wined3d_sm1_opcode opcode
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
#define WINEMAKEFOURCC(ch0, ch1, ch2, ch3)
WINED3D_SHADER_INSTRUCTION_HANDLER
@ WINED3DSIH_TEXM3x3VSPEC
@ WINED3DSIH_TEXM3x2DEPTH
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)
#define WINED3DSP_NOSWIZZLE
@ WINED3D_IMMCONST_SCALAR
@ WINED3D_SHADER_TYPE_PIXEL
@ WINED3D_SHADER_TYPE_VERTEX