mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
svga: add mksstats for surface view emulation
Add mksstats for surface view emulation and also tighten the stat CreateBackedView for the actual creation of backed view. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
4f3974d758
commit
5e5d5f1a2e
1 changed files with 17 additions and 10 deletions
|
|
@ -162,7 +162,7 @@ svga_texture_view_surface(struct svga_context *svga,
|
||||||
struct svga_host_surface_cache_key *key) /* OUT */
|
struct svga_host_surface_cache_key *key) /* OUT */
|
||||||
{
|
{
|
||||||
struct svga_screen *ss = svga_screen(svga->pipe.screen);
|
struct svga_screen *ss = svga_screen(svga->pipe.screen);
|
||||||
struct svga_winsys_surface *handle;
|
struct svga_winsys_surface *handle = NULL;
|
||||||
boolean validated;
|
boolean validated;
|
||||||
boolean needCopyResource;
|
boolean needCopyResource;
|
||||||
|
|
||||||
|
|
@ -170,6 +170,8 @@ svga_texture_view_surface(struct svga_context *svga,
|
||||||
"svga: Create surface view: layer %d zslice %d mips %d..%d\n",
|
"svga: Create surface view: layer %d zslice %d mips %d..%d\n",
|
||||||
layer_pick, zslice_pick, start_mip, start_mip+num_mip-1);
|
layer_pick, zslice_pick, start_mip, start_mip+num_mip-1);
|
||||||
|
|
||||||
|
SVGA_STATS_TIME_PUSH(ss->sws, SVGA_STATS_TIME_EMULATESURFACEVIEW);
|
||||||
|
|
||||||
key->flags = flags;
|
key->flags = flags;
|
||||||
key->format = format;
|
key->format = format;
|
||||||
key->numMipLevels = num_mip;
|
key->numMipLevels = num_mip;
|
||||||
|
|
@ -197,7 +199,7 @@ svga_texture_view_surface(struct svga_context *svga,
|
||||||
|
|
||||||
if (key->format == SVGA3D_FORMAT_INVALID) {
|
if (key->format == SVGA3D_FORMAT_INVALID) {
|
||||||
key->cachable = 0;
|
key->cachable = 0;
|
||||||
return NULL;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cacheable && tex->backed_handle &&
|
if (cacheable && tex->backed_handle &&
|
||||||
|
|
@ -218,7 +220,7 @@ svga_texture_view_surface(struct svga_context *svga,
|
||||||
|
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
key->cachable = 0;
|
key->cachable = 0;
|
||||||
return NULL;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
SVGA_DBG(DEBUG_DMA, " --> got sid %p (texture view)\n", handle);
|
SVGA_DBG(DEBUG_DMA, " --> got sid %p (texture view)\n", handle);
|
||||||
|
|
@ -234,6 +236,9 @@ svga_texture_view_surface(struct svga_context *svga,
|
||||||
tex->backed_age = tex->age;
|
tex->backed_age = tex->age;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
SVGA_STATS_TIME_POP(ss->sws);
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -427,18 +432,18 @@ create_backed_surface_view(struct svga_context *svga, struct svga_surface *s)
|
||||||
{
|
{
|
||||||
struct svga_texture *tex = svga_texture(s->base.texture);
|
struct svga_texture *tex = svga_texture(s->base.texture);
|
||||||
|
|
||||||
SVGA_STATS_TIME_PUSH(svga_sws(svga),
|
|
||||||
SVGA_STATS_TIME_CREATEBACKEDSURFACEVIEW);
|
|
||||||
|
|
||||||
if (!s->backed) {
|
if (!s->backed) {
|
||||||
struct pipe_surface *backed_view;
|
struct pipe_surface *backed_view;
|
||||||
|
|
||||||
|
SVGA_STATS_TIME_PUSH(svga_sws(svga),
|
||||||
|
SVGA_STATS_TIME_CREATEBACKEDSURFACEVIEW);
|
||||||
|
|
||||||
backed_view = svga_create_surface_view(&svga->pipe,
|
backed_view = svga_create_surface_view(&svga->pipe,
|
||||||
&tex->b.b,
|
&tex->b.b,
|
||||||
&s->base,
|
&s->base,
|
||||||
TRUE);
|
TRUE);
|
||||||
if (!backed_view)
|
if (!backed_view)
|
||||||
return NULL;
|
goto done;
|
||||||
|
|
||||||
s->backed = svga_surface(backed_view);
|
s->backed = svga_surface(backed_view);
|
||||||
}
|
}
|
||||||
|
|
@ -469,13 +474,15 @@ create_backed_surface_view(struct svga_context *svga, struct svga_surface *s)
|
||||||
bs->key.numMipLevels,
|
bs->key.numMipLevels,
|
||||||
bs->key.numFaces * bs->key.arraySize,
|
bs->key.numFaces * bs->key.arraySize,
|
||||||
zslice, s->base.u.tex.level, layer);
|
zslice, s->base.u.tex.level, layer);
|
||||||
}
|
|
||||||
|
|
||||||
svga_mark_surface_dirty(&s->backed->base);
|
svga_mark_surface_dirty(&s->backed->base);
|
||||||
s->backed->age = tex->age;
|
|
||||||
|
|
||||||
SVGA_STATS_TIME_POP(svga_sws(svga));
|
SVGA_STATS_TIME_POP(svga_sws(svga));
|
||||||
|
}
|
||||||
|
|
||||||
|
s->backed->age = tex->age;
|
||||||
|
|
||||||
|
done:
|
||||||
return s->backed;
|
return s->backed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue