jpd002 / Play-

Play! - PlayStation2 Emulator
http://purei.org
Other
2.06k stars 247 forks source link

Programmable blending, destination alpha test, texture swizzling/shuffle and depth buffer #392

Open ADormant opened 8 years ago

ADormant commented 8 years ago

@jpd002 If you are rewritting opengl could you implement programmable blending now which is required for correct emulation of PS2's blending modes. https://www.opengl.org/registry/specs/ARB/texture_barrier.txt https://www.opengl.org/registry/specs/NV/texture_barrier.txt https://www.khronos.org/registry/gles/extensions/EXT/EXT_shader_framebuffer_fetch.txt https://www.khronos.org/registry/gles/extensions/ARM/ARM_shader_framebuffer_fetch.txt https://www.khronos.org/registry/gles/extensions/ARM/ARM_shader_framebuffer_fetch_depth_stencil.txt https://www.opengl.org/registry/specs/ARB/fragment_shader_interlock.txt https://developer.nvidia.com/sites/default/files/akamai/opengl/specs/GL_NV_fragment_shader_interlock.txt https://www.opengl.org/registry/specs/INTEL/fragment_shader_ordering.txt https://www.opengl.org/registry/specs/ARB/shader_atomic_counters.txt https://www.khronos.org/registry/gles/extensions/OES/OES_shader_image_atomic.txt http://blog.icare3d.org/2014/09/maxwell-gm204-opengl-extensions.html

PCSX2 uses a texture barrier but for some games http://forums.pcsx2.net/Thread-Missing-Eyes you need these extensions too https://developer.nvidia.com/sites/default/files/akamai/opengl/specs/GL_NV_fragment_shader_interlock.txt https://www.opengl.org/registry/specs/INTEL/fragment_shader_ordering.txt

