all: rename PIPE_SHADER_MESH_TYPES to MESA_SHADER_MESH_STAGES

Use command:
  find . -type f -not -path '*/.git/*' -exec sed -i 's/\bPIPE_SHADER_MESH_TYPES\b/MESA_SHADER_MESH_STAGES/g' {} +

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
This commit is contained in:
Qiang Yu
2025-08-05 14:18:39 +08:00
parent 07a3a54d37
commit 799806d85e
11 changed files with 29 additions and 24 deletions
+5
View File
@@ -179,6 +179,11 @@ const char *_mesa_shader_stage_to_abbrev(unsigned stage);
*/
#define MESA_SHADER_STAGES (MESA_SHADER_COMPUTE + 1)
/**
* GL related stages with mesh shader (not including CL)
*/
#define MESA_SHADER_MESH_STAGES (MESA_SHADER_MESH + 1)
/**
* Vulkan stages (not including CL)
*/
@@ -83,7 +83,7 @@ struct cso_context_priv {
struct sampler_info fragment_samplers_saved;
struct sampler_info compute_samplers_saved;
struct sampler_info samplers[PIPE_SHADER_MESH_TYPES];
struct sampler_info samplers[MESA_SHADER_MESH_STAGES];
/* Temporary number until cso_single_sampler_done is called.
* It tracks the highest sampler seen in cso_single_sampler.
@@ -184,13 +184,13 @@ sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
return;
if (type == CSO_SAMPLER) {
samplers_to_restore = MALLOC((PIPE_SHADER_MESH_TYPES + 2) * PIPE_MAX_SAMPLERS *
samplers_to_restore = MALLOC((MESA_SHADER_MESH_STAGES + 2) * PIPE_MAX_SAMPLERS *
sizeof(*samplers_to_restore));
/* Temporarily remove currently bound sampler states from the hash
* table, to prevent them from being deleted
*/
for (int i = 0; i < PIPE_SHADER_MESH_TYPES; i++) {
for (int i = 0; i < MESA_SHADER_MESH_STAGES; i++) {
for (int j = 0; j < PIPE_MAX_SAMPLERS; j++) {
struct cso_sampler *sampler = ctx->samplers[i].cso_samplers[j];
@@ -364,7 +364,7 @@ cso_unbind_context(struct cso_context *cso)
static void *zeros[PIPE_MAX_SAMPLERS] = { NULL };
struct pipe_screen *scr = ctx->base.pipe->screen;
enum pipe_shader_type sh;
for (sh = 0; sh < PIPE_SHADER_MESH_TYPES; sh++) {
for (sh = 0; sh < MESA_SHADER_MESH_STAGES; sh++) {
switch (sh) {
case MESA_SHADER_GEOMETRY:
if (!ctx->has_geometry_shader)
+1 -1
View File
@@ -38,7 +38,7 @@ extern "C" {
#endif
extern const char *tgsi_processor_type_names[PIPE_SHADER_MESH_TYPES];
extern const char *tgsi_processor_type_names[MESA_SHADER_MESH_STAGES];
extern const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT];
+1 -1
View File
@@ -84,7 +84,7 @@ llvmpipe_destroy(struct pipe_context *pipe)
util_unreference_framebuffer_state(&llvmpipe->framebuffer);
for (enum pipe_shader_type s = MESA_SHADER_VERTEX; s < PIPE_SHADER_MESH_TYPES; s++) {
for (enum pipe_shader_type s = MESA_SHADER_VERTEX; s < MESA_SHADER_MESH_STAGES; s++) {
for (i = 0; i < ARRAY_SIZE(llvmpipe->sampler_views[0]); i++) {
pipe_sampler_view_reference(&llvmpipe->sampler_views[s][i], NULL);
}
+8 -8
View File
@@ -62,7 +62,7 @@ struct llvmpipe_context {
struct list_head list;
/** Constant state objects */
const struct pipe_blend_state *blend;
struct pipe_sampler_state *samplers[PIPE_SHADER_MESH_TYPES][PIPE_MAX_SAMPLERS];
struct pipe_sampler_state *samplers[MESA_SHADER_MESH_STAGES][PIPE_MAX_SAMPLERS];
const struct pipe_depth_stencil_alpha_state *depth_stencil;
const struct pipe_rasterizer_state *rasterizer;
@@ -86,21 +86,21 @@ struct llvmpipe_context {
struct pipe_blend_color blend_color;
struct pipe_stencil_ref stencil_ref;
struct pipe_clip_state clip;
struct pipe_constant_buffer constants[PIPE_SHADER_MESH_TYPES][LP_MAX_TGSI_CONST_BUFFERS];
struct pipe_constant_buffer constants[MESA_SHADER_MESH_STAGES][LP_MAX_TGSI_CONST_BUFFERS];
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissors[PIPE_MAX_VIEWPORTS];
struct pipe_sampler_view *sampler_views[PIPE_SHADER_MESH_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct pipe_sampler_view *sampler_views[MESA_SHADER_MESH_STAGES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS];
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
struct pipe_shader_buffer ssbos[PIPE_SHADER_MESH_TYPES][LP_MAX_TGSI_SHADER_BUFFERS];
struct pipe_image_view images[PIPE_SHADER_MESH_TYPES][LP_MAX_TGSI_SHADER_IMAGES];
struct pipe_shader_buffer ssbos[MESA_SHADER_MESH_STAGES][LP_MAX_TGSI_SHADER_BUFFERS];
struct pipe_image_view images[MESA_SHADER_MESH_STAGES][LP_MAX_TGSI_SHADER_IMAGES];
uint32_t fs_ssbo_write_mask;
unsigned num_samplers[PIPE_SHADER_MESH_TYPES];
unsigned num_sampler_views[PIPE_SHADER_MESH_TYPES];
unsigned num_images[PIPE_SHADER_MESH_TYPES];
unsigned num_samplers[MESA_SHADER_MESH_STAGES];
unsigned num_sampler_views[MESA_SHADER_MESH_STAGES];
unsigned num_images[MESA_SHADER_MESH_STAGES];
unsigned num_vertex_buffers;
+1 -1
View File
@@ -983,7 +983,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
screen->num_threads);
screen->num_threads = MIN2(screen->num_threads, LP_MAX_THREADS);
for (unsigned i = 0; i < PIPE_SHADER_MESH_TYPES; i++)
for (unsigned i = 0; i < MESA_SHADER_MESH_STAGES; i++)
screen->base.nir_options[i] = &gallivm_nir_options;
#if defined(HAVE_LIBDRM) && defined(HAVE_LINUX_UDMABUF_H)
+1 -1
View File
@@ -4219,7 +4219,7 @@ llvmpipe_set_constant_buffer(struct pipe_context *pipe,
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
struct pipe_constant_buffer *constants = &llvmpipe->constants[shader][index];
assert(shader < PIPE_SHADER_MESH_TYPES);
assert(shader < MESA_SHADER_MESH_STAGES);
assert(index < ARRAY_SIZE(llvmpipe->constants[shader]));
/* note: reference counting */
@@ -74,7 +74,7 @@ llvmpipe_bind_sampler_states(struct pipe_context *pipe,
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
assert(shader < PIPE_SHADER_MESH_TYPES);
assert(shader < MESA_SHADER_MESH_STAGES);
assert(start + num <= ARRAY_SIZE(llvmpipe->samplers[shader]));
draw_flush(llvmpipe->draw);
@@ -138,7 +138,7 @@ llvmpipe_set_sampler_views(struct pipe_context *pipe,
assert(num <= PIPE_MAX_SHADER_SAMPLER_VIEWS);
assert(shader < PIPE_SHADER_MESH_TYPES);
assert(shader < MESA_SHADER_MESH_STAGES);
assert(start + num <= ARRAY_SIZE(llvmpipe->sampler_views[shader]));
draw_flush(llvmpipe->draw);
+1 -1
View File
@@ -135,7 +135,7 @@ void __lvp_finishme(const char *file, int line, const char *format, ...)
#define LVP_SHADER_STAGES (MESA_SHADER_CALLABLE + 1)
#define LVP_STAGE_MASK BITFIELD_MASK(LVP_SHADER_STAGES)
#define LVP_STAGE_MASK_GFX (BITFIELD_MASK(PIPE_SHADER_MESH_TYPES) & ~BITFIELD_BIT(MESA_SHADER_COMPUTE))
#define LVP_STAGE_MASK_GFX (BITFIELD_MASK(MESA_SHADER_MESH_STAGES) & ~BITFIELD_BIT(MESA_SHADER_COMPUTE))
#define lvp_foreach_stage(stage, stage_bits) \
for (gl_shader_stage stage, \
+2 -2
View File
@@ -93,9 +93,9 @@ struct pipe_screen {
void *winsys_priv;
const struct pipe_caps caps;
const struct pipe_shader_caps shader_caps[PIPE_SHADER_MESH_TYPES];
const struct pipe_shader_caps shader_caps[MESA_SHADER_MESH_STAGES];
const struct pipe_compute_caps compute_caps;
const struct nir_shader_compiler_options *nir_options[PIPE_SHADER_MESH_TYPES];
const struct nir_shader_compiler_options *nir_options[MESA_SHADER_MESH_STAGES];
/**
* Get the fd associated with the screen
+3 -3
View File
@@ -1044,7 +1044,7 @@ vk_graphics_pipeline_cmd_bind(struct vk_command_buffer *cmd_buffer,
const struct vk_device_shader_ops *ops = device->shader_ops;
struct vk_graphics_pipeline *gfx_pipeline = NULL;
struct vk_shader *stage_shader[PIPE_SHADER_MESH_TYPES] = { NULL, };
struct vk_shader *stage_shader[MESA_SHADER_MESH_STAGES] = { NULL, };
if (pipeline != NULL) {
assert(pipeline->bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS);
assert(!(pipeline->flags & VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR));
@@ -1629,10 +1629,10 @@ vk_create_graphics_pipeline(struct vk_device *device,
if (pipeline == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
struct vk_pipeline_stage stages[PIPE_SHADER_MESH_TYPES];
struct vk_pipeline_stage stages[MESA_SHADER_MESH_STAGES];
memset(stages, 0, sizeof(stages));
VkPipelineCreationFeedback stage_feedbacks[PIPE_SHADER_MESH_TYPES];
VkPipelineCreationFeedback stage_feedbacks[MESA_SHADER_MESH_STAGES];
memset(stage_feedbacks, 0, sizeof(stage_feedbacks));
struct vk_graphics_pipeline_state state_tmp, *state;