aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/frontends/nine/nine_pdata.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-12-03 18:01:31 -0500
committerMarek Olšák <[email protected]>2020-05-13 13:46:53 -0400
commitd6287a94b697ffe12a4e576a38943cdf4e90cdb0 (patch)
treebb84357d98dc74412e983693e09875bb355b467e /src/gallium/frontends/nine/nine_pdata.h
parentb408734e5e2fe1e1ef08080c4425ad8a7ed33579 (diff)
gallium: rename 'state tracker' to 'frontend'
Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
Diffstat (limited to 'src/gallium/frontends/nine/nine_pdata.h')
-rw-r--r--src/gallium/frontends/nine/nine_pdata.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/gallium/frontends/nine/nine_pdata.h b/src/gallium/frontends/nine/nine_pdata.h
new file mode 100644
index 00000000000..8c73cd619ba
--- /dev/null
+++ b/src/gallium/frontends/nine/nine_pdata.h
@@ -0,0 +1,46 @@
+
+#ifndef _NINE_PDATA_H_
+#define _NINE_PDATA_H_
+
+struct pheader
+{
+ boolean unknown;
+ GUID guid;
+ DWORD size;
+};
+
+static bool
+ht_guid_compare( const void *a,
+ const void *b )
+{
+ return GUID_equal(a, b);
+}
+
+static uint32_t
+ht_guid_hash( const void *key )
+{
+ unsigned i, hash = 0;
+ const unsigned char *str = key;
+
+ for (i = 0; i < sizeof(GUID); i++) {
+ hash = (unsigned)(str[i]) + (hash << 6) + (hash << 16) - hash;
+ }
+
+ return hash;
+}
+
+static enum pipe_error
+ht_guid_delete( void *key,
+ void *value,
+ void *data )
+{
+ struct pheader *header = value;
+ void *header_data = (void *)header + sizeof(*header);
+
+ if (header->unknown) { IUnknown_Release(*(IUnknown **)header_data); }
+ FREE(header);
+
+ return PIPE_OK;
+}
+
+#endif /* _NINE_PDATA_H_ */