DriverDetails.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. // Copyright 2013 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "Common/CommonTypes.h"
  6. namespace DriverDetails
  7. {
  8. // Enum of supported operating systems
  9. enum OS
  10. {
  11. OS_ALL = (1 << 0),
  12. OS_WINDOWS = (1 << 1),
  13. OS_LINUX = (1 << 2),
  14. OS_OSX = (1 << 3),
  15. OS_ANDROID = (1 << 4),
  16. OS_FREEBSD = (1 << 5),
  17. };
  18. // Enum of known vendors
  19. // Tegra and Nvidia are separated out due to such substantial differences
  20. enum Vendor
  21. {
  22. VENDOR_ALL = 0,
  23. VENDOR_NVIDIA,
  24. VENDOR_ATI,
  25. VENDOR_INTEL,
  26. VENDOR_ARM,
  27. VENDOR_QUALCOMM,
  28. VENDOR_IMGTEC,
  29. VENDOR_TEGRA,
  30. VENDOR_VIVANTE,
  31. VENDOR_MESA,
  32. VENDOR_UNKNOWN
  33. };
  34. // Enum of known drivers
  35. enum Driver
  36. {
  37. DRIVER_ALL = 0,
  38. DRIVER_NVIDIA, // Official Nvidia, including mobile GPU
  39. DRIVER_NOUVEAU, // OSS nouveau
  40. DRIVER_ATI, // Official ATI
  41. DRIVER_R600, // OSS Radeon
  42. DRIVER_INTEL, // Official Intel
  43. DRIVER_I965, // OSS Intel
  44. DRIVER_ARM, // Official Mali driver
  45. DRIVER_LIMA, // OSS Mali driver
  46. DRIVER_QUALCOMM, // Official Adreno driver
  47. DRIVER_FREEDRENO, // OSS Adreno driver
  48. DRIVER_IMGTEC, // Official PowerVR driver
  49. DRIVER_VIVANTE, // Official Vivante driver
  50. DRIVER_UNKNOWN // Unknown driver, default to official hardware driver
  51. };
  52. // Enum of known bugs
  53. // These can be vendor specific, but we put them all in here
  54. // For putting a new bug in here, make sure to put a detailed comment above the enum
  55. // This'll ensure we know exactly what the issue is.
  56. enum Bug
  57. {
  58. // Bug: No Dynamic UBO array object access
  59. // Affected Devices: Qualcomm/Adreno
  60. // Started Version: 14
  61. // Ended Version: 95
  62. // Accessing UBO array members dynamically causes the Adreno shader compiler to crash
  63. // Errors out with "Internal Error"
  64. // With v53 video drivers, dynamic member access "works." It works to the extent that it doesn't crash.
  65. // With v95 drivers everything works as it should.
  66. BUG_NODYNUBOACCESS = 0,
  67. // Bug: Centroid is broken in shaders
  68. // Affected devices: Qualcomm/Adreno
  69. // Started Version: 14
  70. // Ended Version: 53
  71. // Centroid in/out, used in the shaders, is used for multisample buffers to get the texel correctly
  72. // When MSAA is disabled, it acts like a regular in/out
  73. // Tends to cause the driver to render full white or black
  74. BUG_BROKENCENTROID,
  75. // Bug: INFO_LOG_LENGTH broken
  76. // Affected devices: Qualcomm/Adreno
  77. // Started Version: ? (Noticed on v14)
  78. // Ended Version: 53
  79. // When compiling a shader, it is important that when it fails,
  80. // you first get the length of the information log prior to grabbing it.
  81. // This allows you to allocate an array to store all of the log
  82. // Adreno devices /always/ return 0 when querying GL_INFO_LOG_LENGTH
  83. // They also max out at 1024 bytes(1023 characters + null terminator) for the log
  84. BUG_BROKENINFOLOG,
  85. // Bug: UBO buffer offset broken
  86. // Affected devices: all mesa drivers
  87. // Started Version: 9.0 (mesa doesn't support ubo before)
  88. // Ended Version: up to 9.2
  89. // The offset of glBindBufferRange was ignored on all Mesa Gallium3D drivers until 9.1.3
  90. // Nouveau stored the offset as u16 which isn't enough for all cases with range until 9.1.6
  91. // I965 has broken data fetches from uniform buffers which results in a dithering until 9.2.0
  92. BUG_BROKENUBO,
  93. // Bug: The pinned memory extension isn't working for index buffers
  94. // Affected devices: AMD as they are the only vendor providing this extension
  95. // Started Version: ?
  96. // Ended Version: 13.9 working for me (neobrain).
  97. // Affected OS: Linux
  98. // Pinned memory is disabled for index buffer as the AMD driver (the only one with pinned memory support) seems
  99. // to be broken. We just get flickering/black rendering when using pinned memory here -- degasus - 2013/08/20
  100. // This bug only happens when paired with base_vertex.
  101. // Please see issue #6105 on Google Code. Let's hope buffer storage solves this issues.
  102. // TODO: Detect broken drivers.
  103. BUG_BROKENPINNEDMEMORY,
  104. // Bug: Entirely broken UBOs
  105. // Affected devices: Qualcomm/Adreno
  106. // Started Version: ? (Noticed on v45)
  107. // Ended Version: 53
  108. // Uniform buffers are entirely broken on Qualcomm drivers with v45
  109. // Trying to use the uniform buffers causes a malloc to fail inside the driver
  110. // To be safe, blanket drivers from v41 - v45
  111. BUG_ANNIHILATEDUBOS,
  112. // Bug : Can't draw on screen text and clear correctly.
  113. // Affected devices: Qualcomm/Adreno
  114. // Started Version: ?
  115. // Ended Version: 53
  116. // Current code for drawing on screen text and clearing the framebuffer doesn't work on Adreno
  117. // Drawing on screen text causes the whole screen to swizzle in a terrible fashion
  118. // Clearing the framebuffer causes one to never see a frame.
  119. BUG_BROKENSWAP,
  120. // Bug: glBufferSubData/glMapBufferRange stalls + OOM
  121. // Affected devices: Adreno a3xx/Mali-t6xx
  122. // Started Version: -1
  123. // Ended Version: -1
  124. // Both Adreno and Mali have issues when you call glBufferSubData or glMapBufferRange
  125. // The driver stalls in each instance no matter what you do
  126. // Apparently Mali and Adreno share code in this regard since it was wrote by the same person.
  127. BUG_BROKENBUFFERSTREAM,
  128. // Bug: GLSL ES 3.0 textureSize causes abort
  129. // Affected devices: Adreno a3xx
  130. // Started Version: -1 (Noticed in v53)
  131. // Ended Version: 66
  132. // If a shader includes a textureSize function call then the shader compiler will call abort()
  133. BUG_BROKENTEXTURESIZE,
  134. // Bug: ARB_buffer_storage doesn't work with ARRAY_BUFFER type streams
  135. // Affected devices: GeForce 4xx+
  136. // Started Version: -1
  137. // Ended Version: 332.21
  138. // The buffer_storage streaming method is required for greater speed gains in our buffer streaming
  139. // It reduces what is needed for streaming to basically a memcpy call
  140. // It seems to work for all buffer types except GL_ARRAY_BUFFER
  141. BUG_BROKENBUFFERSTORAGE,
  142. // Bug: Intel HD 3000 on OS X has broken primitive restart
  143. // Affected devices: Intel HD 3000
  144. // Affected OS: OS X
  145. // Started Version: -1
  146. // Ended Version: -1
  147. // The drivers on OS X has broken primitive restart.
  148. // Intel HD 4000 series isn't affected by the bug
  149. BUG_PRIMITIVERESTART,
  150. // Bug: unsync mapping doesn't work fine
  151. // Affected devices: Nvidia driver
  152. // Started Version: -1
  153. // Ended Version: -1
  154. // The Nvidia driver (both Windows + Linux) doesn't like unsync mapping performance wise.
  155. // Because of their threaded behavior, they seem not to handle unsync mapping complete unsync,
  156. // in fact, they serialize the driver which adds a much bigger overhead.
  157. // Workaround: Use BufferSubData
  158. // TODO: some Windows AMD driver/GPU combination seems also affected
  159. // but as they all support pinned memory, it doesn't matter
  160. BUG_BROKENUNSYNCMAPPING,
  161. // Bug: Intel's Window driver broke buffer_storage with GL_ELEMENT_ARRAY_BUFFER
  162. // Affected devices: Intel (Windows)
  163. // Started Version: 15.36.3.64.3907 (10.18.10.3907)
  164. // Ended Version: 15.36.7.64.3960 (10.18.10.3960)
  165. // Intel implemented buffer_storage in their GL 4.3 driver.
  166. // It works for all the buffer types we use except GL_ELEMENT_ARRAY_BUFFER.
  167. // Causes complete blackscreen issues.
  168. BUG_INTELBROKENBUFFERSTORAGE,
  169. // Bug: Qualcomm has broken attributeless rendering
  170. // Affected devices: Adreno
  171. // Started Version: -1
  172. // Ended Version: v66 (07-09-2014 dev version), v95 shipping
  173. // Qualcomm has had attributeless rendering broken forever
  174. // This was fixed in a v66 development version, the first shipping driver version with the release was v95.
  175. // To be safe, make v95 the minimum version to work around this issue
  176. BUG_BROKENATTRIBUTELESS,
  177. // Bug: Qualcomm has broken boolean negation
  178. // Affected devices: Adreno
  179. // Started Version: -1
  180. // Ended Version: -1
  181. // Qualcomm has the boolean negation broken in their shader compiler
  182. // Instead of inverting the boolean value it does a binary negation on the full 32bit register
  183. // This causes a compare against zero to fail in their shader since it is no longer a 0 or 1 value
  184. // but 0xFFFFFFFF or 0xFFFFFFFE depending on what the boolean value was before the negation.
  185. //
  186. // This bug has a secondary issue tied to it unlike other bugs.
  187. // The correction of this bug is to check the boolean value against false which results in us
  188. // not doing a negation of the source but instead checking against the boolean value we want.
  189. // The issue with this is that Intel's Window driver is broken when checking if a boolean value is
  190. // equal to true or false, so one has to do a boolean negation of the source
  191. //
  192. // eg.
  193. // Broken on Qualcomm
  194. // Works on Windows Intel
  195. // if (!cond)
  196. //
  197. // Works on Qualcomm
  198. // Broken on Windows Intel
  199. // if (cond == false)
  200. BUG_BROKENNEGATEDBOOLEAN,
  201. // Bug: Qualcomm has broken ivec to scalar and ivec to ivec bitshifts
  202. // Affected devices: Adreno
  203. // Started Version: -1
  204. // Ended Version: 46 (TODO: Test more devices, the real end is currently unknown)
  205. // Qualcomm has broken integer vector to integer bitshifts, and integer vector to integer vector bitshifts
  206. // A compilation error is generated when trying to compile the shaders.
  207. //
  208. // For example:
  209. // Broken on Qualcomm:
  210. // ivec4 ab = ivec4(1,1,1,1);
  211. // ab <<= 2;
  212. //
  213. // Working on Qualcomm:
  214. // ivec4 ab = ivec4(1,1,1,1);
  215. // ab.x <<= 2;
  216. // ab.y <<= 2;
  217. // ab.z <<= 2;
  218. // ab.w <<= 2;
  219. //
  220. // Broken on Qualcomm:
  221. // ivec4 ab = ivec4(1,1,1,1);
  222. // ivec4 cd = ivec4(1,2,3,4);
  223. // ab <<= cd;
  224. //
  225. // Working on Qualcomm:
  226. // ivec4 ab = ivec4(1,1,1,1);
  227. // ivec4 cd = ivec4(1,2,3,4);
  228. // ab.x <<= cd.x;
  229. // ab.y <<= cd.y;
  230. // ab.z <<= cd.z;
  231. // ab.w <<= cd.w;
  232. BUG_BROKENIVECSHIFTS,
  233. };
  234. // Initializes our internal vendor, device family, and driver version
  235. void Init(Vendor vendor, Driver driver, const double version, const s32 family);
  236. // Once Vendor and driver version is set, this will return if it has the applicable bug passed to it.
  237. bool HasBug(Bug bug);
  238. }