mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #10215 from OatmealDome/shader-logic-ops
VideoCommon: Support shader logic ops on Metal (Apple GPUs) and OpenGL ES
This commit is contained in:
@ -50,9 +50,13 @@ static const char SHADER_HEADER[] = R"(
|
||||
#define SAMPLER_BINDING(x) layout(set = 1, binding = x)
|
||||
#define TEXEL_BUFFER_BINDING(x) layout(set = 1, binding = (x + 8))
|
||||
#define SSBO_BINDING(x) layout(set = 2, binding = x)
|
||||
#define INPUT_ATTACHMENT_BINDING(x, y, z) layout(set = x, binding = y, input_attachment_index = z)
|
||||
#define VARYING_LOCATION(x) layout(location = x)
|
||||
#define FORCE_EARLY_Z layout(early_fragment_tests) in
|
||||
|
||||
// Metal framebuffer fetch helpers.
|
||||
#define FB_FETCH_VALUE subpassLoad(in_ocol0)
|
||||
|
||||
// hlsl to glsl function translation
|
||||
#define API_VULKAN 1
|
||||
#define float2 vec2
|
||||
|
@ -286,7 +286,7 @@ void VulkanContext::PopulateBackendInfo(VideoConfig* config)
|
||||
config->backend_info.bSupportsBPTCTextures = false; // Dependent on features.
|
||||
config->backend_info.bSupportsLogicOp = false; // Dependent on features.
|
||||
config->backend_info.bSupportsLargePoints = false; // Dependent on features.
|
||||
config->backend_info.bSupportsFramebufferFetch = false; // No support.
|
||||
config->backend_info.bSupportsFramebufferFetch = false; // Dependent on OS and features.
|
||||
config->backend_info.bSupportsCoarseDerivatives = true; // Assumed support.
|
||||
config->backend_info.bSupportsTextureQueryLevels = true; // Assumed support.
|
||||
}
|
||||
@ -340,6 +340,15 @@ void VulkanContext::PopulateBackendInfoFeatures(VideoConfig* config, VkPhysicalD
|
||||
properties.limits.pointSizeRange[0] <= 1.0f &&
|
||||
properties.limits.pointSizeRange[1] >= 16;
|
||||
|
||||
std::string device_name = properties.deviceName;
|
||||
u32 vendor_id = properties.vendorID;
|
||||
|
||||
// Only Apple family GPUs support framebuffer fetch.
|
||||
if (vendor_id == 0x106B || device_name.find("Apple") != std::string::npos)
|
||||
{
|
||||
config->backend_info.bSupportsFramebufferFetch = true;
|
||||
}
|
||||
|
||||
// Our usage of primitive restart appears to be broken on AMD's binary drivers.
|
||||
// Seems to be fine on GCN Gen 1-2, unconfirmed on GCN Gen 3, causes driver resets on GCN Gen 4.
|
||||
if (DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVE_RESTART))
|
||||
|
Reference in New Issue
Block a user