Texture Barrier https://github.com/PCSX2/pcsx2/commit/a99750ae8761ad0c8a69c547f2bf0560537367a9 https://github.com/PCSX2/pcsx2/commit/8e5e770fd12f9c9b2cdd266846af3e84ac39da94 HDR Color Clipping https://github.com/PCSX2/pcsx2/pull/688/files https://github.com/PCSX2/pcsx2/commit/7979dec5b089ef7435f344c7d3eead521efe1f3c https://github.com/PCSX2/pcsx2/commit/bd0de8fbaf0c1bbb5924d8a96a023275df0cb7d8 https://github.com/PCSX2/pcsx2/commit/a0edcb58af8c725ef778ac343c9c72ebb8040217 https://github.com/PCSX2/pcsx2/commit/45bb27d6dbfc7c216dc8e3917c562d386c89c651 Sprite blending speed https://github.com/PCSX2/pcsx2/pull/672/files https://github.com/PCSX2/pcsx2/pull/1115/files Impossible blending https://github.com/PCSX2/pcsx2/pull/533/files DATE and Depth https://github.com/PCSX2/pcsx2/pull/893/files 16bit Z-Buffer https://github.com/PCSX2/pcsx2/commit/4a3c145c7244ac10c7f60313a449da83c8810d58 https://github.com/PCSX2/pcsx2/pull/1278/files https://github.com/PCSX2/pcsx2/commit/c6f026ee689ab579b7dd7d9f066eae62978a3f32 https://github.com/PCSX2/pcsx2/commit/0c12f232ca15bde1acdacff2ebc29c74b62f7068 https://github.com/PCSX2/pcsx2/commit/db5468afcf0802378b4c56beddb7007bfff9a760 https://github.com/PCSX2/pcsx2/pull/679/files https://github.com/PCSX2/pcsx2/pull/691/files Depth Color Direct Write https://github.com/PCSX2/pcsx2/pull/718/files Depth Conversion https://github.com/PCSX2/pcsx2/pull/806/files https://github.com/PCSX2/pcsx2/commit/f4e881ad30e51381cc09e62a43d244a4dded4b6d https://github.com/PCSX2/pcsx2/commit/ca9b5ce11d1ef8fff4c450e19ce5876ec08ac880 Texture Shufle https://github.com/PCSX2/pcsx2/pull/653/files Texture Shuffle+DATE https://github.com/PCSX2/pcsx2/pull/644/files
https://github.com/PCSX2/pcsx2/commit/f2c77ffa08bcbe91e49b9478ece2aa2f43216e5a https://github.com/PCSX2/pcsx2/commit/78569ee8335daf25b406634ee2ad7aadb774828c https://github.com/PCSX2/pcsx2/commit/744f9ebc097982e5dd6387e8e02826ecf9335452 https://github.com/PCSX2/pcsx2/commit/350db223d3931d17927c02c22a6d3fe44849055a https://github.com/PCSX2/pcsx2/commit/22f11958e9d6ad39c648267c555577b096276a1a https://github.com/PCSX2/pcsx2/commit/bd6ea17bdc04117c8dd571baed00381ccee21410 DATE with texture barrier https://github.com/PCSX2/pcsx2/commit/5565544ba625bc11c474f7b8a07207631ae73682 https://github.com/PCSX2/pcsx2/commit/37661f3a8669b07c0b956d8919b9dddb60125908 https://github.com/PCSX2/pcsx2/commit/df3ade896b0b03462b67b3cd6c6390eb76a72db4 https://github.com/PCSX2/pcsx2/commit/df3ade896b0b03462b67b3cd6c6390eb76a72db4 https://github.com/PCSX2/pcsx2/commit/c32f1dfc234ca0cdca005d89fc6c00e6f776a294 https://github.com/PCSX2/pcsx2/commit/0e3491bd580eaa9661e58054d74e9bb5b1d1d600 https://github.com/PCSX2/pcsx2/commit/bd0de8fbaf0c1bbb5924d8a96a023275df0cb7d8 https://github.com/PCSX2/pcsx2/commit/5b574055178278982c7450e883205d12f46d6e42 https://github.com/PCSX2/pcsx2/commit/14dffa762b0f394390aa4dd6fda9b05d02821568 https://github.com/PCSX2/pcsx2/commit/be1403cdc27e683fc305b5e6edabcbcf49901ed8 Texture Format https://github.com/PCSX2/pcsx2/pull/763/files https://github.com/PCSX2/pcsx2/pull/782/files https://github.com/PCSX2/pcsx2/commit/46a152566815ffc1aad07779d49d50ec1f88cc77 https://github.com/PCSX2/pcsx2/commit/4eed4ca3a1a194268fe48aaece3e6669e5897fa3 https://github.com/PCSX2/pcsx2/commit/78dd9577174857f1218b2b87457fa1470a6d7140 Partial framebuffer masking Correct FB Mask Converion on Texture Shufle https://github.com/PCSX2/pcsx2/commit/839003467e4193e66e74857816fa910a536f7088 https://github.com/PCSX2/pcsx2/commit/6580f4922fcee77db8cf9225a70db781b53c12a8 https://github.com/PCSX2/pcsx2/commit/260c12756a839613b65425b8ae4306d42cc085ff https://github.com/PCSX2/pcsx2/commit/4d1241070768879602f5a690508eda3a1d424869 https://github.com/PCSX2/pcsx2/commit/350db223d3931d17927c02c22a6d3fe44849055a Unsafe Framebuffer mask https://github.com/PCSX2/pcsx2/pull/1078/files https://github.com/PCSX2/pcsx2/commit/c5341a27113b9627cb36bbe6fb9ff62579564055 https://github.com/PCSX2/pcsx2/commit/35081f922a08d5069e9e1f4c66a2b9f140f5ef97 In-shader blending https://github.com/PCSX2/pcsx2/commit/3d35e4f8ecef17fed9fa765006b7d74b442baca5 Impossible blend 2 https://github.com/PCSX2/pcsx2/commit/b89f0cfa4cff5a94fa1bf583ec3d3fb3bfc5af4e https://github.com/PCSX2/pcsx2/commit/380e420cdde46dcc016ece0613645f728a9ff71c https://github.com/PCSX2/pcsx2/commit/5b574055178278982c7450e883205d12f46d6e42 Filtering of texture cache https://github.com/PCSX2/pcsx2/commit/11708486d8786a18b5c8986ced2790ac7d4cef3e TEXA register https://github.com/PCSX2/pcsx2/commit/cee0fde9401616e45c721166eded573b838bff16 Texture format https://github.com/PCSX2/pcsx2/commit/78569ee8335daf25b406634ee2ad7aadb774828c https://github.com/PCSX2/pcsx2/pull/555/files

