pan/bi: Add bi_dual_tex_as_u32 helper

Type safe cast, making dual texture descriptors easier to manipulate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13723>
This commit is contained in:
Alyssa Rosenzweig 2021-11-08 14:43:41 -05:00 committed by Marge Bot
parent 9b2a383af8
commit ce8d2b96c1

View File

@ -28,6 +28,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#ifdef __cplusplus
@ -572,6 +573,15 @@ struct bifrost_dual_texture_operation {
unsigned primary_mask : 4;
} __attribute__((packed));
static inline uint32_t
bi_dual_tex_as_u32(struct bifrost_dual_texture_operation desc)
{
uint32_t desc_u;
memcpy(&desc_u, &desc, sizeof(desc));
return desc_u;
}
#define BIFROST_MEGA_SAMPLE 128
#define BIFROST_ALL_SAMPLES 255
#define BIFROST_CURRENT_PIXEL 255