d3d9types.h 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  1. /*
  2. * Copyright (C) 2002-2003 Jason Edmeades
  3. * Raphael Junqueira
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef __WINE_D3D9TYPES_H
  20. #define __WINE_D3D9TYPES_H
  21. /*****************************************************************************
  22. * Direct 3D v9 #defines
  23. */
  24. #define D3DCLEAR_TARGET 0x00000001L
  25. #define D3DCLEAR_ZBUFFER 0x00000002L
  26. #define D3DCLEAR_STENCIL 0x00000004L
  27. #define D3DCLIPPLANE0 (1 << 0)
  28. #define D3DCLIPPLANE1 (1 << 1)
  29. #define D3DCLIPPLANE2 (1 << 2)
  30. #define D3DCLIPPLANE3 (1 << 3)
  31. #define D3DCLIPPLANE4 (1 << 4)
  32. #define D3DCLIPPLANE5 (1 << 5)
  33. #define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
  34. #define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
  35. #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b)
  36. #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b)
  37. #define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xFF,y,u,v)
  38. #define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v)
  39. #define D3DCOLORWRITEENABLED_RED 1
  40. #define D3DCOLORWRITEENABLED_GREEN 2
  41. #define D3DCOLORWRITEENABLED_BLUE 4
  42. #define D3DCOLORWRITEENABLED_ALPHA 8
  43. #define D3DCS_LEFT 0x001L
  44. #define D3DCS_RIGHT 0x002L
  45. #define D3DCS_TOP 0x004L
  46. #define D3DCS_BOTTOM 0x008L
  47. #define D3DCS_FRONT 0x010L
  48. #define D3DCS_BACK 0x020L
  49. #define D3DCS_PLANE0 0x040L
  50. #define D3DCS_PLANE1 0x080L
  51. #define D3DCS_PLANE2 0x100L
  52. #define D3DCS_PLANE3 0x200L
  53. #define D3DCS_PLANE4 0x400L
  54. #define D3DCS_PLANE5 0x800L
  55. #define D3DCS_ALL 0xFFFL
  56. #define D3DFVF_TEXTUREFORMAT1 3
  57. #define D3DFVF_TEXTUREFORMAT2 0
  58. #define D3DFVF_TEXTUREFORMAT3 1
  59. #define D3DFVF_TEXTUREFORMAT4 2
  60. #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
  61. #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
  62. #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
  63. #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
  64. #define D3DLOCK_READONLY 0x0010
  65. #define D3DLOCK_NOSYSLOCK 0x0800
  66. #define D3DLOCK_NOOVERWRITE 0x1000
  67. #define D3DLOCK_DISCARD 0x2000
  68. #define D3DLOCK_NO_DIRTY_UPDATE 0x8000
  69. #define D3DMAXUSERCLIPPLANES 32
  70. #define D3DCLIPPLANE0 (1 << 0)
  71. #define D3DCLIPPLANE1 (1 << 1)
  72. #define D3DCLIPPLANE2 (1 << 2)
  73. #define D3DCLIPPLANE3 (1 << 3)
  74. #define D3DCLIPPLANE4 (1 << 4)
  75. #define D3DCLIPPLANE5 (1 << 5)
  76. #define D3DRENDERSTATE_WRAPBIAS 128UL
  77. #define D3DTSS_TCI_PASSTHRU 0x00000
  78. #define D3DTSS_TCI_CAMERASPACENORMAL 0x10000
  79. #define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000
  80. #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x30000
  81. #define D3DTSS_TCI_SPHEREMAP 0x40000
  82. #define D3DTS_WORLD D3DTS_WORLDMATRIX(0)
  83. #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
  84. #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
  85. #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
  86. #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
  87. #define D3DUSAGE_RENDERTARGET 0x01
  88. #define D3DUSAGE_DEPTHSTENCIL 0x02
  89. #define D3DUSAGE_WRITEONLY 0x08
  90. #define D3DUSAGE_SOFTWAREPROCESSING 0x10
  91. #define D3DUSAGE_DONOTCLIP 0x20
  92. #define D3DUSAGE_POINTS 0x40
  93. #define D3DUSAGE_RTPATCHES 0x80
  94. #define D3DUSAGE_NPATCHES 0x100
  95. #define D3DUSAGE_DYNAMIC 0x200
  96. #define D3DWRAP_U 1
  97. #define D3DWRAP_V 2
  98. #define D3DWRAP_W 4
  99. #define D3DWRAPCOORD_0 1
  100. #define D3DWRAPCOORD_1 2
  101. #define D3DWRAPCOORD_2 4
  102. #define D3DWRAPCOORD_3 8
  103. #define MAX_DEVICE_IDENTIFIER_STRING 512
  104. #define D3DFVF_RESERVED0 0x0001
  105. #define D3DFVF_POSITION_MASK 0x4000E
  106. #define D3DFVF_XYZ 0x0002
  107. #define D3DFVF_XYZRHW 0x0004
  108. #define D3DFVF_XYZB1 0x0006
  109. #define D3DFVF_XYZB2 0x0008
  110. #define D3DFVF_XYZB3 0x000a
  111. #define D3DFVF_XYZB4 0x000c
  112. #define D3DFVF_XYZB5 0x000e
  113. #define D3DFVF_XYZW 0x4002
  114. #define D3DFVF_NORMAL 0x0010
  115. #define D3DFVF_PSIZE 0x0020
  116. #define D3DFVF_DIFFUSE 0x0040
  117. #define D3DFVF_SPECULAR 0x0080
  118. #define D3DFVF_TEXCOUNT_MASK 0x0f00
  119. #define D3DFVF_TEXCOUNT_SHIFT 8
  120. #define D3DFVF_TEX0 0x0000
  121. #define D3DFVF_TEX1 0x0100
  122. #define D3DFVF_TEX2 0x0200
  123. #define D3DFVF_TEX3 0x0300
  124. #define D3DFVF_TEX4 0x0400
  125. #define D3DFVF_TEX5 0x0500
  126. #define D3DFVF_TEX6 0x0600
  127. #define D3DFVF_TEX7 0x0700
  128. #define D3DFVF_TEX8 0x0800
  129. #define D3DFVF_LASTBETA_UBYTE4 0x1000
  130. #define D3DFVF_LASTBETA_D3DCOLOR 0x8000
  131. #define D3DFVF_RESERVED2 0x6000
  132. #define D3DTA_SELECTMASK 0x0000000f
  133. #define D3DTA_DIFFUSE 0x00000000
  134. #define D3DTA_CURRENT 0x00000001
  135. #define D3DTA_TEXTURE 0x00000002
  136. #define D3DTA_TFACTOR 0x00000003
  137. #define D3DTA_SPECULAR 0x00000004
  138. #define D3DTA_TEMP 0x00000005
  139. #define D3DTA_CONSTANT 0x00000006
  140. #define D3DTA_COMPLEMENT 0x00000010
  141. #define D3DTA_ALPHAREPLICATE 0x00000020
  142. #define D3DCOLORWRITEENABLE_RED (1L<<0)
  143. #define D3DCOLORWRITEENABLE_GREEN (1L<<1)
  144. #define D3DCOLORWRITEENABLE_BLUE (1L<<2)
  145. #define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
  146. #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
  147. #define D3DDMAPSAMPLER 256
  148. #define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
  149. #define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
  150. #define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3)
  151. #define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4)
  152. #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
  153. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  154. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  155. /****************************
  156. * Vertex Shaders Declaration
  157. */
  158. typedef enum _D3DDECLUSAGE {
  159. D3DDECLUSAGE_POSITION = 0,
  160. D3DDECLUSAGE_BLENDWEIGHT = 1,
  161. D3DDECLUSAGE_BLENDINDICES = 2,
  162. D3DDECLUSAGE_NORMAL = 3,
  163. D3DDECLUSAGE_PSIZE = 4,
  164. D3DDECLUSAGE_TEXCOORD = 5,
  165. D3DDECLUSAGE_TANGENT = 6,
  166. D3DDECLUSAGE_BINORMAL = 7,
  167. D3DDECLUSAGE_TESSFACTOR = 8,
  168. D3DDECLUSAGE_POSITIONT = 9,
  169. D3DDECLUSAGE_COLOR = 10,
  170. D3DDECLUSAGE_FOG = 11,
  171. D3DDECLUSAGE_DEPTH = 12,
  172. D3DDECLUSAGE_SAMPLE = 13
  173. } D3DDECLUSAGE;
  174. #define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
  175. #define MAXD3DDECLUSAGEINDEX 15
  176. #define MAXD3DDECLLENGTH 64
  177. typedef enum _D3DDECLMETHOD {
  178. D3DDECLMETHOD_DEFAULT = 0,
  179. D3DDECLMETHOD_PARTIALU,
  180. D3DDECLMETHOD_PARTIALV,
  181. D3DDECLMETHOD_CROSSUV,
  182. D3DDECLMETHOD_UV,
  183. D3DDECLMETHOD_LOOKUP,
  184. D3DDECLMETHOD_LOOKUPPRESAMPLED
  185. } D3DDECLMETHOD;
  186. #define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
  187. typedef enum _D3DDECLTYPE {
  188. D3DDECLTYPE_FLOAT1 = 0,
  189. D3DDECLTYPE_FLOAT2 = 1,
  190. D3DDECLTYPE_FLOAT3 = 2,
  191. D3DDECLTYPE_FLOAT4 = 3,
  192. D3DDECLTYPE_D3DCOLOR = 4,
  193. D3DDECLTYPE_UBYTE4 = 5,
  194. D3DDECLTYPE_SHORT2 = 6,
  195. D3DDECLTYPE_SHORT4 = 7,
  196. /* VS 2.0 */
  197. D3DDECLTYPE_UBYTE4N = 8,
  198. D3DDECLTYPE_SHORT2N = 9,
  199. D3DDECLTYPE_SHORT4N = 10,
  200. D3DDECLTYPE_USHORT2N = 11,
  201. D3DDECLTYPE_USHORT4N = 12,
  202. D3DDECLTYPE_UDEC3 = 13,
  203. D3DDECLTYPE_DEC3N = 14,
  204. D3DDECLTYPE_FLOAT16_2 = 15,
  205. D3DDECLTYPE_FLOAT16_4 = 16,
  206. D3DDECLTYPE_UNUSED = 17,
  207. } D3DDECLTYPE;
  208. #define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
  209. typedef struct _D3DVERTEXELEMENT9 {
  210. WORD Stream;
  211. WORD Offset;
  212. BYTE Type;
  213. BYTE Method;
  214. BYTE Usage;
  215. BYTE UsageIndex;
  216. } D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
  217. #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
  218. #define D3DDP_MAXTEXCOORD 8
  219. #define D3DVSD_MAKETOKENTYPE(TokenType) \
  220. ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
  221. #define D3DVSD_CONST(ConstantAddress, Count) \
  222. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
  223. #define D3DVSD_END() 0xFFFFFFFF
  224. #define D3DVSD_NOP() 0x00000000
  225. #define D3DVSD_REG(VertexRegister, Type) \
  226. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
  227. #define D3DVSD_SKIP(Count) \
  228. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
  229. #define D3DVSD_STREAM(StreamNumber) \
  230. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
  231. #define D3DVSD_STREAM_TESS() \
  232. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
  233. #define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
  234. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
  235. #define D3DVSD_TESSUV(Register) \
  236. (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
  237. /********************************
  238. * Pixel/Vertex Shaders Functions
  239. */
  240. /** Maximum number of supported texture coordinates sets operation */
  241. #define D3DDP_MAXTEXCOORD 8
  242. /** opcode token mask */
  243. #define D3DSI_OPCODE_MASK 0x0000FFFF
  244. #define D3DSI_INSTLENGTH_MASK 0x0F000000
  245. #define D3DSI_INSTLENGTH_SHIFT 24
  246. /** opcodes types for PS and VS */
  247. typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
  248. D3DSIO_NOP = 0,
  249. D3DSIO_MOV = 1,
  250. D3DSIO_ADD = 2,
  251. D3DSIO_SUB = 3,
  252. D3DSIO_MAD = 4,
  253. D3DSIO_MUL = 5,
  254. D3DSIO_RCP = 6,
  255. D3DSIO_RSQ = 7,
  256. D3DSIO_DP3 = 8,
  257. D3DSIO_DP4 = 9,
  258. D3DSIO_MIN = 10,
  259. D3DSIO_MAX = 11,
  260. D3DSIO_SLT = 12,
  261. D3DSIO_SGE = 13,
  262. D3DSIO_EXP = 14,
  263. D3DSIO_LOG = 15,
  264. D3DSIO_LIT = 16,
  265. D3DSIO_DST = 17,
  266. D3DSIO_LRP = 18,
  267. D3DSIO_FRC = 19,
  268. D3DSIO_M4x4 = 20,
  269. D3DSIO_M4x3 = 21,
  270. D3DSIO_M3x4 = 22,
  271. D3DSIO_M3x3 = 23,
  272. D3DSIO_M3x2 = 24,
  273. D3DSIO_CALL = 25,
  274. D3DSIO_CALLNZ = 26,
  275. D3DSIO_LOOP = 27,
  276. D3DSIO_RET = 28,
  277. D3DSIO_ENDLOOP = 29,
  278. D3DSIO_LABEL = 30,
  279. D3DSIO_DCL = 31,
  280. D3DSIO_POW = 32,
  281. D3DSIO_CRS = 33,
  282. D3DSIO_SGN = 34,
  283. D3DSIO_ABS = 35,
  284. D3DSIO_NRM = 36,
  285. D3DSIO_SINCOS = 37,
  286. D3DSIO_REP = 38,
  287. D3DSIO_ENDREP = 39,
  288. D3DSIO_IF = 40,
  289. D3DSIO_IFC = 41,
  290. D3DSIO_ELSE = 42,
  291. D3DSIO_ENDIF = 43,
  292. D3DSIO_BREAK = 44,
  293. D3DSIO_BREAKC = 45,
  294. D3DSIO_MOVA = 46,
  295. D3DSIO_DEFB = 47,
  296. D3DSIO_DEFI = 48,
  297. D3DSIO_TEXCOORD = 64,
  298. D3DSIO_TEXKILL = 65,
  299. D3DSIO_TEX = 66,
  300. D3DSIO_TEXBEM = 67,
  301. D3DSIO_TEXBEML = 68,
  302. D3DSIO_TEXREG2AR = 69,
  303. D3DSIO_TEXREG2GB = 70,
  304. D3DSIO_TEXM3x2PAD = 71,
  305. D3DSIO_TEXM3x2TEX = 72,
  306. D3DSIO_TEXM3x3PAD = 73,
  307. D3DSIO_TEXM3x3TEX = 74,
  308. D3DSIO_TEXM3x3DIFF = 75,
  309. D3DSIO_TEXM3x3SPEC = 76,
  310. D3DSIO_TEXM3x3VSPEC = 77,
  311. D3DSIO_EXPP = 78,
  312. D3DSIO_LOGP = 79,
  313. D3DSIO_CND = 80,
  314. D3DSIO_DEF = 81,
  315. D3DSIO_TEXREG2RGB = 82,
  316. D3DSIO_TEXDP3TEX = 83,
  317. D3DSIO_TEXM3x2DEPTH = 84,
  318. D3DSIO_TEXDP3 = 85,
  319. D3DSIO_TEXM3x3 = 86,
  320. D3DSIO_TEXDEPTH = 87,
  321. D3DSIO_CMP = 88,
  322. D3DSIO_BEM = 89,
  323. D3DSIO_DP2ADD = 90,
  324. D3DSIO_DSX = 91,
  325. D3DSIO_DSY = 92,
  326. D3DSIO_TEXLDD = 93,
  327. D3DSIO_SETP = 94,
  328. D3DSIO_TEXLDL = 95,
  329. D3DSIO_BREAKP = 96,
  330. D3DSIO_PHASE = 0xFFFD,
  331. D3DSIO_COMMENT = 0xFFFE,
  332. D3DSIO_END = 0XFFFF,
  333. D3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */
  334. } D3DSHADER_INSTRUCTION_OPCODE_TYPE;
  335. #define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f
  336. #define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f
  337. #define D3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
  338. /** for parallelism */
  339. #define D3DSI_COISSUE 0x40000000
  340. #define D3DSP_DCL_USAGE_SHIFT 0
  341. #define D3DSP_DCL_USAGE_MASK 0x0000000f
  342. #define D3DSP_DCL_USAGEINDEX_SHIFT 16
  343. #define D3DSP_DCL_USAGEINDEX_MASK 0x000f0000
  344. #define D3DSP_TEXTURETYPE_SHIFT 27
  345. #define D3DSP_TEXTURETYPE_MASK 0x78000000
  346. typedef enum _D3DSAMPLER_TEXTURE_TYPE {
  347. D3DSTT_UNKNOWN = 0 << D3DSP_TEXTURETYPE_SHIFT,
  348. D3DSTT_2D = 2 << D3DSP_TEXTURETYPE_SHIFT,
  349. D3DSTT_CUBE = 3 << D3DSP_TEXTURETYPE_SHIFT,
  350. D3DSTT_VOLUME = 4 << D3DSP_TEXTURETYPE_SHIFT,
  351. D3DSTT_FORCE_DWORD = 0x7FFFFFFF
  352. } D3DSAMPLER_TEXTURE_TYPE;
  353. #define D3DSP_REGNUM_MASK 0x000007FF
  354. /** destination parameter modifiers (.xyzw) */
  355. #define D3DSP_WRITEMASK_0 0x00010000 /* .x r */
  356. #define D3DSP_WRITEMASK_1 0x00020000 /* .y g */
  357. #define D3DSP_WRITEMASK_2 0x00040000 /* .z b */
  358. #define D3DSP_WRITEMASK_3 0x00080000 /* .w a */
  359. #define D3DSP_WRITEMASK_ALL 0x000F0000 /* all */
  360. #define D3DSP_DSTMOD_SHIFT 20
  361. #define D3DSP_DSTMOD_MASK (0xF << D3DSP_DSTMOD_SHIFT)
  362. typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
  363. D3DSPDM_NONE = 0 << D3DSP_DSTMOD_SHIFT,
  364. D3DSPDM_SATURATE = 1 << D3DSP_DSTMOD_SHIFT,
  365. D3DSPDM_PARTIALPRECISION = 2 << D3DSP_DSTMOD_SHIFT,
  366. D3DSPDM_MSAMPCENTROID = 4 << D3DSP_DSTMOD_SHIFT,
  367. D3DSPDM_FORCE_DWORD = 0x7FFFFFFF
  368. } D3DSHADER_PARAM_DSTMOD_TYPE;
  369. /** destination param */
  370. #define D3DSP_DSTSHIFT_SHIFT 24
  371. #define D3DSP_DSTSHIFT_MASK (0xF << D3DSP_DSTSHIFT_SHIFT)
  372. /** destination/source reg type */
  373. #define D3DSP_REGTYPE_SHIFT 28
  374. #define D3DSP_REGTYPE_SHIFT2 8
  375. #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT)
  376. #define D3DSP_REGTYPE_MASK2 0x00001800
  377. typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
  378. D3DSPR_TEMP = 0,
  379. D3DSPR_INPUT = 1,
  380. D3DSPR_CONST = 2,
  381. D3DSPR_ADDR = 3,
  382. D3DSPR_TEXTURE = 3,
  383. D3DSPR_RASTOUT = 4,
  384. D3DSPR_ATTROUT = 5,
  385. D3DSPR_TEXCRDOUT = 6,
  386. D3DSPR_OUTPUT = 6,
  387. D3DSPR_CONSTINT = 7,
  388. D3DSPR_COLOROUT = 8,
  389. D3DSPR_DEPTHOUT = 9,
  390. D3DSPR_SAMPLER = 10,
  391. D3DSPR_CONST2 = 11,
  392. D3DSPR_CONST3 = 12,
  393. D3DSPR_CONST4 = 13,
  394. D3DSPR_CONSTBOOL = 14,
  395. D3DSPR_LOOP = 15,
  396. D3DSPR_TEMPFLOAT16 = 16,
  397. D3DSPR_MISCTYPE = 17,
  398. D3DSPR_LABEL = 18,
  399. D3DSPR_PREDICATE = 19,
  400. D3DSPR_FORCE_DWORD = 0x7FFFFFFF
  401. } D3DSHADER_PARAM_REGISTER_TYPE;
  402. typedef enum _D3DSHADER_MISCTYPE_OFFSETS {
  403. D3DSMO_POSITION = 0,
  404. D3DSMO_FACE = 1
  405. } D3DSHADER_MISCTYPE_OFFSETS;
  406. typedef enum _D3DVS_RASTOUT_OFFSETS {
  407. D3DSRO_POSITION = 0,
  408. D3DSRO_FOG = 1,
  409. D3DSRO_POINT_SIZE = 2,
  410. D3DSRO_FORCE_DWORD = 0x7FFFFFFF
  411. } D3DVS_RASTOUT_OFFSETS;
  412. #define D3DVS_ADDRESSMODE_SHIFT 13
  413. #define D3DVS_ADDRESSMODE_MASK (0x1 << D3DVS_ADDRESSMODE_SHIFT)
  414. typedef enum _D3DVS_ADDRESSMODE_TYPE {
  415. D3DVS_ADDRMODE_ABSOLUTE = 0 << D3DVS_ADDRESSMODE_SHIFT,
  416. D3DVS_ADDRMODE_RELATIVE = 1 << D3DVS_ADDRESSMODE_SHIFT,
  417. D3DVS_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
  418. } D3DVS_ADDRESSMODE_TYPE;
  419. #define D3DSHADER_ADDRESSMODE_SHIFT 13
  420. #define D3DSHADER_ADDRESSMODE_MASK (1 << D3DSHADER_ADDRESSMODE_SHIFT)
  421. typedef enum _D3DSHADER_ADDRESSMODE_TYPE {
  422. D3DSHADER_ADDRMODE_ABSOLUTE = 0 << D3DSHADER_ADDRESSMODE_SHIFT,
  423. D3DSHADER_ADDRMODE_RELATIVE = 1 << D3DSHADER_ADDRESSMODE_SHIFT,
  424. D3DSHADER_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
  425. } D3DSHADER_ADDRESSMODE_TYPE;
  426. #define D3DVS_SWIZZLE_SHIFT 16
  427. #define D3DVS_SWIZZLE_MASK (0xFF << D3DVS_SWIZZLE_SHIFT)
  428. #define D3DSP_SWIZZLE_SHIFT 16
  429. #define D3DSP_SWIZZLE_MASK (0xFF << D3DSP_SWIZZLE_SHIFT)
  430. #define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT)
  431. #define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT)
  432. #define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT)
  433. #define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT)
  434. #define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2))
  435. #define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2))
  436. #define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2))
  437. #define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2))
  438. #define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4))
  439. #define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4))
  440. #define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4))
  441. #define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4))
  442. #define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6))
  443. #define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6))
  444. #define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6))
  445. #define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6))
  446. #define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
  447. #define D3DSP_NOSWIZZLE \
  448. ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
  449. #define D3DSP_SRCMOD_SHIFT 24
  450. #define D3DSP_SRCMOD_MASK (0xF << D3DSP_SRCMOD_SHIFT)
  451. typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
  452. D3DSPSM_NONE = 0 << D3DSP_SRCMOD_SHIFT,
  453. D3DSPSM_NEG = 1 << D3DSP_SRCMOD_SHIFT,
  454. D3DSPSM_BIAS = 2 << D3DSP_SRCMOD_SHIFT,
  455. D3DSPSM_BIASNEG = 3 << D3DSP_SRCMOD_SHIFT,
  456. D3DSPSM_SIGN = 4 << D3DSP_SRCMOD_SHIFT,
  457. D3DSPSM_SIGNNEG = 5 << D3DSP_SRCMOD_SHIFT,
  458. D3DSPSM_COMP = 6 << D3DSP_SRCMOD_SHIFT,
  459. D3DSPSM_X2 = 7 << D3DSP_SRCMOD_SHIFT,
  460. D3DSPSM_X2NEG = 8 << D3DSP_SRCMOD_SHIFT,
  461. D3DSPSM_DZ = 9 << D3DSP_SRCMOD_SHIFT,
  462. D3DSPSM_DW = 10 << D3DSP_SRCMOD_SHIFT,
  463. D3DSPSM_ABS = 11 << D3DSP_SRCMOD_SHIFT,
  464. D3DSPSM_ABSNEG = 12 << D3DSP_SRCMOD_SHIFT,
  465. D3DSPSM_NOT = 13 << D3DSP_SRCMOD_SHIFT,
  466. D3DSPSM_FORCE_DWORD = 0x7FFFFFFF
  467. } D3DSHADER_PARAM_SRCMOD_TYPE;
  468. #define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
  469. #define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
  470. #define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
  471. #define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
  472. #define D3DSI_COMMENTSIZE_SHIFT 16
  473. #define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
  474. #define D3DSHADER_COMMENT(commentSize) \
  475. ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
  476. #define D3DPS_END() 0x0000FFFF
  477. #define D3DVS_END() 0x0000FFFF
  478. /*****************************************************************************
  479. * Direct 3D v8 enumerated types
  480. */
  481. typedef enum _D3DBACKBUFFER_TYPE {
  482. D3DBACKBUFFER_TYPE_MONO = 0,
  483. D3DBACKBUFFER_TYPE_LEFT = 1,
  484. D3DBACKBUFFER_TYPE_RIGHT = 2,
  485. D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
  486. } D3DBACKBUFFER_TYPE;
  487. typedef enum _D3DBASISTYPE {
  488. D3DBASIS_BEZIER = 0,
  489. D3DBASIS_BSPLINE = 1,
  490. D3DBASIS_INTERPOLATE = 2,
  491. D3DBASIS_FORCE_DWORD = 0x7fffffff
  492. } D3DBASISTYPE;
  493. typedef enum _D3DBLEND {
  494. D3DBLEND_ZERO = 1,
  495. D3DBLEND_ONE = 2,
  496. D3DBLEND_SRCCOLOR = 3,
  497. D3DBLEND_INVSRCCOLOR = 4,
  498. D3DBLEND_SRCALPHA = 5,
  499. D3DBLEND_INVSRCALPHA = 6,
  500. D3DBLEND_DESTALPHA = 7,
  501. D3DBLEND_INVDESTALPHA = 8,
  502. D3DBLEND_DESTCOLOR = 9,
  503. D3DBLEND_INVDESTCOLOR = 10,
  504. D3DBLEND_SRCALPHASAT = 11,
  505. D3DBLEND_BOTHSRCALPHA = 12,
  506. D3DBLEND_BOTHINVSRCALPHA = 13,
  507. D3DBLEND_BLENDFACTOR = 14,
  508. D3DBLEND_INVBLENDFACTOR = 15,
  509. D3DBLEND_FORCE_DWORD = 0x7fffffff
  510. } D3DBLEND;
  511. typedef enum _D3DBLENDOP {
  512. D3DBLENDOP_ADD = 1,
  513. D3DBLENDOP_SUBTRACT = 2,
  514. D3DBLENDOP_REVSUBTRACT = 3,
  515. D3DBLENDOP_MIN = 4,
  516. D3DBLENDOP_MAX = 5,
  517. D3DBLENDOP_FORCE_DWORD = 0x7fffffff
  518. } D3DBLENDOP;
  519. typedef enum _D3DCMPFUNC {
  520. D3DCMP_NEVER = 1,
  521. D3DCMP_LESS = 2,
  522. D3DCMP_EQUAL = 3,
  523. D3DCMP_LESSEQUAL = 4,
  524. D3DCMP_GREATER = 5,
  525. D3DCMP_NOTEQUAL = 6,
  526. D3DCMP_GREATEREQUAL = 7,
  527. D3DCMP_ALWAYS = 8,
  528. D3DCMP_FORCE_DWORD = 0x7fffffff
  529. } D3DCMPFUNC;
  530. typedef enum _D3DCUBEMAP_FACES {
  531. D3DCUBEMAP_FACE_POSITIVE_X = 0,
  532. D3DCUBEMAP_FACE_NEGATIVE_X = 1,
  533. D3DCUBEMAP_FACE_POSITIVE_Y = 2,
  534. D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
  535. D3DCUBEMAP_FACE_POSITIVE_Z = 4,
  536. D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
  537. D3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff
  538. } D3DCUBEMAP_FACES;
  539. typedef enum _D3DCULL {
  540. D3DCULL_NONE = 1,
  541. D3DCULL_CW = 2,
  542. D3DCULL_CCW = 3,
  543. D3DCULL_FORCE_DWORD = 0x7fffffff
  544. } D3DCULL;
  545. typedef enum _D3DDEBUGMONITORTOKENS {
  546. D3DDMT_ENABLE = 0,
  547. D3DDMT_DISABLE = 1,
  548. D3DDMT_FORCE_DWORD = 0x7fffffff
  549. } D3DDEBUGMONITORTOKENS;
  550. typedef enum _D3DDEVTYPE {
  551. D3DDEVTYPE_HAL = 1,
  552. D3DDEVTYPE_REF = 2,
  553. D3DDEVTYPE_SW = 3,
  554. D3DDEVTYPE_FORCE_DWORD = 0xffffffff
  555. } D3DDEVTYPE;
  556. typedef enum _D3DFILLMODE {
  557. D3DFILL_POINT = 1,
  558. D3DFILL_WIREFRAME = 2,
  559. D3DFILL_SOLID = 3,
  560. D3DFILL_FORCE_DWORD = 0x7fffffff
  561. } D3DFILLMODE;
  562. typedef enum _D3DFOGMODE {
  563. D3DFOG_NONE = 0,
  564. D3DFOG_EXP = 1,
  565. D3DFOG_EXP2 = 2,
  566. D3DFOG_LINEAR = 3,
  567. D3DFOG_FORCE_DWORD = 0x7fffffff
  568. } D3DFOGMODE;
  569. typedef enum _D3DFORMAT {
  570. D3DFMT_UNKNOWN = 0,
  571. D3DFMT_R8G8B8 = 20,
  572. D3DFMT_A8R8G8B8 = 21,
  573. D3DFMT_X8R8G8B8 = 22,
  574. D3DFMT_R5G6B5 = 23,
  575. D3DFMT_X1R5G5B5 = 24,
  576. D3DFMT_A1R5G5B5 = 25,
  577. D3DFMT_A4R4G4B4 = 26,
  578. D3DFMT_R3G3B2 = 27,
  579. D3DFMT_A8 = 28,
  580. D3DFMT_A8R3G3B2 = 29,
  581. D3DFMT_X4R4G4B4 = 30,
  582. D3DFMT_A8P8 = 40,
  583. D3DFMT_P8 = 41,
  584. D3DFMT_L8 = 50,
  585. D3DFMT_A8L8 = 51,
  586. D3DFMT_A4L4 = 52,
  587. D3DFMT_V8U8 = 60,
  588. D3DFMT_L6V5U5 = 61,
  589. D3DFMT_X8L8V8U8 = 62,
  590. D3DFMT_Q8W8V8U8 = 63,
  591. D3DFMT_V16U16 = 64,
  592. D3DFMT_W11V11U10 = 65,
  593. D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
  594. D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
  595. D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
  596. D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
  597. D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
  598. D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
  599. D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
  600. D3DFMT_D16_LOCKABLE = 70,
  601. D3DFMT_D32 = 71,
  602. D3DFMT_D15S1 = 73,
  603. D3DFMT_D24S8 = 75,
  604. D3DFMT_D16 = 80,
  605. D3DFMT_D24X8 = 77,
  606. D3DFMT_D24X4S4 = 79,
  607. D3DFMT_VERTEXDATA = 100,
  608. D3DFMT_INDEX16 = 101,
  609. D3DFMT_INDEX32 = 102,
  610. D3DFMT_FORCE_DWORD = 0xFFFFFFFF
  611. } D3DFORMAT;
  612. typedef enum _D3DLIGHTTYPE {
  613. D3DLIGHT_POINT = 1,
  614. D3DLIGHT_SPOT = 2,
  615. D3DLIGHT_DIRECTIONAL = 3,
  616. D3DLIGHT_FORCE_DWORD = 0x7fffffff
  617. } D3DLIGHTTYPE;
  618. typedef enum _D3DMATERIALCOLORSOURCE {
  619. D3DMCS_MATERIAL = 0,
  620. D3DMCS_COLOR1 = 1,
  621. D3DMCS_COLOR2 = 2,
  622. D3DMCS_FORCE_DWORD = 0x7fffffff
  623. } D3DMATERIALCOLORSOURCE;
  624. typedef enum _D3DMULTISAMPLE_TYPE {
  625. D3DMULTISAMPLE_NONE = 0,
  626. D3DMULTISAMPLE_2_SAMPLES = 2,
  627. D3DMULTISAMPLE_3_SAMPLES = 3,
  628. D3DMULTISAMPLE_4_SAMPLES = 4,
  629. D3DMULTISAMPLE_5_SAMPLES = 5,
  630. D3DMULTISAMPLE_6_SAMPLES = 6,
  631. D3DMULTISAMPLE_7_SAMPLES = 7,
  632. D3DMULTISAMPLE_8_SAMPLES = 8,
  633. D3DMULTISAMPLE_9_SAMPLES = 9,
  634. D3DMULTISAMPLE_10_SAMPLES = 10,
  635. D3DMULTISAMPLE_11_SAMPLES = 11,
  636. D3DMULTISAMPLE_12_SAMPLES = 12,
  637. D3DMULTISAMPLE_13_SAMPLES = 13,
  638. D3DMULTISAMPLE_14_SAMPLES = 14,
  639. D3DMULTISAMPLE_15_SAMPLES = 15,
  640. D3DMULTISAMPLE_16_SAMPLES = 16,
  641. D3DMULTISAMPLE_FORCE_DWORD = 0xffffffff
  642. } D3DMULTISAMPLE_TYPE;
  643. typedef enum _D3DORDERTYPE {
  644. D3DORDER_LINEAR = 1,
  645. D3DORDER_QUADRATIC = 2,
  646. D3DORDER_CUBIC = 3,
  647. D3DORDER_QUINTIC = 5,
  648. D3DORDER_FORCE_DWORD = 0x7fffffff
  649. } D3DORDERTYPE;
  650. typedef enum _D3DPATCHEDGESTYLE {
  651. D3DPATCHEDGE_DISCRETE = 0,
  652. D3DPATCHEDGE_CONTINUOUS = 1,
  653. D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
  654. } D3DPATCHEDGESTYLE;
  655. typedef enum _D3DPOOL {
  656. D3DPOOL_DEFAULT = 0,
  657. D3DPOOL_MANAGED = 1,
  658. D3DPOOL_SYSTEMMEM = 2,
  659. D3DPOOL_SCRATCH = 3,
  660. D3DPOOL_FORCE_DWORD = 0x7fffffff
  661. } D3DPOOL;
  662. typedef enum _D3DPRIMITIVETYPE {
  663. D3DPT_POINTLIST = 1,
  664. D3DPT_LINELIST = 2,
  665. D3DPT_LINESTRIP = 3,
  666. D3DPT_TRIANGLELIST = 4,
  667. D3DPT_TRIANGLESTRIP = 5,
  668. D3DPT_TRIANGLEFAN = 6,
  669. D3DPT_FORCE_DWORD = 0x7fffffff
  670. } D3DPRIMITIVETYPE;
  671. typedef enum _D3DRENDERSTATETYPE {
  672. D3DRS_ZENABLE = 7,
  673. D3DRS_FILLMODE = 8,
  674. D3DRS_SHADEMODE = 9,
  675. D3DRS_LINEPATTERN = 10,
  676. D3DRS_ZWRITEENABLE = 14,
  677. D3DRS_ALPHATESTENABLE = 15,
  678. D3DRS_LASTPIXEL = 16,
  679. D3DRS_SRCBLEND = 19,
  680. D3DRS_DESTBLEND = 20,
  681. D3DRS_CULLMODE = 22,
  682. D3DRS_ZFUNC = 23,
  683. D3DRS_ALPHAREF = 24,
  684. D3DRS_ALPHAFUNC = 25,
  685. D3DRS_DITHERENABLE = 26,
  686. D3DRS_ALPHABLENDENABLE = 27,
  687. D3DRS_FOGENABLE = 28,
  688. D3DRS_SPECULARENABLE = 29,
  689. D3DRS_ZVISIBLE = 30,
  690. D3DRS_FOGCOLOR = 34,
  691. D3DRS_FOGTABLEMODE = 35,
  692. D3DRS_FOGSTART = 36,
  693. D3DRS_FOGEND = 37,
  694. D3DRS_FOGDENSITY = 38,
  695. D3DRS_EDGEANTIALIAS = 40,
  696. D3DRS_ZBIAS = 47,
  697. D3DRS_RANGEFOGENABLE = 48,
  698. D3DRS_STENCILENABLE = 52,
  699. D3DRS_STENCILFAIL = 53,
  700. D3DRS_STENCILZFAIL = 54,
  701. D3DRS_STENCILPASS = 55,
  702. D3DRS_STENCILFUNC = 56,
  703. D3DRS_STENCILREF = 57,
  704. D3DRS_STENCILMASK = 58,
  705. D3DRS_STENCILWRITEMASK = 59,
  706. D3DRS_TEXTUREFACTOR = 60,
  707. D3DRS_WRAP0 = 128,
  708. D3DRS_WRAP1 = 129,
  709. D3DRS_WRAP2 = 130,
  710. D3DRS_WRAP3 = 131,
  711. D3DRS_WRAP4 = 132,
  712. D3DRS_WRAP5 = 133,
  713. D3DRS_WRAP6 = 134,
  714. D3DRS_WRAP7 = 135,
  715. D3DRS_CLIPPING = 136,
  716. D3DRS_LIGHTING = 137,
  717. D3DRS_AMBIENT = 139,
  718. D3DRS_FOGVERTEXMODE = 140,
  719. D3DRS_COLORVERTEX = 141,
  720. D3DRS_LOCALVIEWER = 142,
  721. D3DRS_NORMALIZENORMALS = 143,
  722. D3DRS_DIFFUSEMATERIALSOURCE = 145,
  723. D3DRS_SPECULARMATERIALSOURCE = 146,
  724. D3DRS_AMBIENTMATERIALSOURCE = 147,
  725. D3DRS_EMISSIVEMATERIALSOURCE = 148,
  726. D3DRS_VERTEXBLEND = 151,
  727. D3DRS_CLIPPLANEENABLE = 152,
  728. D3DRS_SOFTWAREVERTEXPROCESSING = 153,
  729. D3DRS_POINTSIZE = 154,
  730. D3DRS_POINTSIZE_MIN = 155,
  731. D3DRS_POINTSPRITEENABLE = 156,
  732. D3DRS_POINTSCALEENABLE = 157,
  733. D3DRS_POINTSCALE_A = 158,
  734. D3DRS_POINTSCALE_B = 159,
  735. D3DRS_POINTSCALE_C = 160,
  736. D3DRS_MULTISAMPLEANTIALIAS = 161,
  737. D3DRS_MULTISAMPLEMASK = 162,
  738. D3DRS_PATCHEDGESTYLE = 163,
  739. D3DRS_PATCHSEGMENTS = 164,
  740. D3DRS_DEBUGMONITORTOKEN = 165,
  741. D3DRS_POINTSIZE_MAX = 166,
  742. D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
  743. D3DRS_COLORWRITEENABLE = 168,
  744. D3DRS_TWEENFACTOR = 170,
  745. D3DRS_BLENDOP = 171,
  746. D3DRS_POSITIONORDER = 172,
  747. D3DRS_NORMALORDER = 173,
  748. D3DRS_SCISSORTESTENABLE = 174,
  749. D3DRS_SLOPESCALEDEPTHBIAS = 175,
  750. D3DRS_ANTIALIASEDLINEENABLE = 176,
  751. D3DRS_MINTESSELLATIONLEVEL = 178,
  752. D3DRS_MAXTESSELLATIONLEVEL = 179,
  753. D3DRS_ADAPTIVETESS_X = 180,
  754. D3DRS_ADAPTIVETESS_Y = 181,
  755. D3DRS_ADAPTIVETESS_Z = 182,
  756. D3DRS_ADAPTIVETESS_W = 183,
  757. D3DRS_ENABLEADAPTIVETESSELLATION= 184,
  758. D3DRS_TWOSIDEDSTENCILMODE = 185,
  759. D3DRS_CCW_STENCILFAIL = 186,
  760. D3DRS_CCW_STENCILZFAIL = 187,
  761. D3DRS_CCW_STENCILPASS = 188,
  762. D3DRS_CCW_STENCILFUNC = 189,
  763. D3DRS_COLORWRITEENABLE1 = 190,
  764. D3DRS_COLORWRITEENABLE2 = 191,
  765. D3DRS_COLORWRITEENABLE3 = 192,
  766. D3DRS_BLENDFACTOR = 193,
  767. D3DRS_SRGBWRITEENABLE = 194,
  768. D3DRS_DEPTHBIAS = 195,
  769. D3DRS_WRAP8 = 198,
  770. D3DRS_WRAP9 = 199,
  771. D3DRS_WRAP10 = 200,
  772. D3DRS_WRAP11 = 201,
  773. D3DRS_WRAP12 = 202,
  774. D3DRS_WRAP13 = 203,
  775. D3DRS_WRAP14 = 204,
  776. D3DRS_WRAP15 = 205,
  777. D3DRS_SEPARATEALPHABLENDENABLE = 206,
  778. D3DRS_SRCBLENDALPHA = 207,
  779. D3DRS_DESTBLENDALPHA = 208,
  780. D3DRS_BLENDOPALPHA = 209,
  781. D3DRS_FORCE_DWORD = 0x7fffffff
  782. } D3DRENDERSTATETYPE;
  783. typedef enum _D3DRESOURCETYPE {
  784. D3DRTYPE_SURFACE = 1,
  785. D3DRTYPE_VOLUME = 2,
  786. D3DRTYPE_TEXTURE = 3,
  787. D3DRTYPE_VOLUMETEXTURE = 4,
  788. D3DRTYPE_CUBETEXTURE = 5,
  789. D3DRTYPE_VERTEXBUFFER = 6,
  790. D3DRTYPE_INDEXBUFFER = 7,
  791. D3DRTYPE_FORCE_DWORD = 0x7fffffff
  792. } D3DRESOURCETYPE;
  793. typedef enum _D3DSHADEMODE {
  794. D3DSHADE_FLAT = 1,
  795. D3DSHADE_GOURAUD = 2,
  796. D3DSHADE_PHONG = 3,
  797. D3DSHADE_FORCE_DWORD = 0x7fffffff
  798. } D3DSHADEMODE;
  799. typedef enum _D3DSTATEBLOCKTYPE {
  800. D3DSBT_ALL = 1,
  801. D3DSBT_PIXELSTATE = 2,
  802. D3DSBT_VERTEXSTATE = 3,
  803. D3DSBT_FORCE_DWORD = 0xffffffff
  804. } D3DSTATEBLOCKTYPE;
  805. typedef enum _D3DSTENCILOP {
  806. D3DSTENCILOP_KEEP = 1,
  807. D3DSTENCILOP_ZERO = 2,
  808. D3DSTENCILOP_REPLACE = 3,
  809. D3DSTENCILOP_INCRSAT = 4,
  810. D3DSTENCILOP_DECRSAT = 5,
  811. D3DSTENCILOP_INVERT = 6,
  812. D3DSTENCILOP_INCR = 7,
  813. D3DSTENCILOP_DECR = 8,
  814. D3DSTENCILOP_FORCE_DWORD = 0x7fffffff
  815. } D3DSTENCILOP;
  816. typedef enum _D3DSWAPEFFECT {
  817. D3DSWAPEFFECT_DISCARD = 1,
  818. D3DSWAPEFFECT_FLIP = 2,
  819. D3DSWAPEFFECT_COPY = 3,
  820. D3DSWAPEFFECT_COPY_VSYNC = 4,
  821. D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
  822. } D3DSWAPEFFECT;
  823. typedef enum _D3DTEXTUREADDRESS {
  824. D3DTADDRESS_WRAP = 1,
  825. D3DTADDRESS_MIRROR = 2,
  826. D3DTADDRESS_CLAMP = 3,
  827. D3DTADDRESS_BORDER = 4,
  828. D3DTADDRESS_MIRRORONCE = 5,
  829. D3DTADDRESS_FORCE_DWORD = 0x7fffffff
  830. } D3DTEXTUREADDRESS;
  831. typedef enum _D3DTEXTUREFILTERTYPE {
  832. D3DTEXF_NONE = 0,
  833. D3DTEXF_POINT = 1,
  834. D3DTEXF_LINEAR = 2,
  835. D3DTEXF_ANISOTROPIC = 3,
  836. D3DTEXF_FLATCUBIC = 4,
  837. D3DTEXF_GAUSSIANCUBIC = 5,
  838. D3DTEXF_PYRAMIDALQUAD = 6,
  839. D3DTEXF_GAUSSIANQUAD = 7,
  840. D3DTEXF_FORCE_DWORD = 0x7fffffff
  841. } D3DTEXTUREFILTERTYPE;
  842. typedef enum _D3DTEXTUREOP {
  843. D3DTOP_DISABLE = 1,
  844. D3DTOP_SELECTARG1 = 2,
  845. D3DTOP_SELECTARG2 = 3,
  846. D3DTOP_MODULATE = 4,
  847. D3DTOP_MODULATE2X = 5,
  848. D3DTOP_MODULATE4X = 6,
  849. D3DTOP_ADD = 7,
  850. D3DTOP_ADDSIGNED = 8,
  851. D3DTOP_ADDSIGNED2X = 9,
  852. D3DTOP_SUBTRACT = 10,
  853. D3DTOP_ADDSMOOTH = 11,
  854. D3DTOP_BLENDDIFFUSEALPHA = 12,
  855. D3DTOP_BLENDTEXTUREALPHA = 13,
  856. D3DTOP_BLENDFACTORALPHA = 14,
  857. D3DTOP_BLENDTEXTUREALPHAPM = 15,
  858. D3DTOP_BLENDCURRENTALPHA = 16,
  859. D3DTOP_PREMODULATE = 17,
  860. D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
  861. D3DTOP_MODULATECOLOR_ADDALPHA = 19,
  862. D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
  863. D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
  864. D3DTOP_BUMPENVMAP = 22,
  865. D3DTOP_BUMPENVMAPLUMINANCE = 23,
  866. D3DTOP_DOTPRODUCT3 = 24,
  867. D3DTOP_MULTIPLYADD = 25,
  868. D3DTOP_LERP = 26,
  869. D3DTOP_FORCE_DWORD = 0x7fffffff,
  870. } D3DTEXTUREOP;
  871. typedef enum _D3DTEXTURESTAGESTATETYPE {
  872. D3DTSS_COLOROP = 1,
  873. D3DTSS_COLORARG1 = 2,
  874. D3DTSS_COLORARG2 = 3,
  875. D3DTSS_ALPHAOP = 4,
  876. D3DTSS_ALPHAARG1 = 5,
  877. D3DTSS_ALPHAARG2 = 6,
  878. D3DTSS_BUMPENVMAT00 = 7,
  879. D3DTSS_BUMPENVMAT01 = 8,
  880. D3DTSS_BUMPENVMAT10 = 9,
  881. D3DTSS_BUMPENVMAT11 = 10,
  882. D3DTSS_TEXCOORDINDEX = 11,
  883. D3DTSS_ADDRESSU = 13,
  884. D3DTSS_ADDRESSV = 14,
  885. D3DTSS_BORDERCOLOR = 15,
  886. D3DTSS_MAGFILTER = 16,
  887. D3DTSS_MINFILTER = 17,
  888. D3DTSS_MIPFILTER = 18,
  889. D3DTSS_MIPMAPLODBIAS = 19,
  890. D3DTSS_MAXMIPLEVEL = 20,
  891. D3DTSS_MAXANISOTROPY = 21,
  892. D3DTSS_BUMPENVLSCALE = 22,
  893. D3DTSS_BUMPENVLOFFSET = 23,
  894. D3DTSS_TEXTURETRANSFORMFLAGS = 24,
  895. D3DTSS_ADDRESSW = 25,
  896. D3DTSS_COLORARG0 = 26,
  897. D3DTSS_ALPHAARG0 = 27,
  898. D3DTSS_RESULTARG = 28,
  899. D3DTSS_CONSTANT = 32,
  900. D3DTSS_FORCE_DWORD = 0x7fffffff
  901. } D3DTEXTURESTAGESTATETYPE;
  902. typedef enum _D3DTEXTURETRANSFORMFLAGS {
  903. D3DTTFF_DISABLE = 0,
  904. D3DTTFF_COUNT1 = 1,
  905. D3DTTFF_COUNT2 = 2,
  906. D3DTTFF_COUNT3 = 3,
  907. D3DTTFF_COUNT4 = 4,
  908. D3DTTFF_PROJECTED = 256,
  909. D3DTTFF_FORCE_DWORD = 0x7fffffff
  910. } D3DTEXTURETRANSFORMFLAGS;
  911. typedef enum _D3DTRANSFORMSTATETYPE {
  912. D3DTS_VIEW = 2,
  913. D3DTS_PROJECTION = 3,
  914. D3DTS_TEXTURE0 = 16,
  915. D3DTS_TEXTURE1 = 17,
  916. D3DTS_TEXTURE2 = 18,
  917. D3DTS_TEXTURE3 = 19,
  918. D3DTS_TEXTURE4 = 20,
  919. D3DTS_TEXTURE5 = 21,
  920. D3DTS_TEXTURE6 = 22,
  921. D3DTS_TEXTURE7 = 23,
  922. D3DTS_FORCE_DWORD = 0x7fffffff
  923. } D3DTRANSFORMSTATETYPE;
  924. typedef enum _D3DVERTEXBLENDFLAGS {
  925. D3DVBF_DISABLE = 0,
  926. D3DVBF_1WEIGHTS = 1,
  927. D3DVBF_2WEIGHTS = 2,
  928. D3DVBF_3WEIGHTS = 3,
  929. D3DVBF_TWEENING = 255,
  930. D3DVBF_0WEIGHTS = 256
  931. } D3DVERTEXBLENDFLAGS;
  932. typedef enum _D3DZBUFFERTYPE {
  933. D3DZB_FALSE = 0,
  934. D3DZB_TRUE = 1,
  935. D3DZB_USEW = 2,
  936. D3DZB_FORCE_DWORD = 0x7fffffff
  937. } D3DZBUFFERTYPE;
  938. typedef enum _D3DSAMPLERSTATETYPE {
  939. D3DSAMP_ADDRESSU = 1,
  940. D3DSAMP_ADDRESSV = 2,
  941. D3DSAMP_ADDRESSW = 3,
  942. D3DSAMP_BORDERCOLOR = 4,
  943. D3DSAMP_MAGFILTER = 5,
  944. D3DSAMP_MINFILTER = 6,
  945. D3DSAMP_MIPFILTER = 7,
  946. D3DSAMP_MIPMAPLODBIAS = 8,
  947. D3DSAMP_MAXMIPLEVEL = 9,
  948. D3DSAMP_MAXANISOTROPY = 10,
  949. D3DSAMP_SRGBTEXTURE = 11,
  950. D3DSAMP_ELEMENTINDEX = 12,
  951. D3DSAMP_DMAPOFFSET = 13,
  952. D3DSAMP_FORCE_DWORD = 0x7fffffff,
  953. } D3DSAMPLERSTATETYPE;
  954. /*****************************************************************************
  955. * Direct 3D v9 typedefs
  956. */
  957. typedef DWORD D3DCOLOR;
  958. /*****************************************************************************
  959. * Direct 3D v9 structures
  960. */
  961. typedef struct _D3DADAPTER_IDENTIFIER9 {
  962. char Driver[MAX_DEVICE_IDENTIFIER_STRING];
  963. char Description[MAX_DEVICE_IDENTIFIER_STRING];
  964. char DeviceName[32];
  965. LARGE_INTEGER DriverVersion;
  966. DWORD VendorId;
  967. DWORD DeviceId;
  968. DWORD SubSysId;
  969. DWORD Revision;
  970. GUID DeviceIdentifier;
  971. DWORD WHQLLevel;
  972. } D3DADAPTER_IDENTIFIER9;
  973. typedef struct _D3DBOX {
  974. UINT Left;
  975. UINT Top;
  976. UINT Right;
  977. UINT Bottom;
  978. UINT Front;
  979. UINT Back;
  980. } D3DBOX;
  981. typedef struct _D3DCLIPSTATUS9 {
  982. DWORD ClipUnion;
  983. DWORD ClipIntersection;
  984. } D3DCLIPSTATUS9;
  985. typedef struct _D3DCOLORVALUE {
  986. float r;
  987. float g;
  988. float b;
  989. float a;
  990. } D3DCOLORVALUE;
  991. typedef struct _D3DDEVICE_CREATION_PARAMETERS {
  992. UINT AdapterOrdinal;
  993. D3DDEVTYPE DeviceType;
  994. HWND hFocusWindow;
  995. DWORD BehaviorFlags;
  996. } D3DDEVICE_CREATION_PARAMETERS;
  997. typedef struct _D3DDISPLAYMODE {
  998. UINT Width;
  999. UINT Height;
  1000. UINT RefreshRate;
  1001. D3DFORMAT Format;
  1002. } D3DDISPLAYMODE;
  1003. typedef struct _D3DGAMMARAMP {
  1004. WORD red [256];
  1005. WORD green[256];
  1006. WORD blue [256];
  1007. } D3DGAMMARAMP;
  1008. typedef struct _D3DINDEXBUFFER_DESC {
  1009. D3DFORMAT Format;
  1010. D3DRESOURCETYPE Type;
  1011. DWORD Usage;
  1012. D3DPOOL Pool;
  1013. UINT Size;
  1014. } D3DINDEXBUFFER_DESC;
  1015. typedef struct _D3DVECTOR {
  1016. float x;
  1017. float y;
  1018. float z;
  1019. } D3DVECTOR;
  1020. typedef struct _D3DLIGHT9 {
  1021. D3DLIGHTTYPE Type;
  1022. D3DCOLORVALUE Diffuse;
  1023. D3DCOLORVALUE Specular;
  1024. D3DCOLORVALUE Ambient;
  1025. D3DVECTOR Position;
  1026. D3DVECTOR Direction;
  1027. float Range;
  1028. float Falloff;
  1029. float Attenuation0;
  1030. float Attenuation1;
  1031. float Attenuation2;
  1032. float Theta;
  1033. float Phi;
  1034. } D3DLIGHT9;
  1035. typedef struct _D3DLINEPATTERN {
  1036. WORD wRepeatFactor;
  1037. WORD wLinePattern;
  1038. } D3DLINEPATTERN;
  1039. typedef struct _D3DLOCKED_BOX {
  1040. INT RowPitch;
  1041. INT SlicePitch;
  1042. void* pBits;
  1043. } D3DLOCKED_BOX;
  1044. typedef struct _D3DLOCKED_RECT {
  1045. INT Pitch;
  1046. void* pBits;
  1047. } D3DLOCKED_RECT;
  1048. typedef struct _D3DMATERIAL9 {
  1049. D3DCOLORVALUE Diffuse;
  1050. D3DCOLORVALUE Ambient;
  1051. D3DCOLORVALUE Specular;
  1052. D3DCOLORVALUE Emissive;
  1053. float Power;
  1054. } D3DMATERIAL9;
  1055. typedef struct _D3DMATRIX {
  1056. union {
  1057. struct {
  1058. float _11, _12, _13, _14;
  1059. float _21, _22, _23, _24;
  1060. float _31, _32, _33, _34;
  1061. float _41, _42, _43, _44;
  1062. } DUMMYSTRUCTNAME;
  1063. float m[4][4];
  1064. } DUMMYUNIONNAME;
  1065. } D3DMATRIX;
  1066. typedef struct _D3DPRESENT_PARAMETERS_ {
  1067. UINT BackBufferWidth;
  1068. UINT BackBufferHeight;
  1069. D3DFORMAT BackBufferFormat;
  1070. UINT BackBufferCount;
  1071. D3DMULTISAMPLE_TYPE MultiSampleType;
  1072. DWORD MultiSampleQuality;
  1073. D3DSWAPEFFECT SwapEffect;
  1074. HWND hDeviceWindow;
  1075. BOOL Windowed;
  1076. BOOL EnableAutoDepthStencil;
  1077. D3DFORMAT AutoDepthStencilFormat;
  1078. DWORD Flags;
  1079. UINT FullScreen_RefreshRateInHz;
  1080. UINT PresentationInterval;
  1081. } D3DPRESENT_PARAMETERS;
  1082. typedef struct _D3DRANGE {
  1083. UINT Offset;
  1084. UINT Size;
  1085. } D3DRANGE;
  1086. typedef struct _D3DRASTER_STATUS {
  1087. BOOL InVBlank;
  1088. UINT ScanLine;
  1089. } D3DRASTER_STATUS;
  1090. typedef struct _D3DRECT {
  1091. LONG x1;
  1092. LONG y1;
  1093. LONG x2;
  1094. LONG y2;
  1095. } D3DRECT;
  1096. typedef struct _D3DRECTPATCH_INFO {
  1097. UINT StartVertexOffsetWidth;
  1098. UINT StartVertexOffsetHeight;
  1099. UINT Width;
  1100. UINT Height;
  1101. UINT Stride;
  1102. D3DBASISTYPE Basis;
  1103. D3DORDERTYPE Order;
  1104. } D3DRECTPATCH_INFO;
  1105. typedef struct _D3DSURFACE_DESC {
  1106. D3DFORMAT Format;
  1107. D3DRESOURCETYPE Type;
  1108. DWORD Usage;
  1109. D3DPOOL Pool;
  1110. D3DMULTISAMPLE_TYPE MultiSampleType;
  1111. DWORD MultiSampleQuality;
  1112. UINT Width;
  1113. UINT Height;
  1114. } D3DSURFACE_DESC;
  1115. typedef struct _D3DTRIPATCH_INFO {
  1116. UINT StartVertexOffset;
  1117. UINT NumVertices;
  1118. D3DBASISTYPE Basis;
  1119. D3DORDERTYPE Order;
  1120. } D3DTRIPATCH_INFO;
  1121. typedef struct _D3DVERTEXBUFFER_DESC {
  1122. D3DFORMAT Format;
  1123. D3DRESOURCETYPE Type;
  1124. DWORD Usage;
  1125. D3DPOOL Pool;
  1126. UINT Size;
  1127. DWORD FVF;
  1128. } D3DVERTEXBUFFER_DESC;
  1129. typedef struct _D3DVIEWPORT9 {
  1130. DWORD X;
  1131. DWORD Y;
  1132. DWORD Width;
  1133. DWORD Height;
  1134. float MinZ;
  1135. float MaxZ;
  1136. } D3DVIEWPORT9;
  1137. typedef struct _D3DVOLUME_DESC {
  1138. D3DFORMAT Format;
  1139. D3DRESOURCETYPE Type;
  1140. DWORD Usage;
  1141. D3DPOOL Pool;
  1142. UINT Size;
  1143. UINT Width;
  1144. UINT Height;
  1145. UINT Depth;
  1146. } D3DVOLUME_DESC;
  1147. typedef enum _D3DQUERYTYPE {
  1148. D3DQUERYTYPE_VCACHE = 4,
  1149. D3DQUERYTYPE_RESOURCEMANAGER = 5,
  1150. D3DQUERYTYPE_VERTEXSTATS = 6,
  1151. D3DQUERYTYPE_EVENT = 8,
  1152. D3DQUERYTYPE_OCCLUSION = 9
  1153. } D3DQUERYTYPE;
  1154. #endif /* __WINE_D3D9TYPES_H */