Skip to content

Using validation layer and mesh shaders with a uniform causes performance drop overtime #11349

@Sharlock93

Description

@Sharlock93

Environment:

  • OS: Windows 11 24H2 (OS Build 26100.7462)
  • GPU and driver version: NVIDIA GeForce RTX 3080 Laptop GPU - VkVersion: 1.4.325 - Driver: 591.236.0
  • SDK or header version if building from repo: Latest from the repo
  • Options enabled (synchronization, best practices, etc.):
    VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT |
    VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT |
    VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_NVIDIA |
    VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT.

Describe the Issue

Performance of the application decreases overtime when validation layer is used with a simple mesh shader that has a uniform binding.
This is a very simple shader:

#version 460
#extension GL_EXT_mesh_shader : require

layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(triangles, max_vertices = 3, max_primitives = 1) out;

struct Vout {
    vec2 uv;
};

layout(binding = 0) uniform camera {
    mat4 proj;
    mat4 cam;
};
layout(location = 0) out Vout v_out[];

void main() {
    SetMeshOutputsEXT(3, 1);
    gl_PrimitiveTriangleIndicesEXT[0] = uvec3(0, 1, 2);
    gl_MeshVerticesEXT[0].gl_Position = transpose(proj)*transpose(cam)*vec4(0,0,0,1);
    gl_MeshVerticesEXT[1].gl_Position = transpose(proj)*transpose(cam)*vec4(1,0,0,1);
    gl_MeshVerticesEXT[2].gl_Position = transpose(proj)*transpose(cam)*vec4(0,1,0,1);

    v_out[0].uv = vec2(0, 0);
    v_out[1].uv = vec2(0, 1);
    v_out[2].uv = vec2(1, 0);
}

I ran this through superluminal, here is what the frame time looks like:

Image

This is what one of the higher cost frames looks like in superluminal:

Image

I haven't looked deeper into this unfortunately. However a few points stand:

  1. This doesn't happen if there is no uniform.
  2. This doesn't happen in traditional pipelines.
  3. This doesn't happen when validation layer is disabled.

Expected behavior
Cost of validation layer being constant and not increase overtime.

Metadata

Metadata

Assignees

Labels

GPU-AVGPU Assisted Validation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions