mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 10:18:05 +02:00
util: Delete Offset() macro from u_memory.h
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22494>
This commit is contained in:
parent
7706d1cc33
commit
2fbedd442a
3 changed files with 2 additions and 8 deletions
|
|
@ -773,7 +773,7 @@ lp_make_setup_variant_key(const struct llvmpipe_context *lp,
|
|||
key->pixel_center_half = lp->rasterizer->half_pixel_center;
|
||||
key->multisample = lp->rasterizer->multisample;
|
||||
key->twoside = lp->rasterizer->light_twoside;
|
||||
key->size = Offset(struct lp_setup_variant_key, inputs[key->num_inputs]);
|
||||
key->size = offsetof(struct lp_setup_variant_key, inputs[key->num_inputs]);
|
||||
|
||||
key->color_slot = lp->color_slot[0];
|
||||
key->bcolor_slot = lp->bcolor_slot[0];
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ struct geometry_constant {
|
|||
|
||||
#define set_uniform_location(var, field, packed) \
|
||||
do { \
|
||||
unsigned offset = Offset(struct geometry_constant, field); \
|
||||
unsigned offset = offsetof(struct geometry_constant, field); \
|
||||
var->data.driver_location = offset >> (packed ? 2 : 4); \
|
||||
var->data.location_frac = (offset >> 2) & 0x3; \
|
||||
} while (0)
|
||||
|
|
|
|||
|
|
@ -83,12 +83,6 @@ mem_dup(const void *src, size_t size)
|
|||
return dup;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Offset of a field in a struct, in bytes.
|
||||
*/
|
||||
#define Offset(TYPE, MEMBER) ((uintptr_t)&(((TYPE *)NULL)->MEMBER))
|
||||
|
||||
/* TODO: this could be different on non-x86 architectures. */
|
||||
#define CACHE_LINE_SIZE 64
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue