mesa/st: move query memory info to direct call
Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>
This commit is contained in:
@@ -961,13 +961,6 @@ struct dd_function_table {
|
||||
const GLuint *group_size);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Query information about memory. Device memory is e.g. VRAM. Staging
|
||||
* memory is e.g. GART. All sizes are in kilobytes.
|
||||
*/
|
||||
void (*QueryMemoryInfo)(struct gl_context *ctx,
|
||||
struct gl_memory_info *info);
|
||||
|
||||
/**
|
||||
* Indicate that this thread is being used by Mesa as a background drawing
|
||||
* thread for the given GL context.
|
||||
|
||||
+2
-1
@@ -44,6 +44,7 @@
|
||||
#include "version.h"
|
||||
|
||||
#include "state_tracker/st_cb_queryobj.h"
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
/* This is a table driven implemetation of the glGet*v() functions.
|
||||
* The basic idea is that most getters just look up an int somewhere
|
||||
@@ -1240,7 +1241,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
|
||||
{
|
||||
struct gl_memory_info info;
|
||||
|
||||
ctx->Driver.QueryMemoryInfo(ctx, &info);
|
||||
st_query_memory_info(ctx, &info);
|
||||
|
||||
if (d->pname == GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX)
|
||||
v->value_int = info.total_device_memory;
|
||||
|
||||
@@ -106,11 +106,7 @@ st_Enable(struct gl_context *ctx, GLenum cap)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called via ctx->Driver.QueryMemoryInfo()
|
||||
*/
|
||||
static void
|
||||
void
|
||||
st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out)
|
||||
{
|
||||
struct pipe_screen *screen = st_context(ctx)->screen;
|
||||
@@ -963,7 +959,6 @@ st_init_driver_functions(struct pipe_screen *screen,
|
||||
functions->EmitStringMarker = st_emit_string_marker;
|
||||
|
||||
functions->UpdateState = st_invalidate_state;
|
||||
functions->QueryMemoryInfo = st_query_memory_info;
|
||||
functions->SetBackgroundContext = st_set_background_context;
|
||||
functions->GetDriverUuid = st_get_driver_uuid;
|
||||
functions->GetDeviceUuid = st_get_device_uuid;
|
||||
|
||||
@@ -454,6 +454,7 @@ struct st_framebuffer
|
||||
};
|
||||
|
||||
void st_Enable(struct gl_context *ctx, GLenum cap);
|
||||
void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user