diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index 2759f246e03..7da11b07351 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -270,7 +270,6 @@ typedef bool (*tc_is_resource_busy)(struct pipe_screen *screen, struct threaded_resource { struct pipe_resource b; - const struct u_resource_vtbl *vtbl; /* Since buffer invalidations are queued, we can't use the base resource * for unsychronized mappings. This points to the latest version of diff --git a/src/gallium/auxiliary/util/u_transfer.h b/src/gallium/auxiliary/util/u_transfer.h index ce041f53eed..9673fa715ce 100644 --- a/src/gallium/auxiliary/util/u_transfer.h +++ b/src/gallium/auxiliary/util/u_transfer.h @@ -2,9 +2,6 @@ #ifndef U_TRANSFER_H #define U_TRANSFER_H -/* Fallback implementations for inline read/writes which just go back - * to the regular transfer behaviour. - */ #include "pipe/p_state.h" struct pipe_context; @@ -32,16 +29,8 @@ void u_default_transfer_flush_region( struct pipe_context *pipe, struct pipe_transfer *transfer, const struct pipe_box *box); -/* Useful helper to allow >1 implementation of resource functionality - * to exist in a single driver. This is intended to be transitionary! - */ -struct u_resource_vtbl { -}; - - struct u_resource { struct pipe_resource b; - const struct u_resource_vtbl *vtbl; }; #ifdef __cplusplus diff --git a/src/gallium/drivers/i915/i915_resource.h b/src/gallium/drivers/i915/i915_resource.h index 743608165fc..b53a87eb012 100644 --- a/src/gallium/drivers/i915/i915_resource.h +++ b/src/gallium/drivers/i915/i915_resource.h @@ -91,20 +91,17 @@ unsigned i915_texture_offset(const struct i915_texture *tex, void i915_init_screen_resource_functions(struct i915_screen *is); void i915_init_resource_functions(struct i915_context *i915); -extern struct u_resource_vtbl i915_buffer_vtbl; -extern struct u_resource_vtbl i915_texture_vtbl; - static inline struct i915_texture *i915_texture(struct pipe_resource *resource) { struct i915_texture *tex = (struct i915_texture *)resource; - assert(tex->b.vtbl == &i915_texture_vtbl); + assert(tex->b.b.target != PIPE_BUFFER); return tex; } static inline struct i915_buffer *i915_buffer(struct pipe_resource *resource) { struct i915_buffer *tex = (struct i915_buffer *)resource; - assert(tex->b.vtbl == &i915_buffer_vtbl); + assert(tex->b.b.target == PIPE_BUFFER); return tex; } diff --git a/src/gallium/drivers/i915/i915_resource_buffer.c b/src/gallium/drivers/i915/i915_resource_buffer.c index 94781eacf1f..2c9e7540694 100644 --- a/src/gallium/drivers/i915/i915_resource_buffer.c +++ b/src/gallium/drivers/i915/i915_resource_buffer.c @@ -109,13 +109,6 @@ i915_buffer_subdata(struct pipe_context *rm_ctx, memcpy(buffer->data + offset, data, size); } - -struct u_resource_vtbl i915_buffer_vtbl = -{ -}; - - - struct pipe_resource * i915_buffer_create(struct pipe_screen *screen, const struct pipe_resource *template) @@ -126,7 +119,6 @@ i915_buffer_create(struct pipe_screen *screen, return NULL; buf->b.b = *template; - buf->b.vtbl = &i915_buffer_vtbl; pipe_reference_init(&buf->b.b.reference, 1); buf->b.b.screen = screen; buf->data = align_malloc(template->width0, 64); @@ -156,7 +148,6 @@ i915_user_buffer_create(struct pipe_screen *screen, return NULL; pipe_reference_init(&buf->b.b.reference, 1); - buf->b.vtbl = &i915_buffer_vtbl; buf->b.b.screen = screen; buf->b.b.format = PIPE_FORMAT_R8_UNORM; /* ?? */ buf->b.b.usage = PIPE_USAGE_IMMUTABLE; diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c index bdfdeae44c5..0fa4e60fda1 100644 --- a/src/gallium/drivers/i915/i915_resource_texture.c +++ b/src/gallium/drivers/i915/i915_resource_texture.c @@ -893,11 +893,6 @@ out: } #endif -struct u_resource_vtbl i915_texture_vtbl = -{ -}; - - struct pipe_resource * i915_texture_create(struct pipe_screen *screen, const struct pipe_resource *template, @@ -912,7 +907,6 @@ i915_texture_create(struct pipe_screen *screen, return NULL; tex->b.b = *template; - tex->b.vtbl = &i915_texture_vtbl; pipe_reference_init(&tex->b.b.reference, 1); tex->b.b.screen = screen; @@ -985,7 +979,6 @@ i915_texture_from_handle(struct pipe_screen * screen, return NULL; tex->b.b = *template; - tex->b.vtbl = &i915_texture_vtbl; pipe_reference_init(&tex->b.b.reference, 1); tex->b.b.screen = screen; diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c index 05fc506797e..284525086d0 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -652,10 +652,6 @@ nouveau_resource_map_offset(struct nouveau_context *nv, return (uint8_t *)res->bo->map + res->offset + offset; } -const struct u_resource_vtbl nouveau_buffer_vtbl = -{ -}; - static void * nouveau_user_ptr_transfer_map(struct pipe_context *pipe, struct pipe_resource *resource, @@ -679,10 +675,6 @@ nouveau_user_ptr_transfer_unmap(struct pipe_context *pipe, FREE(tx); } -const struct u_resource_vtbl nouveau_user_ptr_buffer_vtbl = -{ -}; - struct pipe_resource * nouveau_buffer_create(struct pipe_screen *pscreen, const struct pipe_resource *templ) @@ -696,7 +688,6 @@ nouveau_buffer_create(struct pipe_screen *pscreen, return NULL; buffer->base = *templ; - buffer->vtbl = &nouveau_buffer_vtbl; pipe_reference_init(&buffer->base.reference, 1); buffer->base.screen = pscreen; @@ -763,7 +754,6 @@ nouveau_buffer_create_from_user(struct pipe_screen *pscreen, return NULL; buffer->base = *templ; - buffer->vtbl = &nouveau_user_ptr_buffer_vtbl; /* set address and data to the same thing for higher compatibility with * existing code. It's correct nonetheless as the same pointer is equally * valid on the CPU and the GPU. @@ -789,7 +779,6 @@ nouveau_user_buffer_create(struct pipe_screen *pscreen, void *ptr, return NULL; pipe_reference_init(&buffer->base.reference, 1); - buffer->vtbl = &nouveau_buffer_vtbl; buffer->base.screen = pscreen; buffer->base.format = PIPE_FORMAT_R8_UNORM; buffer->base.usage = PIPE_USAGE_IMMUTABLE; diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.h b/src/gallium/drivers/nouveau/nouveau_buffer.h index 7a3429ea06a..fa687941006 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.h +++ b/src/gallium/drivers/nouveau/nouveau_buffer.h @@ -33,7 +33,6 @@ struct nouveau_bo; */ struct nv04_resource { struct pipe_resource base; - const struct u_resource_vtbl *vtbl; uint64_t address; /* virtual address (nv50+) */ diff --git a/src/gallium/drivers/nouveau/nv30/nv30_miptree.c b/src/gallium/drivers/nouveau/nv30/nv30_miptree.c index f7f4fd38454..1c8acaf731f 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_miptree.c @@ -402,9 +402,6 @@ nv30_miptree_transfer_unmap(struct pipe_context *pipe, FREE(tx); } -const struct u_resource_vtbl nv30_miptree_vtbl = { -}; - struct pipe_resource * nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_resource *tmpl) @@ -434,7 +431,6 @@ nv30_miptree_create(struct pipe_screen *pscreen, break; } - mt->base.vtbl = &nv30_miptree_vtbl; *pt = *tmpl; pipe_reference_init(&pt->reference, 1); pt->screen = pscreen; @@ -534,7 +530,6 @@ nv30_miptree_from_handle(struct pipe_screen *pscreen, } mt->base.base = *tmpl; - mt->base.vtbl = &nv30_miptree_vtbl; pipe_reference_init(&mt->base.base.reference, 1); mt->base.base.screen = pscreen; mt->uniform_pitch = stride; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c index ad22bc2578e..8f45d9e659f 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c @@ -202,10 +202,6 @@ nv50_miptree_get_handle(struct pipe_screen *pscreen, whandle); } -const struct u_resource_vtbl nv50_miptree_vtbl = -{ -}; - static inline bool nv50_miptree_init_ms_mode(struct nv50_miptree *mt) { @@ -347,7 +343,6 @@ nv50_miptree_create(struct pipe_screen *pscreen, if (!mt) return NULL; - mt->base.vtbl = &nv50_miptree_vtbl; *pt = *templ; pipe_reference_init(&pt->reference, 1); pt->screen = pscreen; @@ -434,7 +429,6 @@ nv50_miptree_from_handle(struct pipe_screen *pscreen, mt->base.address = mt->base.bo->offset; mt->base.base = *templ; - mt->base.vtbl = &nv50_miptree_vtbl; pipe_reference_init(&mt->base.base.reference, 1); mt->base.base.screen = pscreen; mt->level[0].pitch = stride; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c index 70e167d1c49..e0a9d48249f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c @@ -436,10 +436,6 @@ nvc0_miptree_select_best_modifier(struct pipe_screen *pscreen, return prio_supported_mods[top_mod_slot]; } -const struct u_resource_vtbl nvc0_miptree_vtbl = -{ -}; - struct pipe_resource * nvc0_miptree_create(struct pipe_screen *pscreen, const struct pipe_resource *templ, @@ -459,7 +455,6 @@ nvc0_miptree_create(struct pipe_screen *pscreen, if (!mt) return NULL; - mt->base.vtbl = &nvc0_miptree_vtbl; *pt = *templ; pipe_reference_init(&pt->reference, 1); pt->screen = pscreen; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c index 10001174448..afe8dd7d429 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c @@ -122,8 +122,6 @@ nvc0_resource_from_handle(struct pipe_screen * screen, } else { struct pipe_resource *res = nv50_miptree_from_handle(screen, templ, whandle); - if (res) - nv04_resource(res)->vtbl = &nvc0_miptree_vtbl; return res; } } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h index c507134d1b1..a281d427c94 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h @@ -60,8 +60,6 @@ nvc0_miptree_get_handle(struct pipe_screen *pscreen, struct winsys_handle *whandle, unsigned usage); -extern const struct u_resource_vtbl nvc0_miptree_vtbl; - struct pipe_surface * nvc0_miptree_surface_new(struct pipe_context *, struct pipe_resource *, diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index ee51073e7da..b067b34832b 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -161,10 +161,6 @@ void r300_buffer_transfer_unmap( struct pipe_context *pipe, slab_free(&r300->pool_transfers, transfer); } -static const struct u_resource_vtbl r300_buffer_vtbl = -{ -}; - struct pipe_resource *r300_buffer_create(struct pipe_screen *screen, const struct pipe_resource *templ) { @@ -174,7 +170,6 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen, rbuf = MALLOC_STRUCT(r300_resource); rbuf->b.b = *templ; - rbuf->b.vtbl = &r300_buffer_vtbl; pipe_reference_init(&rbuf->b.b.reference, 1); rbuf->b.b.screen = screen; rbuf->domain = RADEON_DOMAIN_GTT; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 0e9b97f8fb1..0883a47d051 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -1040,10 +1040,6 @@ bool r300_resource_get_handle(struct pipe_screen* screen, return rws->buffer_get_handle(rws, tex->buf, whandle); } -static const struct u_resource_vtbl r300_texture_vtbl = -{ -}; - /* The common texture constructor. */ static struct r300_resource* r300_texture_create_object(struct r300_screen *rscreen, @@ -1067,7 +1063,6 @@ r300_texture_create_object(struct r300_screen *rscreen, tex->b.b.usage = base->usage; tex->b.b.bind = base->bind; tex->b.b.flags = base->flags; - tex->b.vtbl = &r300_texture_vtbl; tex->tex.microtile = microtile; tex->tex.macrotile[0] = macrotile; tex->tex.stride_in_bytes_override = stride_in_bytes_override; @@ -1197,8 +1192,6 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, whandle->stride, buffer); } -/* Not required to implement u_resource_vtbl, consider moving to another file: - */ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx, struct pipe_resource* texture, const struct pipe_surface *surf_tmpl, @@ -1283,8 +1276,6 @@ struct pipe_surface* r300_create_surface(struct pipe_context * ctx, texture->height0); } -/* Not required to implement u_resource_vtbl, consider moving to another file: - */ void r300_surface_destroy(struct pipe_context *ctx, struct pipe_surface* s) { pipe_resource_reference(&s->texture, NULL); diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index cd309d500d9..98ca81470b5 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -1315,10 +1315,6 @@ void r600_compute_global_buffer_destroy(struct pipe_screen *screen, free(res); } -static const struct u_resource_vtbl r600_global_buffer_vtbl = -{ -}; - struct pipe_resource *r600_compute_global_buffer_create(struct pipe_screen *screen, const struct pipe_resource *templ) { @@ -1340,7 +1336,6 @@ struct pipe_resource *r600_compute_global_buffer_create(struct pipe_screen *scre COMPUTE_DBG(rscreen, "width = %u array_size = %u\n", templ->width0, templ->array_size); - result->base.b.vtbl = &r600_global_buffer_vtbl; result->base.b.b = *templ; result->base.b.b.screen = screen; result->base.compute_global_bo = true; diff --git a/src/gallium/drivers/r600/r600_buffer_common.c b/src/gallium/drivers/r600/r600_buffer_common.c index 2a4bcc0d758..ba645298f81 100644 --- a/src/gallium/drivers/r600/r600_buffer_common.c +++ b/src/gallium/drivers/r600/r600_buffer_common.c @@ -571,10 +571,6 @@ void r600_buffer_subdata(struct pipe_context *ctx, r600_buffer_transfer_unmap(ctx, transfer); } -static const struct u_resource_vtbl r600_buffer_vtbl = -{ -}; - static struct r600_resource * r600_alloc_buffer_struct(struct pipe_screen *screen, const struct pipe_resource *templ) @@ -588,7 +584,6 @@ r600_alloc_buffer_struct(struct pipe_screen *screen, pipe_reference_init(&rbuffer->b.b.reference, 1); rbuffer->b.b.screen = screen; - rbuffer->b.vtbl = &r600_buffer_vtbl; threaded_resource_init(&rbuffer->b.b); rbuffer->buf = NULL; diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index d1caf7abc74..0c34a8db4e0 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -589,8 +589,6 @@ void r600_texture_destroy(struct pipe_screen *screen, struct pipe_resource *ptex FREE(rtex); } -static const struct u_resource_vtbl r600_texture_vtbl; - /* The number of samples can be specified independently of the texture. */ void r600_texture_get_fmask_info(struct r600_common_screen *rscreen, struct r600_texture *rtex, @@ -915,7 +913,6 @@ r600_texture_create_object(struct pipe_screen *screen, resource = &rtex->resource; resource->b.b = *base; - resource->b.vtbl = &r600_texture_vtbl; pipe_reference_init(&resource->b.b.reference, 1); resource->b.b.screen = screen; @@ -1518,10 +1515,6 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx, FREE(transfer); } -static const struct u_resource_vtbl r600_texture_vtbl = -{ -}; - struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe, struct pipe_resource *texture, const struct pipe_surface *templ, diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 1cfe9891355..e3292538136 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -568,9 +568,6 @@ static void si_buffer_subdata(struct pipe_context *ctx, struct pipe_resource *bu si_buffer_transfer_unmap(ctx, transfer); } -static const struct u_resource_vtbl si_buffer_vtbl = { -}; - static struct si_resource *si_alloc_buffer_struct(struct pipe_screen *screen, const struct pipe_resource *templ) { @@ -583,7 +580,6 @@ static struct si_resource *si_alloc_buffer_struct(struct pipe_screen *screen, pipe_reference_init(&buf->b.b.reference, 1); buf->b.b.screen = screen; - buf->b.vtbl = &si_buffer_vtbl; threaded_resource_init(&buf->b.b); buf->buf = NULL; diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index d20bc3424bd..201bd27829b 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -784,8 +784,6 @@ static bool si_texture_get_handle(struct pipe_screen *screen, struct pipe_contex return sscreen->ws->buffer_get_handle(sscreen->ws, res->buf, whandle); } -static const struct u_resource_vtbl si_texture_vtbl; - void si_print_texture_info(struct si_screen *sscreen, struct si_texture *tex, struct u_log_context *log) { @@ -898,7 +896,6 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen, resource = &tex->buffer; resource->b.b = *base; - resource->b.vtbl = &si_texture_vtbl; pipe_reference_init(&resource->b.b.reference, 1); resource->b.b.screen = screen; @@ -1431,12 +1428,9 @@ si_texture_create_with_modifiers(struct pipe_screen *screen, return si_texture_create_with_modifier(screen, templ, modifier); } -static const struct u_resource_vtbl si_auxiliary_texture_vtbl = { -}; - static bool si_texture_is_aux_plane(const struct pipe_resource *resource) { - return ((struct threaded_resource*)resource)->vtbl == &si_auxiliary_texture_vtbl; + return resource->flags & SI_RESOURCE_AUX_PLANE; } static struct pipe_resource *si_texture_from_winsys_buffer(struct si_screen *sscreen, @@ -1581,7 +1575,6 @@ static struct pipe_resource *si_texture_from_handle(struct pipe_screen *screen, return NULL; tex->b.b = *templ; tex->b.b.flags |= SI_RESOURCE_AUX_PLANE; - tex->b.vtbl = &si_auxiliary_texture_vtbl; tex->stride = whandle->stride; tex->offset = whandle->offset; tex->buffer = buf; @@ -1918,9 +1911,6 @@ static void si_texture_transfer_unmap(struct pipe_context *ctx, struct pipe_tran FREE(transfer); } -static const struct u_resource_vtbl si_texture_vtbl = { -}; - /* Return if it's allowed to reinterpret one format as another with DCC enabled. */ bool vi_dcc_formats_compatible(struct si_screen *sscreen, enum pipe_format format1, diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c index 53830a6ad86..26b226300d9 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.c +++ b/src/gallium/drivers/svga/svga_resource_buffer.c @@ -453,13 +453,6 @@ svga_resource_destroy(struct pipe_screen *screen, } } - -struct u_resource_vtbl svga_buffer_vtbl = -{ -}; - - - struct pipe_resource * svga_buffer_create(struct pipe_screen *screen, const struct pipe_resource *template) @@ -475,7 +468,6 @@ svga_buffer_create(struct pipe_screen *screen, goto error1; sbuf->b.b = *template; - sbuf->b.vtbl = &svga_buffer_vtbl; pipe_reference_init(&sbuf->b.b.reference, 1); sbuf->b.b.screen = screen; bind_flags = template->bind & ~PIPE_BIND_CUSTOM; @@ -571,7 +563,6 @@ svga_user_buffer_create(struct pipe_screen *screen, goto no_sbuf; pipe_reference_init(&sbuf->b.b.reference, 1); - sbuf->b.vtbl = &svga_buffer_vtbl; sbuf->b.b.screen = screen; sbuf->b.b.format = PIPE_FORMAT_R8_UNORM; /* ?? */ sbuf->b.b.usage = PIPE_USAGE_IMMUTABLE; diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h index 35ee1f59c5e..f04ba2c0cf4 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.h +++ b/src/gallium/drivers/svga/svga_resource_buffer.h @@ -47,9 +47,6 @@ struct svga_context; struct svga_winsys_buffer; struct svga_winsys_surface; - -extern struct u_resource_vtbl svga_buffer_vtbl; - struct svga_buffer_range { unsigned start; @@ -233,7 +230,7 @@ static inline struct svga_buffer * svga_buffer(struct pipe_resource *resource) { struct svga_buffer *buf = (struct svga_buffer *) resource; - assert(buf == NULL || buf->b.vtbl == &svga_buffer_vtbl); + assert(buf == NULL || buf->b.b.target == PIPE_BUFFER); return buf; } diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 4766ff8fc6e..c7330fc4f89 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -840,12 +840,6 @@ format_has_depth(enum pipe_format format) return util_format_has_depth(desc); } - -struct u_resource_vtbl svga_texture_vtbl = -{ -}; - - struct pipe_resource * svga_texture_create(struct pipe_screen *screen, const struct pipe_resource *template) @@ -920,7 +914,6 @@ svga_texture_create(struct pipe_screen *screen, } tex->b.b = *template; - tex->b.vtbl = &svga_texture_vtbl; pipe_reference_init(&tex->b.b.reference, 1); tex->b.b.screen = screen; @@ -1179,7 +1172,6 @@ svga_texture_from_handle(struct pipe_screen *screen, goto out_no_defined; tex->b.b = *template; - tex->b.vtbl = &svga_texture_vtbl; pipe_reference_init(&tex->b.b.reference, 1); tex->b.b.screen = screen; diff --git a/src/gallium/drivers/svga/svga_resource_texture.h b/src/gallium/drivers/svga/svga_resource_texture.h index e942e5f8937..27c2f08fac6 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.h +++ b/src/gallium/drivers/svga/svga_resource_texture.h @@ -43,10 +43,6 @@ enum SVGA3dSurfaceFormat; #define SVGA_MAX_TEXTURE_LEVELS 16 - -extern struct u_resource_vtbl svga_texture_vtbl; - - struct svga_texture { struct u_resource b; @@ -159,7 +155,7 @@ static inline struct svga_texture * svga_texture(struct pipe_resource *resource) { struct svga_texture *tex = (struct svga_texture *)resource; - assert(tex == NULL || tex->b.vtbl == &svga_texture_vtbl); + assert(tex == NULL || tex->b.b.target != PIPE_BUFFER); return tex; } diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c index 74029612320..039a45f539a 100644 --- a/src/gallium/drivers/virgl/virgl_buffer.c +++ b/src/gallium/drivers/virgl/virgl_buffer.c @@ -76,11 +76,6 @@ void virgl_buffer_transfer_flush_region(struct pipe_context *ctx, util_range_add(transfer->resource, &trans->range, box->x, box->x + box->width); } -static const struct u_resource_vtbl virgl_buffer_vtbl = -{ -}; - void virgl_buffer_init(struct virgl_resource *res) { - res->u.vtbl = &virgl_buffer_vtbl; } diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c index 48ebf298053..b4de039f93a 100644 --- a/src/gallium/drivers/virgl/virgl_texture.c +++ b/src/gallium/drivers/virgl/virgl_texture.c @@ -302,11 +302,6 @@ void virgl_texture_transfer_unmap(struct pipe_context *ctx, } } -static const struct u_resource_vtbl virgl_texture_vtbl = -{ -}; - void virgl_texture_init(struct virgl_resource *res) { - res->u.vtbl = &virgl_texture_vtbl; }