all: rename gl_shader_stage to mesa_shader_stage

It's not only for GL, change to a generic name.

Use command:
  find . -type f -not -path '*/.git/*' -exec sed -i 's/\bgl_shader_stage\b/mesa_shader_stage/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 15:54:29 +08:00
parent 4c7244fac5
commit 196569b1a4
292 changed files with 933 additions and 933 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ nir_vk_is_not_xfb_output(nir_variable *var, void *data)
nir_shader *
vk_spirv_to_nir(struct vk_device *device,
const uint32_t *spirv_data, size_t spirv_size_B,
gl_shader_stage stage, const char *entrypoint_name,
mesa_shader_stage stage, const char *entrypoint_name,
enum gl_subgroup_size subgroup_size,
const VkSpecializationInfo *spec_info,
const struct spirv_to_nir_options *spirv_options,
+1 -1
View File
@@ -43,7 +43,7 @@ nir_vk_is_not_xfb_output(nir_variable *var, void *data);
nir_shader *
vk_spirv_to_nir(struct vk_device *device,
const uint32_t *spirv_data, size_t spirv_size_B,
gl_shader_stage stage, const char *entrypoint_name,
mesa_shader_stage stage, const char *entrypoint_name,
enum gl_subgroup_size subgroup_size,
const VkSpecializationInfo *spec_info,
const struct spirv_to_nir_options *spirv_options,
+16 -16
View File
@@ -104,7 +104,7 @@ get_required_subgroup_size(const void *info_pNext)
enum gl_subgroup_size
vk_get_subgroup_size(uint32_t spirv_version,
gl_shader_stage stage,
mesa_shader_stage stage,
const void *info_pNext,
bool allow_varying,
bool require_full)
@@ -136,7 +136,7 @@ vk_pipeline_shader_stage_to_nir(struct vk_device *device,
void *mem_ctx, nir_shader **nir_out)
{
VK_FROM_HANDLE(vk_shader_module, module, info->module);
const gl_shader_stage stage = vk_to_mesa_shader_stage(info->stage);
const mesa_shader_stage stage = vk_to_mesa_shader_stage(info->stage);
assert(info->sType == VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO);
@@ -650,7 +650,7 @@ struct vk_pipeline_precomp_shader {
*/
uint8_t cache_key[SHA1_DIGEST_LENGTH];
gl_shader_stage stage;
mesa_shader_stage stage;
struct vk_pipeline_robustness_state rs;
@@ -877,7 +877,7 @@ vk_pipeline_precompile_shader(struct vk_device *device,
VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR)
return VK_PIPELINE_COMPILE_REQUIRED;
const gl_shader_stage stage = vk_to_mesa_shader_stage(info->stage);
const mesa_shader_stage stage = vk_to_mesa_shader_stage(info->stage);
const struct nir_shader_compiler_options *nir_options =
ops->get_nir_options(device->physical, stage, &rs);
const struct spirv_to_nir_options spirv_options =
@@ -913,7 +913,7 @@ vk_pipeline_precompile_shader(struct vk_device *device,
}
struct vk_pipeline_stage {
gl_shader_stage stage;
mesa_shader_stage stage;
struct vk_pipeline_precomp_shader *precomp;
struct vk_shader *shader;
@@ -1003,7 +1003,7 @@ vk_graphics_pipeline_destroy(struct vk_device *device,
static bool
vk_device_supports_stage(struct vk_device *device,
gl_shader_stage stage)
mesa_shader_stage stage)
{
const struct vk_features *features = &device->physical->supported_features;
@@ -1026,7 +1026,7 @@ vk_device_supports_stage(struct vk_device *device,
}
}
static const gl_shader_stage all_gfx_stages[] = {
static const mesa_shader_stage all_gfx_stages[] = {
MESA_SHADER_VERTEX,
MESA_SHADER_TESS_CTRL,
MESA_SHADER_TESS_EVAL,
@@ -1057,12 +1057,12 @@ vk_graphics_pipeline_cmd_bind(struct vk_command_buffer *cmd_buffer,
}
uint32_t stage_count = 0;
gl_shader_stage stages[ARRAY_SIZE(all_gfx_stages)];
mesa_shader_stage stages[ARRAY_SIZE(all_gfx_stages)];
struct vk_shader *shaders[ARRAY_SIZE(all_gfx_stages)];
VkShaderStageFlags vk_stages = 0;
for (uint32_t i = 0; i < ARRAY_SIZE(all_gfx_stages); i++) {
gl_shader_stage stage = all_gfx_stages[i];
mesa_shader_stage stage = all_gfx_stages[i];
if (!vk_device_supports_stage(device, stage)) {
assert(stage_shader[stage] == NULL);
continue;
@@ -1087,7 +1087,7 @@ vk_graphics_pipeline_cmd_bind(struct vk_command_buffer *cmd_buffer,
static VkShaderCreateFlagsEXT
vk_pipeline_to_shader_flags(VkPipelineCreateFlags2KHR pipeline_flags,
gl_shader_stage stage)
mesa_shader_stage stage)
{
VkShaderCreateFlagsEXT shader_flags = 0;
@@ -1578,7 +1578,7 @@ vk_graphics_pipeline_get_internal_representations(
static struct vk_shader *
vk_graphics_pipeline_get_shader(struct vk_pipeline *pipeline,
gl_shader_stage stage)
mesa_shader_stage stage)
{
struct vk_graphics_pipeline *gfx_pipeline =
container_of(pipeline, struct vk_graphics_pipeline, base);
@@ -1730,7 +1730,7 @@ vk_create_graphics_pipeline(struct vk_device *device,
if (!(state->shader_stages & stage_info->stage))
continue;
gl_shader_stage stage = vk_to_mesa_shader_stage(stage_info->stage);
mesa_shader_stage stage = vk_to_mesa_shader_stage(stage_info->stage);
assert(vk_device_supports_stage(device, stage));
stage_feedbacks[stage].flags |=
@@ -1857,7 +1857,7 @@ vk_create_graphics_pipeline(struct vk_device *device,
*/
uint32_t cache_hit_count = 0;
for (uint32_t i = 0; i < stage_count; i++) {
const gl_shader_stage stage = stages[i].stage;
const mesa_shader_stage stage = stages[i].stage;
if (stage_feedbacks[stage].flags &
VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT)
cache_hit_count++;
@@ -1875,7 +1875,7 @@ vk_create_graphics_pipeline(struct vk_device *device,
pCreateInfo->stageCount);
for (uint32_t i = 0;
i < feedback_info->pipelineStageCreationFeedbackCount; i++) {
const gl_shader_stage stage =
const mesa_shader_stage stage =
vk_to_mesa_shader_stage(pCreateInfo->pStages[i].stage);
feedback_info->pPipelineStageCreationFeedbacks[i] =
@@ -1985,7 +1985,7 @@ vk_compute_pipeline_cmd_bind(struct vk_command_buffer *cmd_buffer,
cmd_buffer->pipeline_shader_stages &= ~VK_SHADER_STAGE_COMPUTE_BIT;
}
gl_shader_stage stage = MESA_SHADER_COMPUTE;
mesa_shader_stage stage = MESA_SHADER_COMPUTE;
ops->cmd_bind_shaders(cmd_buffer, 1, &stage, &shader);
}
@@ -2154,7 +2154,7 @@ vk_compute_pipeline_get_internal_representations(
static struct vk_shader *
vk_compute_pipeline_get_shader(struct vk_pipeline *pipeline,
gl_shader_stage stage)
mesa_shader_stage stage)
{
struct vk_compute_pipeline *comp_pipeline =
container_of(pipeline, struct vk_compute_pipeline, base);
+3 -3
View File
@@ -67,7 +67,7 @@ vk_pipeline_shader_stage_to_nir(struct vk_device *device,
enum gl_subgroup_size
vk_get_subgroup_size(uint32_t spirv_version,
gl_shader_stage stage,
mesa_shader_stage stage,
const void *info_pNext,
bool allow_varying,
bool require_full);
@@ -196,7 +196,7 @@ struct vk_pipeline_ops {
struct vk_pipeline *pipeline);
struct vk_shader *(*get_shader)(struct vk_pipeline *pipeline,
gl_shader_stage stage);
mesa_shader_stage stage);
};
void *vk_pipeline_zalloc(struct vk_device *device,
@@ -219,7 +219,7 @@ void vk_pipeline_free(struct vk_device *device,
static inline struct vk_shader *
vk_pipeline_get_shader(struct vk_pipeline *pipeline,
gl_shader_stage stage)
mesa_shader_stage stage)
{
if (pipeline->ops->get_shader == NULL)
return NULL;
+7 -7
View File
@@ -41,7 +41,7 @@ static void
vk_shader_init(struct vk_shader *shader,
struct vk_device *device,
const struct vk_shader_ops *ops,
gl_shader_stage stage)
mesa_shader_stage stage)
{
vk_object_base_init(device, &shader->base, VK_OBJECT_TYPE_SHADER_EXT);
shader->ops = ops;
@@ -51,7 +51,7 @@ vk_shader_init(struct vk_shader *shader,
void *
vk_shader_zalloc(struct vk_device *device,
const struct vk_shader_ops *ops,
gl_shader_stage stage,
mesa_shader_stage stage,
const VkAllocationCallbacks *alloc,
size_t size)
{
@@ -79,7 +79,7 @@ void *
vk_shader_multizalloc(struct vk_device *device,
struct vk_multialloc *ma,
const struct vk_shader_ops *ops,
gl_shader_stage stage,
mesa_shader_stage stage,
const VkAllocationCallbacks *alloc)
{
struct vk_shader *shader =
@@ -103,7 +103,7 @@ vk_shader_free(struct vk_device *device,
}
int
vk_shader_cmp_graphics_stages(gl_shader_stage a, gl_shader_stage b)
vk_shader_cmp_graphics_stages(mesa_shader_stage a, mesa_shader_stage b)
{
static const int stage_order[MESA_SHADER_MESH + 1] = {
[MESA_SHADER_VERTEX] = 1,
@@ -122,7 +122,7 @@ vk_shader_cmp_graphics_stages(gl_shader_stage a, gl_shader_stage b)
}
struct stage_idx {
gl_shader_stage stage;
mesa_shader_stage stage;
uint32_t idx;
};
@@ -140,7 +140,7 @@ vk_shader_to_nir(struct vk_device *device,
{
const struct vk_device_shader_ops *ops = device->shader_ops;
const gl_shader_stage stage = vk_to_mesa_shader_stage(info->stage);
const mesa_shader_stage stage = vk_to_mesa_shader_stage(info->stage);
const nir_shader_compiler_options *nir_options =
ops->get_nir_options(device->physical, stage, rs);
struct spirv_to_nir_options spirv_options =
@@ -598,7 +598,7 @@ vk_common_CmdBindShadersEXT(VkCommandBuffer commandBuffer,
struct vk_device *device = cmd_buffer->base.device;
const struct vk_device_shader_ops *ops = device->shader_ops;
STACK_ARRAY(gl_shader_stage, stages, stageCount);
STACK_ARRAY(mesa_shader_stage, stages, stageCount);
STACK_ARRAY(struct vk_shader *, shaders, stageCount);
VkShaderStageFlags vk_stages = 0;
+9 -9
View File
@@ -46,12 +46,12 @@ struct vk_physical_device;
struct vk_pipeline;
struct vk_pipeline_robustness_state;
int vk_shader_cmp_graphics_stages(gl_shader_stage a, gl_shader_stage b);
int vk_shader_cmp_graphics_stages(mesa_shader_stage a, mesa_shader_stage b);
#define VK_SHADER_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_MESA 0x1000
struct vk_shader_compile_info {
gl_shader_stage stage;
mesa_shader_stage stage;
VkShaderCreateFlagsEXT flags;
VkShaderStageFlags next_stage_mask;
struct nir_shader *nir;
@@ -72,7 +72,7 @@ struct vk_shader_ops;
#pragma GCC diagnostic error "-Wpadded"
#endif
struct vk_shader_pipeline_cache_key {
gl_shader_stage stage;
mesa_shader_stage stage;
blake3_hash blake3;
};
#ifdef __GNUC__
@@ -84,7 +84,7 @@ struct vk_shader {
const struct vk_shader_ops *ops;
gl_shader_stage stage;
mesa_shader_stage stage;
/* Used for the generic VkPipeline implementation */
struct {
@@ -150,13 +150,13 @@ struct vk_shader_ops {
void *vk_shader_zalloc(struct vk_device *device,
const struct vk_shader_ops *ops,
gl_shader_stage stage,
mesa_shader_stage stage,
const VkAllocationCallbacks *alloc,
size_t size);
void *vk_shader_multizalloc(struct vk_device *device,
struct vk_multialloc *ma,
const struct vk_shader_ops *ops,
gl_shader_stage stage,
mesa_shader_stage stage,
const VkAllocationCallbacks *alloc);
void vk_shader_free(struct vk_device *device,
const VkAllocationCallbacks *alloc,
@@ -178,7 +178,7 @@ struct vk_device_shader_ops {
*/
const struct nir_shader_compiler_options *(*get_nir_options)(
struct vk_physical_device *device,
gl_shader_stage stage,
mesa_shader_stage stage,
const struct vk_pipeline_robustness_state *rs);
/** Retrieves a SPIR-V options struct
@@ -188,7 +188,7 @@ struct vk_device_shader_ops {
*/
struct spirv_to_nir_options (*get_spirv_options)(
struct vk_physical_device *device,
gl_shader_stage stage,
mesa_shader_stage stage,
const struct vk_pipeline_robustness_state *rs);
/** Preprocesses a NIR shader
@@ -255,7 +255,7 @@ struct vk_device_shader_ops {
*/
void (*cmd_bind_shaders)(struct vk_command_buffer *cmd_buffer,
uint32_t stage_count,
const gl_shader_stage *stages,
const mesa_shader_stage *stages,
struct vk_shader ** const shaders);
/** Sets dynamic state */
+3 -3
View File
@@ -315,15 +315,15 @@ struct vk_pipeline_cache_header {
} \
} while (0)
static inline gl_shader_stage
static inline mesa_shader_stage
vk_to_mesa_shader_stage(VkShaderStageFlagBits vk_stage)
{
assert(util_bitcount((uint32_t) vk_stage) == 1);
return (gl_shader_stage) (ffs((uint32_t) vk_stage) - 1);
return (mesa_shader_stage) (ffs((uint32_t) vk_stage) - 1);
}
static inline VkShaderStageFlagBits
mesa_to_vk_shader_stage(gl_shader_stage mesa_stage)
mesa_to_vk_shader_stage(mesa_shader_stage mesa_stage)
{
return (VkShaderStageFlagBits) (1 << ((uint32_t) mesa_stage));
}