mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 02:33:43 +01:00
Centralize handling of another GPU flag
This commit is contained in:
1 parent
d2f1193afc
commit
ebc564a465
11 files changed
+13
-19
No files matched your search
@@ -342,6 +342,7 @@ D3D11DrawContext::D3D11DrawContext(ComPtr<ID3D11Device> device, ComPtr<ID3D11Dev
|
||||
caps_.fragmentShaderStencilWriteSupported = false;
|
||||
caps_.blendMinMaxSupported = true;
|
||||
caps_.multiSampleLevelsMask = 1; // More could be supported with some work.
|
||||
caps_.samplerLodControl = true;
|
||||
|
||||
caps_.provokingVertexLast = false; // D3D has it first, unfortunately. (and no way to change it).
|
||||
|
||||
|
||||
@@ -566,6 +566,7 @@ OpenGLContext::OpenGLContext(bool canChangeSwapInterval) : renderManager_(frameT
|
||||
if (gl_extensions.range[1][5][1] >= 30) {
|
||||
caps_.fragmentShaderInt32Supported = true;
|
||||
}
|
||||
caps_.samplerLodControl = true;
|
||||
}
|
||||
caps_.texture3DSupported = gl_extensions.GLES3 || gl_extensions.OES_texture_3D;
|
||||
caps_.textureDepthSupported = gl_extensions.GLES3 || gl_extensions.OES_depth_texture;
|
||||
@@ -576,6 +577,7 @@ OpenGLContext::OpenGLContext(bool canChangeSwapInterval) : renderManager_(frameT
|
||||
caps_.preferredDepthBufferFormat = DataFormat::D24_S8;
|
||||
caps_.texture3DSupported = true;
|
||||
caps_.textureDepthSupported = true;
|
||||
caps_.samplerLodControl = true;
|
||||
}
|
||||
|
||||
caps_.maxTextureSize = gl_extensions.maxTextureSize;
|
||||
|
||||
@@ -952,6 +952,7 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread)
|
||||
caps_.multiViewSupported = vulkan->GetDeviceFeatures().enabled.multiview.multiview != 0;
|
||||
caps_.sampleRateShadingSupported = vulkan->GetDeviceFeatures().enabled.standard.sampleRateShading != 0;
|
||||
caps_.textureSwizzleSupported = true;
|
||||
caps_.samplerLodControl = true;
|
||||
|
||||
// Note that it must also be enabled on the pipelines (which we do).
|
||||
caps_.provokingVertexLast = vulkan->GetDeviceFeatures().enabled.provokingVertex.provokingVertexLast;
|
||||
|
||||
@@ -636,6 +636,7 @@ struct DeviceCaps {
|
||||
bool provokingVertexLast; // GL behavior, what the PSP does
|
||||
bool verySlowShaderCompiler;
|
||||
bool fullScreenExclusiveSupported;
|
||||
bool samplerLodControl;
|
||||
|
||||
// Old style, for older GL or Direct3D 9.
|
||||
u32 clipPlanesSupported;
|
||||
|
||||
@@ -2798,7 +2798,7 @@ bool TextureCacheCommon::PrepareBuildTexture(BuildTexturePlan &plan, TexCacheEnt
|
||||
int lastW = gstate.getTextureWidth(i - 1);
|
||||
int lastH = gstate.getTextureHeight(i - 1);
|
||||
|
||||
if (gstate_c.Use(GPU_USE_TEXTURE_LOD_CONTROL)) {
|
||||
if (gstate_c.Use(GPU_USE_SAMPLER_LOD_CONTROL)) {
|
||||
if (tw != 1 && tw != (lastW >> 1))
|
||||
plan.badMipSizes = true;
|
||||
else if (th != 1 && th != (lastH >> 1))
|
||||
|
||||
@@ -81,8 +81,6 @@ GPU_D3D11::~GPU_D3D11() {}
|
||||
u32 GPU_D3D11::CheckGPUFeatures() const {
|
||||
u32 features = GPUCommonHW::CheckGPUFeatures();
|
||||
|
||||
features |= GPU_USE_TEXTURE_LOD_CONTROL;
|
||||
|
||||
uint32_t fmt4444 = draw_->GetDataFormatSupport(Draw::DataFormat::A4R4G4B4_UNORM_PACK16);
|
||||
uint32_t fmt1555 = draw_->GetDataFormatSupport(Draw::DataFormat::A1R5G5B5_UNORM_PACK16);
|
||||
uint32_t fmt565 = draw_->GetDataFormatSupport(Draw::DataFormat::R5G6B5_UNORM_PACK16);
|
||||
|
||||
@@ -131,10 +131,6 @@ u32 GPU_GLES::CheckGPUFeatures() const {
|
||||
|
||||
features |= GPU_USE_16BIT_FORMATS;
|
||||
|
||||
if (gl_extensions.GLES3 || !gl_extensions.IsGLES) {
|
||||
features |= GPU_USE_TEXTURE_LOD_CONTROL;
|
||||
}
|
||||
|
||||
if (!draw_->GetShaderLanguageDesc().bitwiseOps) {
|
||||
features |= GPU_USE_FRAGMENT_TEST_CACHE;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ static constexpr GLuint MagFiltGL[2] = {
|
||||
};
|
||||
|
||||
void TextureCacheGLES::ApplySamplingParams(const SamplerCacheKey &key) {
|
||||
if (gstate_c.Use(GPU_USE_TEXTURE_LOD_CONTROL)) {
|
||||
if (gstate_c.Use(GPU_USE_SAMPLER_LOD_CONTROL)) {
|
||||
float minLod = (float)key.minLevel / 256.0f;
|
||||
float maxLod = (float)key.maxLevel / 256.0f;
|
||||
float lodBias = (float)key.lodBias / 256.0f;
|
||||
@@ -264,7 +264,7 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!gstate_c.Use(GPU_USE_TEXTURE_LOD_CONTROL)) {
|
||||
if (!gstate_c.Use(GPU_USE_SAMPLER_LOD_CONTROL)) {
|
||||
// If the mip chain is not full..
|
||||
if (plan.levelsToCreate != plan.maxPossibleLevels) {
|
||||
// We need to avoid creating mips at all, or generate them all - can't be incomplete
|
||||
|
||||
+4
-2
@@ -596,6 +596,10 @@ u32 GPUCommonHW::CheckGPUFeatures() const {
|
||||
features |= GPU_USE_DEPTH_TEXTURE;
|
||||
}
|
||||
|
||||
if (draw_->GetDeviceCaps().samplerLodControl) {
|
||||
features |= GPU_USE_SAMPLER_LOD_CONTROL;
|
||||
}
|
||||
|
||||
if (draw_->GetDeviceCaps().framebufferFetchSupported) {
|
||||
features |= GPU_USE_FRAMEBUFFER_FETCH;
|
||||
features |= GPU_USE_SHADER_BLENDING; // doesn't matter if we are buffered or not here.
|
||||
@@ -622,7 +626,6 @@ u32 GPUCommonHW::CheckGPUFeatures() const {
|
||||
|
||||
u32 GPUCommonHW::CheckGPUFeaturesLate(u32 features) const {
|
||||
// If we already have a 16-bit depth buffer, we don't need to round.
|
||||
bool prefer24 = draw_->GetDeviceCaps().preferredDepthBufferFormat == Draw::DataFormat::D24_S8;
|
||||
bool prefer16 = draw_->GetDeviceCaps().preferredDepthBufferFormat == Draw::DataFormat::D16;
|
||||
if (!prefer16) {
|
||||
if (PSP_CoreParameter().compat.flags().PixelDepthRounding) {
|
||||
@@ -632,7 +635,6 @@ u32 GPUCommonHW::CheckGPUFeaturesLate(u32 features) const {
|
||||
features |= GPU_ROUND_DEPTH_TO_16BIT;
|
||||
}
|
||||
}
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -478,7 +478,7 @@ enum : u32 {
|
||||
// Free bit: 10-12
|
||||
GPU_USE_16BIT_FORMATS = FLAG_BIT(13),
|
||||
GPU_USE_DEPTH_CLAMP = FLAG_BIT(14),
|
||||
GPU_USE_TEXTURE_LOD_CONTROL = FLAG_BIT(15),
|
||||
GPU_USE_SAMPLER_LOD_CONTROL = FLAG_BIT(15),
|
||||
GPU_USE_DEPTH_TEXTURE = FLAG_BIT(16),
|
||||
// Free bit: 17
|
||||
// Free bit: 18
|
||||
|
||||
@@ -208,13 +208,6 @@ u32 GPU_Vulkan::CheckGPUFeatures() const {
|
||||
features |= GPU_USE_PRE_ROTATION;
|
||||
}
|
||||
|
||||
// Might enable this later - in the first round we are mostly looking at depth/stencil/discard.
|
||||
// if (!g_Config.bEnableVendorBugChecks)
|
||||
// features |= GPU_USE_ACCURATE_DEPTH;
|
||||
|
||||
// Mandatory features on Vulkan, which may be checked in "centralized" code
|
||||
features |= GPU_USE_TEXTURE_LOD_CONTROL;
|
||||
|
||||
if (!draw_->GetBugs().Has(Draw::Bugs::PVR_BAD_16BIT_TEXFORMATS)) {
|
||||
// These are VULKAN_4444_FORMAT and friends.
|
||||
// Note that we are now using the correct set of formats - the only cases where some may be missing
|
||||
|
||||
Reference in new issue
Block a user