https://github.com/Yabause/yabause/commit/46bd80bd8f076f4e60cf86d18e8a5f259e962f07 https://github.com/Yabause/yabause/pull/22/files https://github.com/Yabause/yabause/commit/b307da5386fd73950f1acb5c5824fb8c89e49e00 https://github.com/Yabause/yabause/commit/c6ffab78439de82e80cf1298b0747440c8f2a364 https://github.com/Yabause/yabause/commit/f04d3c5fcdf038e70848e0bac6140911d977fab4

https://github.com/hrydgard/ppsspp/pull/6313/files https://github.com/hrydgard/ppsspp/pull/6070/files https://github.com/hrydgard/ppsspp/pull/5917/files https://github.com/hrydgard/ppsspp/pull/5859/files https://github.com/hrydgard/ppsspp/pull/6063/files https://github.com/hrydgard/ppsspp/pull/6679/files https://github.com/hrydgard/ppsspp/pull/6350/files https://github.com/hrydgard/ppsspp/pull/8218/files https://github.com/hrydgard/ppsspp/pull/8213/files https://github.com/hrydgard/ppsspp/pull/8163/files https://github.com/hrydgard/ppsspp/pull/8210/files https://github.com/hrydgard/ppsspp/pull/7964/files https://github.com/hrydgard/ppsspp/pull/7567/files https://github.com/hrydgard/ppsspp/pull/7520/files https://github.com/hrydgard/ppsspp/pull/1614/files https://github.com/hrydgard/ppsspp/pull/5767/files

http://pcsx2.net/developer-blog/268-explanation-impossible-blend.html

Texture palette mask https://github.com/PCSX2/pcsx2/commit/ea9e6082880a41d169ee0c04be5c811910fc398b Video Modes https://github.com/PCSX2/pcsx2/pull/1137/files https://github.com/PCSX2/pcsx2/pull/1170/files https://github.com/PCSX2/pcsx2/pull/1105/files https://github.com/PCSX2/pcsx2/pull/1046/files https://github.com/PCSX2/pcsx2/pull/1175/files https://github.com/PCSX2/pcsx2/pull/1225/files https://github.com/PCSX2/pcsx2/pull/1234/files https://github.com/PCSX2/pcsx2/commit/1fa13163e4fb6af2821dbd9dd044ead450145ad4 https://github.com/PCSX2/pcsx2/commit/0a467291f959adead796700dc17ade3dcf45d5bb

https://github.com/PCSX2/pcsx2/commit/f3b6829c74c8d3530c4d6f5ed03e1094e489cb5e https://github.com/PCSX2/pcsx2/commit/1853d0d16d975b83d397bfb82dbc0596249b85e2 https://github.com/PCSX2/pcsx2/commit/ad08701cb1867703580f13ebed94974cef2471a9 https://github.com/PCSX2/pcsx2/commit/1960d51e602a3ff6ab7e14c2d66a2c346e1867d7 https://github.com/PCSX2/pcsx2/commit/de38963904140259ca1b398234e04931f545bbf8 https://github.com/PCSX2/pcsx2/commit/fda511a949621f2764ffed1a974921905259009b https://github.com/PCSX2/pcsx2/commit/fa1377a8ee5120522a47666fb4416b45fd85c3dd https://github.com/PCSX2/pcsx2/commit/2941adf36412fc742ac331f213f31c4af5bf6281

ghost commented 8 years ago

Holy large post batman. You could just suggest the feature then maybe put a link or two in. Most people are perfectly capable of finding documentation themselves. Also I think fixing post processing with the ps2's weird framebuffer is important too

jpd002 commented 8 years ago

I've been refactoring some things in the OpenGL GS handler to make implementation of accurate blending, better alpha testing and such easier. I'll need to write lots of hardware tests to make implementation of those features easier too (I've been working on some alpha blending hardware tests recently).