Permalink
Browse files

Merge pull request #11712 from hrydgard/gles-detect-vivante-gpu

GLES: Detect Vivante GPU, disable vertex range culling
  • Loading branch information...
hrydgard committed Jan 3, 2019
2 parents 12e54ba + 12f295c commit 99c8423ede0512703ab0cf5db064f74c71edc664
@@ -147,7 +147,10 @@ void GPU_GLES::CheckGPUFeatures() {
u32 features = 0;

features |= GPU_SUPPORTS_16BIT_FORMATS;
features |= GPU_SUPPORTS_VS_RANGE_CULLING;

if (!draw_->GetBugs().Has(Draw::Bugs::BROKEN_NAN_IN_CONDITIONAL)) {
features |= GPU_SUPPORTS_VS_RANGE_CULLING;
}

if (gl_extensions.ARB_blend_func_extended || gl_extensions.EXT_blend_func_extended) {
if (!g_Config.bVendorBugChecksEnabled || !draw_->GetBugs().Has(Draw::Bugs::DUAL_SOURCE_BLENDING_BROKEN)) {
@@ -159,6 +159,8 @@ void CheckGLExtensions() {
} else if (vendor == "Broadcom") {
gl_extensions.gpuVendor = GPU_VENDOR_BROADCOM;
// Just for reference: Galaxy Y has renderer == "VideoCore IV HW"
} else if (vendor == "Vivante Corporation") {
gl_extensions.gpuVendor = GPU_VENDOR_VIVANTE;
} else {
gl_extensions.gpuVendor = GPU_VENDOR_UNKNOWN;
}
@@ -15,9 +15,11 @@ enum {
GPU_VENDOR_IMGTEC = 5,
GPU_VENDOR_QUALCOMM = 6,
GPU_VENDOR_BROADCOM = 7,
GPU_VENDOR_VIVANTE = 8,
GPU_VENDOR_UNKNOWN = 0,
};

// TODO: Move to Draw::Bugs
enum {
BUG_FBO_UNUSABLE = 1,
BUG_PVR_SHADER_PRECISION_BAD = 2,
@@ -234,6 +234,7 @@ enum class GPUVendor {
VENDOR_QUALCOMM,
VENDOR_IMGTEC, // PowerVR
VENDOR_BROADCOM, // Raspberry
VENDOR_VIVANTE,
};

enum class NativeObject {
@@ -329,6 +330,7 @@ class Bugs {
DUAL_SOURCE_BLENDING_BROKEN = 1,
ANY_MAP_BUFFER_RANGE_SLOW = 2,
PVR_GENMIPMAP_HEIGHT_GREATER = 3,
BROKEN_NAN_IN_CONDITIONAL = 4,
};

protected:
@@ -453,6 +453,7 @@ class OpenGLContext : public DrawContext {
case GPUVendor::VENDOR_QUALCOMM: return "VENDOR_ADRENO";
case GPUVendor::VENDOR_ARM: return "VENDOR_ARM";
case GPUVendor::VENDOR_BROADCOM: return "VENDOR_BROADCOM";
case GPUVendor::VENDOR_VIVANTE: return "VENDOR_VIVANTE";
case GPUVendor::VENDOR_UNKNOWN:
default:
return "VENDOR_UNKNOWN";
@@ -545,6 +546,7 @@ OpenGLContext::OpenGLContext() {
case GPU_VENDOR_BROADCOM: caps_.vendor = GPUVendor::VENDOR_BROADCOM; break;
case GPU_VENDOR_INTEL: caps_.vendor = GPUVendor::VENDOR_INTEL; break;
case GPU_VENDOR_IMGTEC: caps_.vendor = GPUVendor::VENDOR_IMGTEC; break;
case GPU_VENDOR_VIVANTE: caps_.vendor = GPUVendor::VENDOR_VIVANTE; break;
case GPU_VENDOR_UNKNOWN:
default:
caps_.vendor = GPUVendor::VENDOR_UNKNOWN;
@@ -567,6 +569,8 @@ OpenGLContext::OpenGLContext() {
bugs_.Infest(Bugs::DUAL_SOURCE_BLENDING_BROKEN);
}
}
} else if (caps_.vendor == GPUVendor::VENDOR_VIVANTE) {
bugs_.Infest(Bugs::BROKEN_NAN_IN_CONDITIONAL);
}

// TODO: Make this check more lenient. Disabled for all right now

0 comments on commit 99c8423

Please sign in to comment.