mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
pvr, pco: enable pre-generated header string functions to work with clc
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439>
This commit is contained in:
parent
7855446a51
commit
e8adfa1241
2 changed files with 10 additions and 2 deletions
|
|
@ -73,6 +73,10 @@ PACK_FILE_HEADER = """%(license)s
|
||||||
|
|
||||||
#include "csbgen/pvr_packet_helpers.h"
|
#include "csbgen/pvr_packet_helpers.h"
|
||||||
|
|
||||||
|
#ifndef __OPENCL_VERSION__
|
||||||
|
#define __constant
|
||||||
|
#endif
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -248,7 +252,7 @@ class Enum(Node):
|
||||||
|
|
||||||
def _emit_to_str(self) -> None:
|
def _emit_to_str(self) -> None:
|
||||||
print(textwrap.dedent("""\
|
print(textwrap.dedent("""\
|
||||||
static const char *
|
static __constant const char *
|
||||||
%s_to_str(const enum %s value)
|
%s_to_str(const enum %s value)
|
||||||
{""") % (self.full_name, self.full_name))
|
{""") % (self.full_name, self.full_name))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ template = """/*
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifndef __OPENCL_VERSION__
|
||||||
|
#define __constant
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Enums. */
|
/** Enums. */
|
||||||
% for enum in [enum for enum in enums.values() if enum.parent is None]:
|
% for enum in [enum for enum in enums.values() if enum.parent is None]:
|
||||||
#define _${enum.name.upper()}_COUNT ${enum.unique_count}U
|
#define _${enum.name.upper()}_COUNT ${enum.unique_count}U
|
||||||
|
|
@ -36,7 +40,7 @@ enum ${enum.name} {
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
const char *${enum.name}_str(uint64_t val) {
|
__constant const char *${enum.name}_str(uint64_t val) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
% for elem in enum.elems.values():
|
% for elem in enum.elems.values():
|
||||||
% if elem.string is not None:
|
% if elem.string is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue