From 3cfa04b5cf566e3c47b395b19ab551a2dc5c6918 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 30 Dec 2013 19:26:10 +0000 Subject: VertexShaderManager: Remove a hardcoded projection hack. --- Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 5ec371a0ba..ca90077bc1 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -411,9 +411,10 @@ void VertexShaderManager::SetConstants() g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[13] = 0.0f; - // donkopunchstania: GC GPU rounds differently? - // -(1 + epsilon) so objects are clipped as they are on the real HW - g_fProjectionMatrix[14] = -1.00000011921f; + // donkopunchstania suggested the GC GPU might round differently + // He had thus changed this to -(1 + epsilon) to fix clipping issues. + // I (neobrain) don't think his conjecture is true and thus reverted his change. + g_fProjectionMatrix[14] = -1.0f; g_fProjectionMatrix[15] = 0.0f; SETSTAT_FT(stats.gproj_0, g_fProjectionMatrix[0]); -- cgit v1.2.3 From 3aa0a63fe636e59a770ad7ec02a728c599545f23 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 23 Nov 2013 22:06:56 +0100 Subject: VertexShaderGen: Remove Sonic Unleashed hack. Doesn't seem to be required anymore. Either way, even if it's still needed for anything, this is not the correct way to fix the issue. --- Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 78b3c57dda..f0cce5d750 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -411,13 +411,6 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ // divide out.Write("o.pos.z = o.pos.w + o.pos.z * 2.0;\n"); - // Sonic Unleashed puts its final rendering at the near or - // far plane of the viewing frustrum(actually box, they use - // orthogonal projection for that), and we end up putting it - // just beyond, and the rendering gets clipped away. (The - // primitive gets dropped) - out.Write("o.pos.z = o.pos.z * 1048575.0/1048576.0;\n"); - // the next steps of the OGL pipeline are: // (x_c,y_c,z_c,w_c) = o.pos //switch to OGL spec terminology // clipping to -w_c <= (x_c,y_c,z_c) <= w_c -- cgit v1.2.3 From 6d63db96e962586b13ad343e26182f9e7be7cc2b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Mon, 30 Dec 2013 18:26:55 -0600 Subject: Disable primitive restart on buggy OS X Intel HD 3000 drivers. --- Source/Core/VideoCommon/Src/DriverDetails.cpp | 35 +++++++++++++++------------ Source/Core/VideoCommon/Src/DriverDetails.h | 10 +++++++- 2 files changed, 29 insertions(+), 16 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/Src/DriverDetails.cpp b/Source/Core/VideoCommon/Src/DriverDetails.cpp index 64e8810d20..027908442f 100644 --- a/Source/Core/VideoCommon/Src/DriverDetails.cpp +++ b/Source/Core/VideoCommon/Src/DriverDetails.cpp @@ -14,6 +14,7 @@ namespace DriverDetails u32 m_os; // Which OS has the issue Vendor m_vendor; // Which vendor has the error Driver m_driver; // Which driver has the error + s32 m_family; // Which family of hardware has the issue Bug m_bug; // Which bug it is double m_versionstart; // When it started double m_versionend; // When it ended @@ -33,34 +34,37 @@ namespace DriverDetails Vendor m_vendor = VENDOR_UNKNOWN; Driver m_driver = DRIVER_UNKNOWN; + s32 m_family = 0.0; double m_version = 0.0; // This is a list of all known bugs for each vendor // We use this to check if the device and driver has a issue BugInfo m_known_bugs[] = { - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_NODYNUBOACCESS, 14.0, 46.0, true}, - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENCENTROID, 14.0, 46.0, true}, - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENINFOLOG, -1.0, 46.0, true}, - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_ANNIHILATEDUBOS, 41.0, 46.0, true}, - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENSWAP, -1.0, 46.0, true}, - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true}, - {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, BUG_BROKENTEXTURESIZE, -1.0, -1.0, true}, - {OS_ALL, VENDOR_ARM, DRIVER_ARM_T6XX, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true}, - {OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENUBO, 900, 916, true}, - {OS_ALL, VENDOR_MESA, DRIVER_R600, BUG_BROKENUBO, 900, 913, true}, - {OS_ALL, VENDOR_MESA, DRIVER_I965, BUG_BROKENUBO, 900, 920, true}, - {OS_ALL, VENDOR_ATI, DRIVER_ATI, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true}, - {OS_LINUX, VENDOR_ATI, DRIVER_ATI, BUG_BROKENPINNEDMEMORY, -1.0, -1.0, true}, - {OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_NODYNUBOACCESS, 14.0, 46.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENCENTROID, 14.0, 46.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENINFOLOG, -1.0, 46.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_ANNIHILATEDUBOS, 41.0, 46.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENSWAP, -1.0, 46.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true}, + {OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM_3XX, -1, BUG_BROKENTEXTURESIZE, -1.0, -1.0, true}, + {OS_ALL, VENDOR_ARM, DRIVER_ARM_T6XX, -1, BUG_BROKENBUFFERSTREAM, -1.0, -1.0, true}, + {OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, -1, BUG_BROKENUBO, 900, 916, true}, + {OS_ALL, VENDOR_MESA, DRIVER_R600, -1, BUG_BROKENUBO, 900, 913, true}, + {OS_ALL, VENDOR_MESA, DRIVER_I965, -1, BUG_BROKENUBO, 900, 920, true}, + {OS_ALL, VENDOR_ATI, DRIVER_ATI, -1, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true}, + {OS_LINUX, VENDOR_ATI, DRIVER_ATI, -1, BUG_BROKENPINNEDMEMORY, -1.0, -1.0, true}, + {OS_ALL, VENDOR_MESA, DRIVER_NOUVEAU, -1, BUG_BROKENHACKEDBUFFER, -1.0, -1.0, true}, + {OS_OSX, VENDOR_INTEL, DRIVER_INTEL, 3000, BUG_PRIMITIVERESTART, -1.0, -1.0, true}, }; std::map m_bugs; - void Init(Vendor vendor, Driver driver, const double version) + void Init(Vendor vendor, Driver driver, const double version, const s32 family) { m_vendor = vendor; m_driver = driver; m_version = version; + m_family = family; if (driver == DRIVER_UNKNOWN) switch(vendor) @@ -91,6 +95,7 @@ namespace DriverDetails ( bug.m_os & m_os ) && ( bug.m_vendor == m_vendor || bug.m_vendor == VENDOR_ALL ) && ( bug.m_driver == m_driver || bug.m_driver == DRIVER_ALL ) && + ( bug.m_family == m_family || bug.m_family == -1) && ( bug.m_versionstart <= m_version || bug.m_versionstart == -1 ) && ( bug.m_versionend > m_version || bug.m_versionend == -1 ) ) diff --git a/Source/Core/VideoCommon/Src/DriverDetails.h b/Source/Core/VideoCommon/Src/DriverDetails.h index 1b024cefca..ec2fc82a3b 100644 --- a/Source/Core/VideoCommon/Src/DriverDetails.h +++ b/Source/Core/VideoCommon/Src/DriverDetails.h @@ -141,10 +141,18 @@ namespace DriverDetails // Ended Version: -1 // If a shader includes a textureSize function call then the shader compiler will call abort() BUG_BROKENTEXTURESIZE, + // Bug: Intel HD 3000 on OS X has broken primitive restart + // Affected devices: Intel HD 3000 + // Affected OS: OS X + // Started Version: -1 + // Ended Version: -1 + // The drivers on OS X has broken primitive restart. + // Intel HD 4000 series isn't affected by the bug + BUG_PRIMITIVERESTART, }; // Initializes our internal vendor, device family, and driver version - void Init(Vendor vendor, Driver driver, const double version); + void Init(Vendor vendor, Driver driver, const double version, const s32 family); // Once Vendor and driver version is set, this will return if it has the applicable bug passed to it. bool HasBug(Bug bug); -- cgit v1.2.3