slahmr-test / lib /python3.9 /site-packages /OpenGL /GL /EXT /framebuffer_multisample_blit_scaled.py
| '''OpenGL extension EXT.framebuffer_multisample_blit_scaled | |
| This module customises the behaviour of the | |
| OpenGL.raw.GL.EXT.framebuffer_multisample_blit_scaled to provide a more | |
| Python-friendly API | |
| Overview (from the spec) | |
| This extension relaxes some of the restrictions associated with | |
| multisample resolve operations, specifically to allow a combined | |
| resolve and scale operation through a single call to BlitFramebuffer. | |
| It also adds two new filter types to control the quality of the | |
| combined scaled resolve operation. | |
| In traditional multisampled framebuffer rendering, color samples | |
| must be explicitly resolved via BlitFramebuffer before any other | |
| operation on the resulting pixel values can be performed. This | |
| multisample resolve operation must be done using a BlitFramebuffer | |
| call where the dimensions of the source and destination rectangles | |
| are identical. If the resulting pixel values need to be copied to a | |
| texture with different dimensions, these resolved values can then be | |
| scaled with a second call to BlitFramebuffer. | |
| By requiring two separate calls to BlitFramebuffer, the quality | |
| of final image can be maintained to a certain degree. The samples | |
| are first resolved, and then these resolved values can be filtered | |
| to produce the final image. This image quality comes at the price | |
| of increased memory usage and lower performance. However, the | |
| scaling blit can still introduce artifacts, particularly if it is | |
| done with a simple bilinear filter. | |
| The new filter types introduced by this extension allow the scaled | |
| resolve to be done with a single call to BlitFramebuffer. Not all | |
| samples from the read framebuffer are required to be be used when | |
| producing the final pixel values, and there may be a loss in quality | |
| when compared to an image produced by a separate resolve and scale. | |
| However, the single-pass scaled resolve blit should be faster than | |
| the traditional two-pass resolve then scale blits. | |
| The official definition of this extension is available here: | |
| http://www.opengl.org/registry/specs/EXT/framebuffer_multisample_blit_scaled.txt | |
| ''' | |
| from OpenGL import platform, constant, arrays | |
| from OpenGL import extensions, wrapper | |
| import ctypes | |
| from OpenGL.raw.GL import _types, _glgets | |
| from OpenGL.raw.GL.EXT.framebuffer_multisample_blit_scaled import * | |
| from OpenGL.raw.GL.EXT.framebuffer_multisample_blit_scaled import _EXTENSION_NAME | |
| def glInitFramebufferMultisampleBlitScaledEXT(): | |
| '''Return boolean indicating whether this extension is available''' | |
| from OpenGL import extensions | |
| return extensions.hasGLExtension( _EXTENSION_NAME ) | |
| ### END AUTOGENERATED SECTION |