v3d: get rid of shader_state pointer in v3d_key
Having this pointer in the key is undesirable since it makes copying keys difficult and error prone (as seen in previous patches), also, it is only there for convenience and we don't strictly need it (in fact the vulkan driver doesn't use it at all), so let's just get rid of it so our v3d_key is fully static. Reviewed-by: Juan A. Suarez <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25418>
This commit is contained in:

committed by
Marge Bot

parent
3fb9e27a3d
commit
4afbf4ad31
@@ -392,29 +392,7 @@ static inline uint8_t v3d_slot_get_component(struct v3d_varying_slot slot)
|
||||
return slot.slot_and_component & 3;
|
||||
}
|
||||
|
||||
/* Given a v3d_key start address, skips over the 'void *'
|
||||
* shader_state pointer to get the 'static' portion of the
|
||||
* key.
|
||||
*/
|
||||
static inline uint8_t *
|
||||
v3d_key_static_addr(const void *key_addr)
|
||||
{
|
||||
return ((uint8_t *)key_addr) + sizeof(void*);
|
||||
}
|
||||
|
||||
/* Returns the size of the key adjusted to the static
|
||||
* portion.
|
||||
*/
|
||||
static inline uint32_t
|
||||
v3d_key_static_size(uint32_t key_size)
|
||||
{
|
||||
return key_size - sizeof(void *);
|
||||
}
|
||||
|
||||
struct v3d_key {
|
||||
/* Keep this field first */
|
||||
void *shader_state;
|
||||
|
||||
struct {
|
||||
uint8_t swizzle[4];
|
||||
} tex[V3D_MAX_TEXTURE_SAMPLERS];
|
||||
|
Reference in New Issue
Block a user