Increase maximum framebuffer size

Legacy SwiftShader GL has a maximum framebuffer size of 8192 width and height. SwiftShader Vulkan's maximum framebuffer size was 4096, but this CL increases it to 8192. An issue was hit by using Chromium with SwANGLE on an iMac Pro 5k screen, where the 4096 limit was insufficient and causing a crash. The viewport max dimensions and bounds range had to be adjusted accordingly. According to the spec: "viewportBoundsRange[2] is the [minimum, maximum] range that the corners of a viewport must be contained in. This range must be at least [-2 × size, 2 × size - 1], where size = max(maxViewportDimensions[0], maxViewportDimensions[1])." Bug: chromium:1209250 Change-Id: I0ef15ccf2433aea348fd7946319ffb3406174873 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/55008Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Commit-Queue: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 663b67f8
...@@ -31,6 +31,8 @@ enum ...@@ -31,6 +31,8 @@ enum
MAX_TEXTURE_LOD = MIPMAP_LEVELS - 2, // Trilinear accesses lod+1 MAX_TEXTURE_LOD = MIPMAP_LEVELS - 2, // Trilinear accesses lod+1
RENDERTARGETS = 8, RENDERTARGETS = 8,
MAX_INTERFACE_COMPONENTS = 32 * 4, // Must be multiple of 4 for 16-byte alignment. MAX_INTERFACE_COMPONENTS = 32 * 4, // Must be multiple of 4 for 16-byte alignment.
MAX_FRAMEBUFFER_DIM = OUTLINE_RESOLUTION,
MAX_VIEWPORT_DIM = MAX_FRAMEBUFFER_DIM,
}; };
} // namespace sw } // namespace sw
......
...@@ -495,8 +495,10 @@ const VkPhysicalDeviceLimits &PhysicalDevice::getLimits() const ...@@ -495,8 +495,10 @@ const VkPhysicalDeviceLimits &PhysicalDevice::getLimits() const
vk::MAX_SAMPLER_LOD_BIAS, // maxSamplerLodBias vk::MAX_SAMPLER_LOD_BIAS, // maxSamplerLodBias
16, // maxSamplerAnisotropy 16, // maxSamplerAnisotropy
16, // maxViewports 16, // maxViewports
{ 4096, 4096 }, // maxViewportDimensions[2] { sw::MAX_VIEWPORT_DIM,
{ -8192, 8191 }, // viewportBoundsRange[2] sw::MAX_VIEWPORT_DIM }, // maxViewportDimensions[2]
{ -2 * sw::MAX_VIEWPORT_DIM,
2 * sw::MAX_VIEWPORT_DIM - 1 }, // viewportBoundsRange[2]
0, // viewportSubPixelBits 0, // viewportSubPixelBits
64, // minMemoryMapAlignment 64, // minMemoryMapAlignment
vk::MIN_TEXEL_BUFFER_OFFSET_ALIGNMENT, // minTexelBufferOffsetAlignment vk::MIN_TEXEL_BUFFER_OFFSET_ALIGNMENT, // minTexelBufferOffsetAlignment
...@@ -509,8 +511,8 @@ const VkPhysicalDeviceLimits &PhysicalDevice::getLimits() const ...@@ -509,8 +511,8 @@ const VkPhysicalDeviceLimits &PhysicalDevice::getLimits() const
-0.5, // minInterpolationOffset -0.5, // minInterpolationOffset
0.5, // maxInterpolationOffset 0.5, // maxInterpolationOffset
4, // subPixelInterpolationOffsetBits 4, // subPixelInterpolationOffsetBits
4096, // maxFramebufferWidth sw::MAX_FRAMEBUFFER_DIM, // maxFramebufferWidth
4096, // maxFramebufferHeight sw::MAX_FRAMEBUFFER_DIM, // maxFramebufferHeight
256, // maxFramebufferLayers 256, // maxFramebufferLayers
sampleCounts, // framebufferColorSampleCounts sampleCounts, // framebufferColorSampleCounts
sampleCounts, // framebufferDepthSampleCounts sampleCounts, // framebufferDepthSampleCounts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment