nouveau/push: Add a P_INLINE_FLOAT helper
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:55 +0000 (21:31 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/winsys/nouveau_push.h

index 375a5ad..61c9a76 100644 (file)
@@ -166,6 +166,16 @@ P_INLINE_DATA(struct nouveau_ws_push *push, uint32_t value)
 }
 
 static inline void
+P_INLINE_FLOAT(struct nouveau_ws_push *push, float value)
+{
+   if (nvk_push_update_count(push, 1)) {
+      /* push new value */
+      *(float *)push->map = value;
+      push->map++;
+   }
+}
+
+static inline void
 P_INLINE_ARRAY(struct nouveau_ws_push *push, const uint32_t *data, int num_dw)
 {
    if (nvk_push_update_count(push, num_dw)) {