mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add query for max texture size
This commit is contained in:
1 parent
553ee27629
commit
1efcaafd5a
6 files changed
+38
-2
No files matched your search
@@ -298,6 +298,26 @@ D3D11DrawContext::D3D11DrawContext(ComPtr<ID3D11Device> device, ComPtr<ID3D11Dev
|
||||
|
||||
caps_.coordConvention = CoordConvention::Direct3D11;
|
||||
|
||||
switch (featureLevel_) {
|
||||
case D3D_FEATURE_LEVEL_11_1:
|
||||
case D3D_FEATURE_LEVEL_11_0:
|
||||
caps_.maxTextureSize = 16384;
|
||||
break;
|
||||
case D3D_FEATURE_LEVEL_10_1:
|
||||
case D3D_FEATURE_LEVEL_10_0:
|
||||
caps_.maxTextureSize = 8192;
|
||||
break;
|
||||
case D3D_FEATURE_LEVEL_9_3:
|
||||
caps_.maxTextureSize = 4096;
|
||||
break;
|
||||
case D3D_FEATURE_LEVEL_9_2:
|
||||
case D3D_FEATURE_LEVEL_9_1:
|
||||
default:
|
||||
caps_.maxTextureSize = 2048;
|
||||
break;
|
||||
}
|
||||
caps_.maxClipPlanes = 8;
|
||||
|
||||
// Seems like a fair approximation...
|
||||
caps_.dualSourceBlend = featureLevel_ >= D3D_FEATURE_LEVEL_10_0;
|
||||
caps_.depthClampSupported = featureLevel_ >= D3D_FEATURE_LEVEL_10_0;
|
||||
|
||||
@@ -204,14 +204,19 @@ bool CheckGLExtensions() {
|
||||
|
||||
strncpy(gl_extensions.model, renderer, sizeof(gl_extensions.model));
|
||||
gl_extensions.model[sizeof(gl_extensions.model) - 1] = 0;
|
||||
|
||||
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_extensions.maxTextureSize);
|
||||
#ifndef USING_GLES2
|
||||
glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_extensions.maxClipPlanes);
|
||||
#endif
|
||||
|
||||
// Start by assuming we're at 2.0.
|
||||
int parsed[2] = {2, 0};
|
||||
{ // Grab the version and attempt to parse.
|
||||
char buffer[128] = { 0 };
|
||||
strncpy(buffer, versionStr, sizeof(buffer) - 1);
|
||||
|
||||
int len = (int)strlen(buffer);
|
||||
const int len = (int)strlen(buffer);
|
||||
bool beforeDot = true;
|
||||
int lastDigit = 0;
|
||||
for (int i = 0; i < len; i++) {
|
||||
|
||||
@@ -44,6 +44,9 @@ struct GLExtensions {
|
||||
bool IsCoreContext;
|
||||
bool GLES3; // true if the full OpenGL ES 3.0 is supported
|
||||
|
||||
int maxTextureSize;
|
||||
int maxClipPlanes;
|
||||
|
||||
// OES
|
||||
bool OES_depth24;
|
||||
bool OES_packed_depth_stencil;
|
||||
|
||||
@@ -578,6 +578,8 @@ OpenGLContext::OpenGLContext(bool canChangeSwapInterval) : renderManager_(frameT
|
||||
caps_.textureDepthSupported = true;
|
||||
}
|
||||
|
||||
caps_.maxTextureSize = gl_extensions.maxTextureSize;
|
||||
caps_.maxClipPlanes = gl_extensions.IsGLES ? 0 : gl_extensions.maxClipPlanes;
|
||||
caps_.coordConvention = CoordConvention::OpenGL;
|
||||
caps_.setMaxFrameLatencySupported = true;
|
||||
caps_.dualSourceBlend = gl_extensions.ARB_blend_func_extended || gl_extensions.EXT_blend_func_extended;
|
||||
|
||||
@@ -919,6 +919,9 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread)
|
||||
caps_.dualSourceBlend = vulkan->GetDeviceFeatures().enabled.standard.dualSrcBlend != 0;
|
||||
caps_.depthClampSupported = vulkan->GetDeviceFeatures().enabled.standard.depthClamp != 0;
|
||||
|
||||
caps_.maxTextureSize = vulkan->GetPhysicalDeviceProperties().properties.limits.maxImageDimension2D;
|
||||
caps_.maxClipPlanes = vulkan->GetPhysicalDeviceProperties().properties.limits.maxClipDistances;
|
||||
|
||||
// Comment out these two to test geometry shader culling on any geometry shader-supporting hardware.
|
||||
caps_.clipDistanceSupported = vulkan->GetDeviceFeatures().enabled.standard.shaderClipDistance != 0;
|
||||
caps_.cullDistanceSupported = vulkan->GetDeviceFeatures().enabled.standard.shaderCullDistance != 0;
|
||||
|
||||
@@ -593,6 +593,9 @@ struct DeviceCaps {
|
||||
GPUVendor vendor;
|
||||
uint32_t deviceID; // use caution!
|
||||
|
||||
uint32_t maxTextureSize; // largest side.
|
||||
uint32_t maxClipPlanes;
|
||||
|
||||
CoordConvention coordConvention;
|
||||
DataFormat preferredDepthBufferFormat;
|
||||
DataFormat preferredShadowMapFormatLow;
|
||||
|
||||
Reference in new issue
Block a user