-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
61 lines (43 loc) · 1.96 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
PixelMagic
==========
PixelMagic is a framework that implements HLSL shaders. It features both an interpreter
and a compiler that generates Mono.Simd code that can exploit the full potential of your
CPU. Only PS 2.0 is supported.
Effects can be applied to in-memory buffers or cairo image surfaces.
Testing
===========
The test suite is generated by applying shaders to a png image and saving the result.
Some of the effects come from (http://wpffx.codeplex.com/).
TODO
====
Figure out what's wrong with lerp-2 and gloom.
Compiler:
Write results using a Surface object, this is slow.
Specialize for simple samplers so their can be inlined
Texture coords should be folded into a pair of floats if only used with texload
Maybe eliminate the i,j loop variables and test for tex.x|y < 0
Remove the fdiv in the inner loop, cache hq / 2 in a variable outside
Use loop tilling if any sampler is doing bilinear filtering or if we detect that fetches are transformed.
Enforce declared variable write mask on stores.
Better code can be generated for single component write masks.
Detect SSE4 and use BLENDPS for masks.
Figure out texture coord regs and generalize current code.
Using the Series for JIT'ing SinCos is probably better than calling into x87 junk
Math:
Figure out to to implement FRC with decent speed.
Use some of gallium's tricks to improve speed of some ops.
Misc:
The texture read/write code is not endian safe.
TestSuite:
We produce some artifacts with pixelate.
Mono:
JIT "newobj Vector4f" property.
When passing float constants to setters/constructors avoid the slow FPU->memory->XMM path.
Teach the JIT to emit a constant load in case of constructors where all arguments are constants.
Known Issues
============
Mono 2.6 release on OSX miscompiles Mono.Simd code. Trunk works fine, check tip of 2.6.
Links
=====
HLSL reference: http://msdn.microsoft.com/en-us/library/bb219847(VS.85).aspx
Shader codes: http://msdn.microsoft.com/en-us/library/ff552891(VS.85).aspx