diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 8f1ad3032d..cf1ca9229b 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -338,7 +338,6 @@ D3D11DrawContext::D3D11DrawContext(ComPtr device, ComPtrcanWrap) { - if (tex->wrapS != c.textureSampler.wrapS) { - glTexParameteri(tex->target, GL_TEXTURE_WRAP_S, c.textureSampler.wrapS); - tex->wrapS = c.textureSampler.wrapS; - } - if (tex->wrapT != c.textureSampler.wrapT) { - glTexParameteri(tex->target, GL_TEXTURE_WRAP_T, c.textureSampler.wrapT); - tex->wrapT = c.textureSampler.wrapT; - } + if (tex->wrapS != c.textureSampler.wrapS) { + glTexParameteri(tex->target, GL_TEXTURE_WRAP_S, c.textureSampler.wrapS); + tex->wrapS = c.textureSampler.wrapS; + } + if (tex->wrapT != c.textureSampler.wrapT) { + glTexParameteri(tex->target, GL_TEXTURE_WRAP_T, c.textureSampler.wrapT); + tex->wrapT = c.textureSampler.wrapT; } CHECK_GL_ERROR_IF_DEBUG(); if (tex->magFilter != c.textureSampler.magFilter) { diff --git a/Common/GPU/OpenGL/GLRenderManager.cpp b/Common/GPU/OpenGL/GLRenderManager.cpp index 14dd54e8d3..5b9e6b7da2 100644 --- a/Common/GPU/OpenGL/GLRenderManager.cpp +++ b/Common/GPU/OpenGL/GLRenderManager.cpp @@ -20,11 +20,6 @@ std::thread::id renderThreadId; GLRTexture::GLRTexture(const Draw::DeviceCaps &caps, int width, int height, int depth, int numMips) { - if (caps.textureNPOTFullySupported) { - canWrap = true; - } else { - canWrap = isPowerOf2(width) && isPowerOf2(height); - } w = width; h = height; d = depth; diff --git a/Common/GPU/OpenGL/GLRenderManager.h b/Common/GPU/OpenGL/GLRenderManager.h index 6c97169634..547f6bd204 100644 --- a/Common/GPU/OpenGL/GLRenderManager.h +++ b/Common/GPU/OpenGL/GLRenderManager.h @@ -45,7 +45,6 @@ public: GLenum magFilter = 0xFFFF; GLenum minFilter = 0xFFFF; uint8_t numMips = 0; - bool canWrap = true; float anisotropy = -100000.0f; float minLod = -1000.0f; float maxLod = 1000.0f; diff --git a/Common/GPU/OpenGL/thin3d_gl.cpp b/Common/GPU/OpenGL/thin3d_gl.cpp index 64e7e2235f..7eab85ade5 100644 --- a/Common/GPU/OpenGL/thin3d_gl.cpp +++ b/Common/GPU/OpenGL/thin3d_gl.cpp @@ -594,11 +594,6 @@ OpenGLContext::OpenGLContext(bool canChangeSwapInterval) : renderManager_(frameT caps_.maxClipDistances = gl_extensions.maxClipDistances; caps_.maxCullDistances = gl_extensions.maxCullDistances; - caps_.textureNPOTFullySupported = - (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(2, 0, 0)) || - gl_extensions.IsCoreContext || gl_extensions.GLES3 || - gl_extensions.ARB_texture_non_power_of_two || gl_extensions.OES_texture_npot; - if (gl_extensions.IsGLES) { caps_.fragmentShaderDepthWriteSupported = gl_extensions.GLES3; // There's also GL_EXT_frag_depth but it's rare along with 2.0. Most chips that support it are simply 3.0 chips. @@ -1262,15 +1257,8 @@ void OpenGLContext::ApplySamplers() { } else { continue; } - GLenum wrapS; - GLenum wrapT; - if (tex->canWrap) { - wrapS = samp->wrapU; - wrapT = samp->wrapV; - } else { - wrapS = GL_CLAMP_TO_EDGE; - wrapT = GL_CLAMP_TO_EDGE; - } + GLenum wrapS = samp->wrapU; + GLenum wrapT = samp->wrapV; GLenum magFilt = samp->magFilt; GLenum minFilt = tex->numMips > 1 ? samp->mipMinFilt : samp->minFilt; renderManager_.SetTextureSampler(i, wrapS, wrapT, magFilt, minFilt, 0.0f); diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index 93ce8ca9bf..6278e82043 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -942,7 +942,6 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread) caps_.texture3DSupported = true; caps_.textureDepthSupported = true; caps_.fragmentShaderInt32Supported = true; - caps_.textureNPOTFullySupported = true; caps_.fragmentShaderDepthWriteSupported = true; caps_.fragmentShaderStencilWriteSupported = vulkan->Extensions().EXT_shader_stencil_export; caps_.blendMinMaxSupported = true; diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index a4f2081579..9458df4137 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -621,7 +621,6 @@ struct DeviceCaps { bool framebufferFetchSupported; bool texture3DSupported; bool fragmentShaderInt32Supported; - bool textureNPOTFullySupported; bool fragmentShaderDepthWriteSupported; bool fragmentShaderStencilWriteSupported; bool textureDepthSupported; diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index a5216d548b..67e9e99732 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -1323,14 +1323,6 @@ bool TextureCacheCommon::GetCurrentFramebufferTextureDebug(GPUDebugBuffer &buffe void TextureCacheCommon::NotifyConfigChanged() { int scaleFactor = g_Config.iTexScalingLevel; - if (!gstate_c.Use(GPU_USE_TEXTURE_NPOT)) { - // Reduce the scale factor to a power of two (e.g. 2 or 4) if textures must be a power of two. - // TODO: In addition we should probably remove these options from the UI in this case. - while ((scaleFactor & (scaleFactor - 1)) != 0) { - --scaleFactor; - } - } - // Just in case, small display with auto resolution or something. if (scaleFactor <= 0) { scaleFactor = 1; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 302861fdfd..22edfd2a4c 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -583,9 +583,6 @@ u32 GPUCommonHW::CheckGPUFeatures() const { if (draw_->GetDeviceCaps().anisoSupported) { features |= GPU_USE_ANISOTROPY; } - if (draw_->GetDeviceCaps().textureNPOTFullySupported) { - features |= GPU_USE_TEXTURE_NPOT; - } if (draw_->GetDeviceCaps().dualSourceBlend) { if (!g_Config.bVendorBugChecksEnabled || !draw_->GetBugs().Has(Draw::Bugs::DUAL_SOURCE_BLENDING_BROKEN)) { features |= GPU_USE_DUALSOURCE_BLEND; diff --git a/GPU/GPUState.h b/GPU/GPUState.h index 5f9f19b788..25eb866939 100644 --- a/GPU/GPUState.h +++ b/GPU/GPUState.h @@ -466,7 +466,7 @@ enum { GPU_USE_BLEND_MINMAX = FLAG_BIT(4), GPU_USE_LOGIC_OP = FLAG_BIT(5), GPU_USE_FRAGMENT_UBERSHADER = FLAG_BIT(6), - GPU_USE_TEXTURE_NPOT = FLAG_BIT(7), + // Free bit: 7 GPU_USE_ANISOTROPY = FLAG_BIT(8), GPU_USE_CLEAR_RAM_HACK = FLAG_BIT(9), GPU_USE_INSTANCE_RENDERING = FLAG_BIT(10), diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index b16e2a0125..c789a09a55 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -597,11 +597,6 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings) return !g_Config.bSoftwareRendering && !UsingHardwareTextureScaling(); }); PopupMultiChoice *texScalingChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iTexScalingLevel, gr->T("Upscale Level"), texScaleLevels, 1, ARRAY_SIZE(texScaleLevels), I18NCat::GRAPHICS, screenManager())); - // TODO: Better check? When it won't work, it scales down anyway. - if (!gl_extensions.OES_texture_npot && GetGPUBackend() == GPUBackend::OPENGL) { - texScalingChoice->HideChoice(3); // 3x - texScalingChoice->HideChoice(5); // 5x - } graphicsSettings->Add(new SettingHint(gr->T("UpscaleLevel Tip", "CPU heavy - some scaling may be delayed to avoid stutter"), texScalingChoice)); texScalingChoice->SetEnabledFunc([]() { diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index 89831211ca..9e8deff68a 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -1143,13 +1143,8 @@ namespace MainWindow { CheckMenuItem(menu, texscalingitems[i], MF_BYCOMMAND | (selected ? MF_CHECKED : MF_UNCHECKED)); } - if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL && !gl_extensions.OES_texture_npot) { - EnableMenuItem(menu, ID_TEXTURESCALING_3X, MF_GRAYED); - EnableMenuItem(menu, ID_TEXTURESCALING_5X, MF_GRAYED); - } else { - EnableMenuItem(menu, ID_TEXTURESCALING_3X, MF_ENABLED); - EnableMenuItem(menu, ID_TEXTURESCALING_5X, MF_ENABLED); - } + EnableMenuItem(menu, ID_TEXTURESCALING_3X, MF_ENABLED); + EnableMenuItem(menu, ID_TEXTURESCALING_5X, MF_ENABLED); static const int texscalingtypeitems[] = { ID_TEXTURESCALING_XBRZ,