nvk: Avoid strict aliasing warning in the pushbuffer encoding.
authorEmma Anholt <emma@anholt.net>
Sun, 11 Sep 2022 05:19:57 +0000 (22:19 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:59 +0000 (21:31 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/nvidia-headers/class_parser.py
src/nouveau/nvidia-headers/meson.build

index 132633a..4a3510b 100644 (file)
@@ -47,6 +47,7 @@ TEMPLATE_H = Template("""\
 #include "${clheader}"
 
 #include <assert.h>
+#include "util/u_math.h"
 
 %for mthd in mthddict:
 struct nv_${nvcl.lower()}_${mthd} {
@@ -190,7 +191,7 @@ P_DUMP_${nvcl}_MTHD_DATA(uint16_t idx, uint32_t data, const char *prefix)
         }
     %else:
       %if mthddict[mthd].is_float:
-        printf("%ff (0x%x)${bs}n", *(float *)&parsed, parsed);
+        printf("%ff (0x%x)${bs}n", uif(parsed), parsed);
       %else:
         printf("(0x%x)${bs}n", parsed);
       %endif
index efbb5cf..5b87354 100644 (file)
@@ -35,7 +35,7 @@ endforeach
 _libnvidia_headers = static_library(
   'nvidia_headers',
   cl_generated,
-  include_directories : ['.', 'classes'],
+  include_directories : ['.', 'classes', inc_include, inc_src],
   c_args : [no_override_init_args],
   gnu_symbol_visibility : 'hidden',
 )