yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

Saddamvalidate createTensorLayoutNV/createTensorViewNV arguments09cfe5ce

main
865 B25 linesraw
1#version 450 core
2#extension GL_KHR_memory_scope_semantics : enable
3#extension GL_KHR_cooperative_matrix : enable
4#extension GL_EXT_shader_explicit_arithmetic_types : enable
5#extension GL_NV_cooperative_matrix2 : enable
6
7layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
8
9layout(constant_id = 0) const uint32_t Clamp = gl_CooperativeMatrixClampModeConstantNV;
10
11uint32_t dim;
12
13void main()
14{
15    // The arguments become the type parameters of the result type, so they
16    // must be constants or specialization constants.
17    createTensorLayoutNV(dim);
18    createTensorLayoutNV(dim, gl_CooperativeMatrixClampModeConstantNV);
19    createTensorLayoutNV(2, dim);
20    createTensorViewNV(dim);
21    createTensorViewNV(2, dim == 0, 1, 0);
22
23    // a specialization constant expression is accepted, as in a declaration
24    createTensorLayoutNV(2, Clamp + 1);
25}