From 0bb03ffc76604fa5b69db66739e4ea303fe3392d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 26 Jul 2022 13:39:00 +1000 Subject: [PATCH] gallium: use gl shader types as the basis for the gallium ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should enable a rename transistion. Trace needs to swap over to a non-generated version, but that should be fine. Reviewed-by: Marek Olšák Part-of: --- src/compiler/shader_enums.h | 9 ++++++++- src/gallium/auxiliary/driver_trace/enums2names.py | 1 - src/gallium/auxiliary/driver_trace/tr_screen.h | 6 ++++++ src/gallium/include/pipe/p_defines.h | 15 ++------------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h index 7c7c7afe037..30b8d432e08 100644 --- a/src/compiler/shader_enums.h +++ b/src/compiler/shader_enums.h @@ -44,16 +44,23 @@ extern "C" { * The GLSL linker assumes that if i= (3, 6) # lst_enum_include = [ "pipe_texture_target", - "pipe_shader_type", "pipe_shader_cap", "pipe_shader_ir", "pipe_cap", diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.h b/src/gallium/auxiliary/driver_trace/tr_screen.h index 2350ec95f59..76b04e9d98d 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.h +++ b/src/gallium/auxiliary/driver_trace/tr_screen.h @@ -45,6 +45,12 @@ extern "C" { */ #define TRACE_FLAG_USER_BUFFER (1 << 31) +static inline const char * +tr_util_pipe_shader_type_name(gl_shader_stage stage) +{ + return gl_shader_stage_name(stage); +} + struct trace_screen { diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index eeaa8a30c5d..ff858881fbf 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -30,6 +30,8 @@ #include "p_compiler.h" +#include "compiler/shader_enums.h" + #ifdef __cplusplus extern "C" { #endif @@ -546,19 +548,6 @@ enum pipe_resource_usage { PIPE_USAGE_STAGING, /* fast CPU access */ }; -/** - * Shaders - */ -enum pipe_shader_type { - PIPE_SHADER_VERTEX, - PIPE_SHADER_TESS_CTRL, - PIPE_SHADER_TESS_EVAL, - PIPE_SHADER_GEOMETRY, - PIPE_SHADER_FRAGMENT, - PIPE_SHADER_COMPUTE, - PIPE_SHADER_TYPES, -}; - /** * Primitive types: */