mesa: add ARB_sparse_texture constants

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14223>
This commit is contained in:
Qiang Yu 2021-12-04 11:47:33 +08:00
parent e1cecd8964
commit f3ea79f65e
4 changed files with 22 additions and 0 deletions

View File

@ -582,6 +582,7 @@ EXTRA_EXT(ARB_sample_locations);
EXTRA_EXT(AMD_framebuffer_multisample_advanced);
EXTRA_EXT(ARB_spirv_extensions);
EXTRA_EXT(NV_viewport_swizzle);
EXTRA_EXT(ARB_sparse_texture);
static const int
extra_ARB_color_buffer_float_or_glcore[] = {

View File

@ -957,6 +957,12 @@ descriptor=[
# GL_ARB_color_buffer_float
[ "RGBA_FLOAT_MODE_ARB", "BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), extra_core_ARB_color_buffer_float_and_new_buffers" ],
# GL_ARB_sparse_texture
[ "MAX_SPARSE_TEXTURE_SIZE_ARB", "CONTEXT_INT(Const.MaxSparseTextureSize), extra_ARB_sparse_texture" ],
[ "MAX_SPARSE_3D_TEXTURE_SIZE_ARB", "CONTEXT_INT(Const.MaxSparse3DTextureSize), extra_ARB_sparse_texture" ],
[ "MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB", "CONTEXT_INT(Const.MaxSparseArrayTextureLayers), extra_ARB_sparse_texture" ],
[ "SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB", "CONTEXT_BOOL(Const.SparseTextureFullArrayCubeMipmaps), extra_ARB_sparse_texture" ],
# GL3.0 / GL_EXT_framebuffer_sRGB
[ "FRAMEBUFFER_SRGB_CAPABLE_EXT", "BUFFER_INT(Visual.sRGBCapable), extra_EXT_framebuffer_sRGB_and_new_buffers" ],

View File

@ -4328,6 +4328,12 @@ struct gl_constants
* a frame, but always getting framebuffer completeness.
*/
bool GLThreadNopCheckFramebufferStatus;
/** GL_ARB_sparse_texture */
GLuint MaxSparseTextureSize;
GLuint MaxSparse3DTextureSize;
GLuint MaxSparseArrayTextureLayers;
bool SparseTextureFullArrayCubeMipmaps;
};

View File

@ -638,6 +638,15 @@ void st_init_limits(struct pipe_screen *screen,
c->glBeginEndBufferSize =
screen->get_param(screen, PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE);
c->MaxSparseTextureSize =
screen->get_param(screen, PIPE_CAP_MAX_SPARSE_TEXTURE_SIZE);
c->MaxSparse3DTextureSize =
screen->get_param(screen, PIPE_CAP_MAX_SPARSE_3D_TEXTURE_SIZE);
c->MaxSparseArrayTextureLayers =
screen->get_param(screen, PIPE_CAP_MAX_SPARSE_ARRAY_TEXTURE_LAYERS);
c->SparseTextureFullArrayCubeMipmaps =
screen->get_param(screen, PIPE_CAP_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS);
}