DXGL r552 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r551‎ | r552 | r553 >
Date:23:15, 13 October 2014
Author:admin
Status:new
Tags:
Comment:
Add more raster operations.
Newlines at end of ROP commands.
Modified paths:
  • /ddraw/ShaderGen2D.cpp (modified) (history)

Diff [purge]

Index: ddraw/ShaderGen2D.cpp
@@ -118,7 +118,7 @@
119119 const DWORD supported_rops[8] = {
120120 0xFFFFFFFF,
121121 0xFFFFFFFF,
122 - 0x04200010,
 122+ 0xFFFFFFFF,
123123 0x00000040,
124124 0x00000100,
125125 0x08000400,
@@ -212,101 +212,101 @@
213213 // ROP Operations
214214 static const char *op_ROP[256] = {
215215 "pixel = ivec4(0);\n",//00 BLACKNESS
216 -"pixel = (dest | (pattern | pixel)) ^ colorsizedest;",
217 -"pixel = dest & ((pattern | pixel) ^ colorsizedest);",
218 -"pixel = (pattern | pixel) ^ colorsizedest;",
219 -"pixel = pixel & ((dest | pattern) ^ colorsizedest);",
220 -"pixel = (dest | pattern) ^ colorsizedest;",
221 -"pixel = (pattern | ((dest ^ pixel) ^ colorsizedest)) ^ colorsizedest;",
222 -"pixel = (pattern | (dest & pixel)) ^ colorsizedest;",
223 -"pixel = pixel & dest & (pattern ^ colorsizedest);",
224 -"pixel = (pattern | (dest ^ pixel)) ^ colorsizedest;",
225 -"pixel = dest & (pattern ^ colorsizedest);",
226 -"pixel = (pattern | (pixel & (dest ^ colorsizedest))) ^ colorsizedest;",
227 -"pixel = pixel & (pattern ^ colorsizedest);",
228 -"pixel = (pattern | (dest & (pixel ^ colorsizedest))) ^ colorsizedest;",
229 -"pixel = (pattern | ((dest | pixel) ^ colorsizedest)) ^ colorsizedest;",
 216+"pixel = (dest | (pattern | pixel)) ^ colorsizedest;\n",
 217+"pixel = dest & ((pattern | pixel) ^ colorsizedest);\n",
 218+"pixel = (pattern | pixel) ^ colorsizedest;\n",
 219+"pixel = pixel & ((dest | pattern) ^ colorsizedest);\n",
 220+"pixel = (dest | pattern) ^ colorsizedest;\n",
 221+"pixel = (pattern | ((dest ^ pixel) ^ colorsizedest)) ^ colorsizedest;\n",
 222+"pixel = (pattern | (dest & pixel)) ^ colorsizedest;\n",
 223+"pixel = pixel & dest & (pattern ^ colorsizedest);\n",
 224+"pixel = (pattern | (dest ^ pixel)) ^ colorsizedest;\n",
 225+"pixel = dest & (pattern ^ colorsizedest);\n",
 226+"pixel = (pattern | (pixel & (dest ^ colorsizedest))) ^ colorsizedest;\n",
 227+"pixel = pixel & (pattern ^ colorsizedest);\n",
 228+"pixel = (pattern | (dest & (pixel ^ colorsizedest))) ^ colorsizedest;\n",
 229+"pixel = (pattern | ((dest | pixel) ^ colorsizedest)) ^ colorsizedest;\n",
230230 "pixel = pattern ^ colorsizedest;\n",//0F
231 -"pixel = pattern & ((pixel | dest) ^ colorsizedest);",//10
 231+"pixel = pattern & ((pixel | dest) ^ colorsizedest);\n",//10
232232 "pixel = (dest | pixel) ^ colorsizedest;\n",//11 NOTSRCERASE
233 -"pixel = (pixel | ((dest ^ pattern) ^ colorsizedest)) ^ colorsizedest;",
234 -"pixel = (pixel | (dest & pattern)) ^ colorsizedest;",
235 -"pixel = (dest | ((pattern ^ pixel) ^ colorsizedest)) ^ colorsizedest;",
236 -"pixel = (dest | (pattern & pixel)) ^ colorsizedest;",
237 -"pixel = pattern ^ pixel ^ (dest & ((pattern & pixel) ^ colorsizedest));",
238 -"pixel = (pixel ^ colorsizedest) ^ ((pixel ^ pattern) & (pixel ^ dest));",
239 -"pixel = (pixel ^ pattern) & (dest ^ pattern);",
240 -"pixel = (pixel ^ colorsizedest) ^ (dest & ((pattern & pixel) ^ colorsizedest));",
241 -"pixel = pattern ^ (dest | (pixel & pattern));",
242 -"pixel = (pixel ^ colorsizedest) ^ (dest & (pattern ^ pixel));",
243 -"pixel = pattern ^ (pixel | (dest & pattern));",
244 -"pixel = (dest ^ colorsizedest) ^ (pixel & (dest ^ pattern));",
245 -"pixel = pattern ^ (dest | pixel);",
246 -"pixel = (pattern & (dest | pixel)) ^ colorsizedest;",//1F
247 -"pixel = dest & (pattern & (pixel ^ colorsizedest));",//20
248 -"pixel = (pixel | (dest ^ pattern)) ^ colorsizedest;",
249 -"pixel = (pixel ^ colorsizedest) & dest;",
250 -"pixel = (pixel | (pattern & (dest ^ colorsizedest))) ^ colorsizedest;",
251 -"pixel = (pixel ^ pattern) & (pixel ^ dest);",
252 -"pixel = (pattern ^ colorsizedest) ^ (dest & ((pixel & pattern) ^ colorsizedest));",
253 -"pixel = pixel ^ (dest | (pixel & pattern));",
254 -"pixel = pixel ^ (dest | ((pattern ^ pixel) ^ colorsizedest));",
255 -"pixel = dest & (pattern ^ pixel);",
256 -"pixel = (pattern ^ colorsizedest) ^ pixel ^ (dest | (pattern & pixel));",
257 -"pixel = dest & ((pattern & pixel) ^ colorsizedest);",
258 -"pixel = (pixel ^ colorsizedest) ^ ((pattern ^ pixel) & (pattern ^ dest));",
259 -"pixel = pixel ^ (pattern & (pixel | dest));",
260 -"pixel = pattern ^ (pixel | (dest ^ colorsizedest));",
261 -"pixel = pattern ^ (pixel | (dest ^ pattern));",
262 -"pixel = (pattern & (pixel | (dest ^ pattern)))^ colorsizedest;",//2F
263 -"pixel = pattern & (pixel ^ colorsizedest);",//30
264 -"pixel = (pixel | (dest & (pattern ^ colorsizedest))) ^ colorsizedest;",
265 -"pixel = pixel ^ (dest | pattern | pixel);",
 233+"pixel = (pixel | ((dest ^ pattern) ^ colorsizedest)) ^ colorsizedest;\n",
 234+"pixel = (pixel | (dest & pattern)) ^ colorsizedest;\n",
 235+"pixel = (dest | ((pattern ^ pixel) ^ colorsizedest)) ^ colorsizedest;\n",
 236+"pixel = (dest | (pattern & pixel)) ^ colorsizedest;\n",
 237+"pixel = pattern ^ pixel ^ (dest & ((pattern & pixel) ^ colorsizedest));\n",
 238+"pixel = (pixel ^ colorsizedest) ^ ((pixel ^ pattern) & (pixel ^ dest));\n",
 239+"pixel = (pixel ^ pattern) & (dest ^ pattern);\n",
 240+"pixel = (pixel ^ colorsizedest) ^ (dest & ((pattern & pixel) ^ colorsizedest));\n",
 241+"pixel = pattern ^ (dest | (pixel & pattern));\n",
 242+"pixel = (pixel ^ colorsizedest) ^ (dest & (pattern ^ pixel));\n",
 243+"pixel = pattern ^ (pixel | (dest & pattern));\n",
 244+"pixel = (dest ^ colorsizedest) ^ (pixel & (dest ^ pattern));\n",
 245+"pixel = pattern ^ (dest | pixel);\n",
 246+"pixel = (pattern & (dest | pixel)) ^ colorsizedest;\n",//1F
 247+"pixel = dest & (pattern & (pixel ^ colorsizedest));\n",//20
 248+"pixel = (pixel | (dest ^ pattern)) ^ colorsizedest;\n",
 249+"pixel = (pixel ^ colorsizedest) & dest;\n",
 250+"pixel = (pixel | (pattern & (dest ^ colorsizedest))) ^ colorsizedest;\n",
 251+"pixel = (pixel ^ pattern) & (pixel ^ dest);\n",
 252+"pixel = (pattern ^ colorsizedest) ^ (dest & ((pixel & pattern) ^ colorsizedest));\n",
 253+"pixel = pixel ^ (dest | (pixel & pattern));\n",
 254+"pixel = pixel ^ (dest | ((pattern ^ pixel) ^ colorsizedest));\n",
 255+"pixel = dest & (pattern ^ pixel);\n",
 256+"pixel = (pattern ^ colorsizedest) ^ pixel ^ (dest | (pattern & pixel));\n",
 257+"pixel = dest & ((pattern & pixel) ^ colorsizedest);\n",
 258+"pixel = (pixel ^ colorsizedest) ^ ((pattern ^ pixel) & (pattern ^ dest));\n",
 259+"pixel = pixel ^ (pattern & (pixel | dest));\n",
 260+"pixel = pattern ^ (pixel | (dest ^ colorsizedest));\n",
 261+"pixel = pattern ^ (pixel | (dest ^ pattern));\n",
 262+"pixel = (pattern & (pixel | (dest ^ pattern)))^ colorsizedest;\n",//2F
 263+"pixel = pattern & (pixel ^ colorsizedest);\n",//30
 264+"pixel = (pixel | (dest & (pattern ^ colorsizedest))) ^ colorsizedest;\n",
 265+"pixel = pixel ^ (dest | pattern | pixel);\n",
266266 "pixel = pixel ^ colorsizedest;\n",//33 NOTSRCCOPY
267 -"pixel = pixel ^ (pattern | (dest & pixel));",
268 -"pixel = pixel ^ (pattern | ((dest ^ pixel) ^ colorsizedest));",
269 -"pixel = pixel ^ (dest | pattern);",
270 -"pixel = (pixel & (dest | pattern)) ^ colorsizedest;",
271 -"pixel = pattern ^ (pixel & (dest | pattern));",
272 -"pixel = pixel ^ (pattern | (dest ^ colorsizedest));",
273 -"pixel = pixel ^ (pattern | (dest ^ pixel));",
274 -"pixel = (pixel & (pattern | (dest ^ colorsizedest))) ^ colorsizedest;",
275 -"pixel = pattern ^ pixel;",
276 -"pixel = pixel ^ (pattern | ((dest | pixel) ^ colorsizedest));",
277 -"pixel = pixel ^ (pattern | (dest & (pixel ^ colorsizedest)));",
278 -"pixel = (pattern & pixel) ^ colorsizedest;",//3F
279 -"",//40
280 -"",
281 -"",
282 -"",
 267+"pixel = pixel ^ (pattern | (dest & pixel));\n",
 268+"pixel = pixel ^ (pattern | ((dest ^ pixel) ^ colorsizedest));\n",
 269+"pixel = pixel ^ (dest | pattern);\n",
 270+"pixel = (pixel & (dest | pattern)) ^ colorsizedest;\n",
 271+"pixel = pattern ^ (pixel & (dest | pattern));\n",
 272+"pixel = pixel ^ (pattern | (dest ^ colorsizedest));\n",
 273+"pixel = pixel ^ (pattern | (dest ^ pixel));\n",
 274+"pixel = (pixel & (pattern | (dest ^ colorsizedest))) ^ colorsizedest;\n",
 275+"pixel = pattern ^ pixel;\n",
 276+"pixel = pixel ^ (pattern | ((dest | pixel) ^ colorsizedest));\n",
 277+"pixel = pixel ^ (pattern | (dest & (pixel ^ colorsizedest)));\n",
 278+"pixel = (pattern & pixel) ^ colorsizedest;\n",//3F
 279+"pixel = pattern & pixel & (dest ^ colorsizedest);\n",//40
 280+"pixel = (dest | (pattern ^ pixel)) ^ colorsizedest;\n",
 281+"pixel = (pixel ^ dest) & (pattern ^ dest);\n",
 282+"pixel = (pixel ^ colorsizedest) ^ (pattern & ((dest & pixel) ^ colorsizedest));\n",
283283 "pixel = pixel & (dest ^ colorsizedest);\n",//44 SRCERASE
284 -"",
285 -"",
286 -"",
287 -"",
288 -"",
289 -"",
290 -"",
291 -"",
292 -"",
293 -"",
294 -"",//4F
295 -"",//50
296 -"",
297 -"",
298 -"",
299 -"",
 284+"pixel = (dest | (pattern & (pixel ^ colorsizedest))) ^ colorsizedest;\n",
 285+"pixel = dest ^ (pixel | (pattern & dest));\n",
 286+"pixel = (pattern ^ colorsizedest) ^ (pixel & (dest ^ pattern));\n",
 287+"pixel = pixel & (pattern ^ dest);\n",
 288+"pixel = (pattern ^ colorsizedest) ^ dest ^ (pixel | (pattern & dest));\n",
 289+"pixel = dest ^ (pattern & (pixel | dest));\n",
 290+"pixel = pattern ^ (dest | (pixel ^ colorsizedest));\n",
 291+"pixel = pixel & ((dest & pattern) ^ colorsizedest);\n",
 292+"pixel = (pixel ^ colorsizedest) ^ ((pixel ^ pattern) | (pixel ^ dest));\n",
 293+"pixel = pattern ^ (dest | (pixel ^ pattern));\n",
 294+"pixel = (pattern & (dest | (pixel ^ colorsizedest))) ^ colorsizedest;\n",//4F
 295+"pixel = pattern & (dest ^ colorsizedest);\n",//50
 296+"pixel = (dest | (pixel & (pattern ^ colorsizedest))) ^ colorsizedest;\n",
 297+"pixel = dest ^ (pattern | (pixel & dest));\n",
 298+"pixel = (pixel ^ colorsizedest) ^ (pattern & (dest ^ pixel));\n",
 299+"pixel = (dest | ((pattern | pixel) ^ colorsizedest)) ^ colorsizedest;\n",
300300 "pixel = dest ^ colorsizedest;\n",//55 DSTINVERT
301 -"",
302 -"",
303 -"",
304 -"",
 301+"pixel = dest ^ (pattern | pixel);\n",
 302+"pixel = (dest & (pattern | pixel)) ^ colorsizedest;\n",
 303+"pixel = pattern ^ (dest & (pattern | pixel));\n",
 304+"pixel = dest ^ (pattern | (pixel ^ colorsizedest));\n",
305305 "pixel = dest ^ pattern;\n",//5A PATINVERT
306 -"",
307 -"",
308 -"",
309 -"",
310 -"",//5F
 306+"pixel = dest ^ (pattern | ((pixel | dest) ^ colorsizedest));\n",
 307+"pixel = dest ^ (pattern | (pixel ^ dest));\n",
 308+"pixel = (dest & (pattern | (pixel ^ colorsizedest))) ^ colorsizedest;\n",
 309+"pixel = dest ^ (pattern | (pixel & (dest ^ colorsizedest)));\n",
 310+"pixel = (dest & pattern) ^ colorsizedest;\n",//5F
311311 "",//60
312312 "",
313313 "",