mesa/st: move memory query into mesa.
Drop the gl_memory_info type as it's equiv to the pipe one, and internal Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
This commit is contained in:
+4
-2
@@ -1247,9 +1247,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
|
||||
case GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX:
|
||||
case GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX:
|
||||
{
|
||||
struct gl_memory_info info;
|
||||
struct pipe_memory_info info;
|
||||
struct pipe_screen *screen = ctx->pipe->screen;
|
||||
|
||||
st_query_memory_info(ctx, &info);
|
||||
assert(screen->query_memory_info);
|
||||
screen->query_memory_info(screen, &info);
|
||||
|
||||
if (d->pname == GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX)
|
||||
v->value_int = info.total_device_memory;
|
||||
|
||||
@@ -3586,19 +3586,6 @@ struct gl_context
|
||||
bool shader_builtin_ref;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about memory usage. All sizes are in kilobytes.
|
||||
*/
|
||||
struct gl_memory_info
|
||||
{
|
||||
unsigned total_device_memory; /**< size of device memory, e.g. VRAM */
|
||||
unsigned avail_device_memory; /**< free device memory at the moment */
|
||||
unsigned total_staging_memory; /**< size of staging memory, e.g. GART */
|
||||
unsigned avail_staging_memory; /**< free staging memory at the moment */
|
||||
unsigned device_memory_evicted; /**< size of memory evicted (monotonic counter) */
|
||||
unsigned nr_device_memory_evictions; /**< # of evictions (monotonic counter) */
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
extern int MESA_VERBOSE;
|
||||
extern int MESA_DEBUG_FLAGS;
|
||||
|
||||
@@ -71,27 +71,6 @@
|
||||
|
||||
DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", FALSE)
|
||||
|
||||
void
|
||||
st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out)
|
||||
{
|
||||
struct pipe_screen *screen = st_context(ctx)->screen;
|
||||
struct pipe_memory_info info;
|
||||
|
||||
assert(screen->query_memory_info);
|
||||
if (!screen->query_memory_info)
|
||||
return;
|
||||
|
||||
screen->query_memory_info(screen, &info);
|
||||
|
||||
out->total_device_memory = info.total_device_memory;
|
||||
out->avail_device_memory = info.avail_device_memory;
|
||||
out->total_staging_memory = info.total_staging_memory;
|
||||
out->avail_staging_memory = info.avail_staging_memory;
|
||||
out->device_memory_evicted = info.device_memory_evicted;
|
||||
out->nr_device_memory_evictions = info.nr_device_memory_evictions;
|
||||
}
|
||||
|
||||
|
||||
static uint64_t
|
||||
st_get_active_states(struct gl_context *ctx)
|
||||
{
|
||||
|
||||
@@ -450,8 +450,6 @@ struct st_framebuffer
|
||||
struct list_head head;
|
||||
};
|
||||
|
||||
void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out);
|
||||
|
||||
void st_invalidate_state(struct gl_context *ctx);
|
||||
void st_set_background_context(struct gl_context *ctx,
|
||||
struct util_queue_monitoring *queue_info);
|
||||
|
||||
Reference in New Issue
Block a user