aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_compiler.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-04-15 16:05:43 -0500
committerMarge Bot <[email protected]>2020-04-16 17:26:16 +0000
commite003104605f506333d2ac8a9c2baf9f04eaebb81 (patch)
tree9e876ef9bfa6b7fd2b8dfff774769e6303034a39 /src/intel/compiler/brw_compiler.h
parent9b17d7caac76e1c2dd4579c198b2e32b762bb656 (diff)
intel: Add _const versions of prog_data cast helpers
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4597>
Diffstat (limited to 'src/intel/compiler/brw_compiler.h')
-rw-r--r--src/intel/compiler/brw_compiler.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h
index 25fc3eaa915..62c7e85e55f 100644
--- a/src/intel/compiler/brw_compiler.h
+++ b/src/intel/compiler/brw_compiler.h
@@ -1254,11 +1254,16 @@ union brw_any_prog_data {
struct brw_cs_prog_data cs;
};
-#define DEFINE_PROG_DATA_DOWNCAST(stage) \
-static inline struct brw_##stage##_prog_data * \
-brw_##stage##_prog_data(struct brw_stage_prog_data *prog_data) \
-{ \
- return (struct brw_##stage##_prog_data *) prog_data; \
+#define DEFINE_PROG_DATA_DOWNCAST(stage) \
+static inline struct brw_##stage##_prog_data * \
+brw_##stage##_prog_data(struct brw_stage_prog_data *prog_data) \
+{ \
+ return (struct brw_##stage##_prog_data *) prog_data; \
+} \
+static inline const struct brw_##stage##_prog_data * \
+brw_##stage##_prog_data_const(const struct brw_stage_prog_data *prog_data) \
+{ \
+ return (const struct brw_##stage##_prog_data *) prog_data; \
}
DEFINE_PROG_DATA_DOWNCAST(vue)
DEFINE_PROG_DATA_DOWNCAST(vs)