mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
mesa/st: add st_GetSparseTextureVirtualPageSize interface
For ARB_sparse_texture implementation. 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:
parent
c7c5f9e168
commit
482fe76300
2 changed files with 18 additions and 0 deletions
|
|
@ -3709,3 +3709,18 @@ st_MakeImageHandleResident(struct gl_context *ctx, GLuint64 handle,
|
|||
|
||||
pipe->make_image_handle_resident(pipe, handle, access, resident);
|
||||
}
|
||||
|
||||
GLboolean
|
||||
st_GetSparseTextureVirtualPageSize(struct gl_context *ctx,
|
||||
GLenum target, mesa_format format,
|
||||
unsigned index, int *x, int *y, int *z)
|
||||
{
|
||||
struct st_context *st = st_context(ctx);
|
||||
struct pipe_screen *screen = st->screen;
|
||||
enum pipe_texture_target ptarget = gl_target_to_pipe(target);
|
||||
enum pipe_format pformat = st_mesa_format_to_pipe_format(st, format);
|
||||
|
||||
/* Get an XYZ page size combination specified by index. */
|
||||
return !!screen->get_sparse_texture_virtual_page_size(
|
||||
screen, ptarget, pformat, index, 1, x, y, z);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,4 +136,7 @@ GLuint64 st_NewImageHandle(struct gl_context *ctx, struct gl_image_unit *imgObj)
|
|||
void st_DeleteImageHandle(struct gl_context *ctx, GLuint64 handle);
|
||||
void st_MakeImageHandleResident(struct gl_context *ctx, GLuint64 handle,
|
||||
GLenum access, bool resident);
|
||||
GLboolean st_GetSparseTextureVirtualPageSize(struct gl_context *ctx,
|
||||
GLenum target, mesa_format format,
|
||||
unsigned index, int *x, int *y, int *z);
|
||||
#endif /* ST_CB_TEXTURE_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue