diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-09-05 14:31:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-05 14:31:43 +0300 |
commit | 5406610179aa5530e42c75f5c5fb338ad69fb21c (patch) | |
tree | ae7e2dd8488833b56959c7918b776b6c48f504a8 | |
parent | 0088c22c4e95dc9c090c8b20d5a1c8b47de3f12e (diff) | |
parent | d27d1d4cd197535c0f8f246dc0d826f0e3f0b5f6 (diff) |
Merge pull request #128 from HansKristian-Work/mesh-shader-basic-tests
Mesh shader basic tests
43 files changed, 710 insertions, 15 deletions
diff --git a/reference/shaders/asm/cbv.no-legacy-cbuf-layout.sm66-heaps.bc.dxil b/reference/shaders/asm/cbv.no-legacy-cbuf-layout.sm66-heaps.bc.dxil index 98b135b..ca47c9f 100644 --- a/reference/shaders/asm/cbv.no-legacy-cbuf-layout.sm66-heaps.bc.dxil +++ b/reference/shaders/asm/cbv.no-legacy-cbuf-layout.sm66-heaps.bc.dxil @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_nonuniform_qualifier : require #extension GL_EXT_scalar_block_layout : require diff --git a/reference/shaders/dxil-builtin/barycentrics-2.frag b/reference/shaders/dxil-builtin/barycentrics-2.frag index 5449b9b..19d2be2 100644 --- a/reference/shaders/dxil-builtin/barycentrics-2.frag +++ b/reference/shaders/dxil-builtin/barycentrics-2.frag @@ -1,15 +1,15 @@ #version 460 -#extension GL_NV_fragment_shader_barycentric : require +#extension GL_EXT_fragment_shader_barycentric : require -layout(location = 0) pervertexNV in float ATTRIB[3]; -layout(location = 0, component = 1) pervertexNV in float ATTRIB_1[3]; -layout(location = 0, component = 2) pervertexNV in float ATTRIB_2[3]; +layout(location = 0) pervertexEXT in float ATTRIB[3]; +layout(location = 0, component = 1) pervertexEXT in float ATTRIB_1[3]; +layout(location = 0, component = 2) pervertexEXT in float ATTRIB_2[3]; layout(location = 1) centroid in float FOO; layout(location = 0) out float SV_Target; void main() { - SV_Target = (((ATTRIB[0u] * gl_BaryCoordNV.x) + FOO) + (ATTRIB_1[1u] * gl_BaryCoordNV.y)) + (ATTRIB_2[2u] * gl_BaryCoordNV.z); + SV_Target = (((ATTRIB[0u] * gl_BaryCoordEXT.x) + FOO) + (ATTRIB_1[1u] * gl_BaryCoordEXT.y)) + (ATTRIB_2[2u] * gl_BaryCoordEXT.z); } diff --git a/reference/shaders/dxil-builtin/barycentrics.frag b/reference/shaders/dxil-builtin/barycentrics.frag index 3e46539..c363746 100644 --- a/reference/shaders/dxil-builtin/barycentrics.frag +++ b/reference/shaders/dxil-builtin/barycentrics.frag @@ -1,17 +1,17 @@ #version 460 -#extension GL_NV_fragment_shader_barycentric : require +#extension GL_EXT_fragment_shader_barycentric : require -layout(location = 0) pervertexNV in vec4 ATTRIB[3]; -layout(location = 1) pervertexNV in vec4 ATTRIB_2[3][2]; +layout(location = 0) pervertexEXT in vec4 ATTRIB[3]; +layout(location = 1) pervertexEXT in vec4 ATTRIB_2[3][2]; layout(location = 3) flat in uint INDEX; layout(location = 0) out vec4 SV_Target; void main() { - SV_Target.x = (((((ATTRIB[0u].x + gl_BaryCoordNV.x) + (ATTRIB[0u].x * gl_BaryCoordNV.x)) + (ATTRIB[1u].x * gl_BaryCoordNV.y)) + (ATTRIB_2[0u][INDEX].x * gl_BaryCoordNV.z)) + ((ATTRIB_2[1u][1u].x + ATTRIB_2[2u][0u].x) * gl_BaryCoordNoPerspNV.y)) + ((ATTRIB_2[0u][1u].x + ATTRIB_2[1u][0u].x) * gl_BaryCoordNoPerspNV.x); - SV_Target.y = (((((ATTRIB[0u].y + gl_BaryCoordNV.y) + (ATTRIB[0u].y * gl_BaryCoordNV.x)) + (ATTRIB[1u].y * gl_BaryCoordNV.y)) + (ATTRIB_2[0u][INDEX].y * gl_BaryCoordNV.z)) + ((ATTRIB_2[1u][1u].y + ATTRIB_2[2u][0u].y) * gl_BaryCoordNoPerspNV.y)) + ((ATTRIB_2[0u][1u].y + ATTRIB_2[1u][0u].y) * gl_BaryCoordNoPerspNV.x); - SV_Target.z = (((((ATTRIB[0u].z + gl_BaryCoordNoPerspNV.y) + (ATTRIB[0u].z * gl_BaryCoordNV.x)) + (ATTRIB[1u].z * gl_BaryCoordNV.y)) + (ATTRIB_2[0u][INDEX].z * gl_BaryCoordNV.z)) + ((ATTRIB_2[1u][1u].z + ATTRIB_2[2u][0u].z) * gl_BaryCoordNoPerspNV.y)) + ((ATTRIB_2[0u][1u].z + ATTRIB_2[1u][0u].z) * gl_BaryCoordNoPerspNV.x); - SV_Target.w = (((((ATTRIB[0u].w + gl_BaryCoordNoPerspNV.x) + (ATTRIB[0u].w * gl_BaryCoordNV.x)) + (ATTRIB[1u].w * gl_BaryCoordNV.y)) + (ATTRIB_2[0u][INDEX].w * gl_BaryCoordNV.z)) + ((ATTRIB_2[1u][1u].w + ATTRIB_2[2u][0u].w) * gl_BaryCoordNoPerspNV.y)) + ((ATTRIB_2[0u][1u].w + ATTRIB_2[1u][0u].w) * gl_BaryCoordNoPerspNV.x); + SV_Target.x = (((((ATTRIB[0u].x + gl_BaryCoordEXT.x) + (ATTRIB[0u].x * gl_BaryCoordEXT.x)) + (ATTRIB[1u].x * gl_BaryCoordEXT.y)) + (ATTRIB_2[0u][INDEX].x * gl_BaryCoordEXT.z)) + ((ATTRIB_2[1u][1u].x + ATTRIB_2[2u][0u].x) * gl_BaryCoordNoPerspEXT.y)) + ((ATTRIB_2[0u][1u].x + ATTRIB_2[1u][0u].x) * gl_BaryCoordNoPerspEXT.x); + SV_Target.y = (((((ATTRIB[0u].y + gl_BaryCoordEXT.y) + (ATTRIB[0u].y * gl_BaryCoordEXT.x)) + (ATTRIB[1u].y * gl_BaryCoordEXT.y)) + (ATTRIB_2[0u][INDEX].y * gl_BaryCoordEXT.z)) + ((ATTRIB_2[1u][1u].y + ATTRIB_2[2u][0u].y) * gl_BaryCoordNoPerspEXT.y)) + ((ATTRIB_2[0u][1u].y + ATTRIB_2[1u][0u].y) * gl_BaryCoordNoPerspEXT.x); + SV_Target.z = (((((ATTRIB[0u].z + gl_BaryCoordNoPerspEXT.y) + (ATTRIB[0u].z * gl_BaryCoordEXT.x)) + (ATTRIB[1u].z * gl_BaryCoordEXT.y)) + (ATTRIB_2[0u][INDEX].z * gl_BaryCoordEXT.z)) + ((ATTRIB_2[1u][1u].z + ATTRIB_2[2u][0u].z) * gl_BaryCoordNoPerspEXT.y)) + ((ATTRIB_2[0u][1u].z + ATTRIB_2[1u][0u].z) * gl_BaryCoordNoPerspEXT.x); + SV_Target.w = (((((ATTRIB[0u].w + gl_BaryCoordNoPerspEXT.x) + (ATTRIB[0u].w * gl_BaryCoordEXT.x)) + (ATTRIB[1u].w * gl_BaryCoordEXT.y)) + (ATTRIB_2[0u][INDEX].w * gl_BaryCoordEXT.z)) + ((ATTRIB_2[1u][1u].w + ATTRIB_2[2u][0u].w) * gl_BaryCoordNoPerspEXT.y)) + ((ATTRIB_2[0u][1u].w + ATTRIB_2[1u][0u].w) * gl_BaryCoordNoPerspEXT.x); } diff --git a/reference/shaders/resources/buffer-64bit.ssbo.bindless.ssbo-align.comp b/reference/shaders/resources/buffer-64bit.ssbo.bindless.ssbo-align.comp index d0c157a..dfd5829 100644 --- a/reference/shaders/resources/buffer-64bit.ssbo.bindless.ssbo-align.comp +++ b/reference/shaders/resources/buffer-64bit.ssbo.bindless.ssbo-align.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_nonuniform_qualifier : require #extension GL_KHR_shader_subgroup_ballot : require diff --git a/reference/shaders/resources/buffer-64bit.ssbo.comp b/reference/shaders/resources/buffer-64bit.ssbo.comp index 86af6ab..e5e2c69 100644 --- a/reference/shaders/resources/buffer-64bit.ssbo.comp +++ b/reference/shaders/resources/buffer-64bit.ssbo.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_scalar_block_layout : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/cbv-legacy-fp16-fp64.frag b/reference/shaders/resources/cbv-legacy-fp16-fp64.frag index 49a7d61..cdeb1aa 100644 --- a/reference/shaders/resources/cbv-legacy-fp16-fp64.frag +++ b/reference/shaders/resources/cbv-legacy-fp16-fp64.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif struct CBVComposite16x8 { diff --git a/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.frag b/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.frag index f2ccf13..9dd92b3 100644 --- a/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.frag +++ b/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_buffer_reference_uvec2 : require diff --git a/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.frag b/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.frag index e8ae469..37aed1b 100644 --- a/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.frag +++ b/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.frag @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_buffer_reference_uvec2 : require diff --git a/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.native-fp16.frag b/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.native-fp16.frag index cad0869..31f655b 100644 --- a/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.native-fp16.frag +++ b/reference/shaders/resources/cbv-legacy-fp16-fp64.root-descriptor.sm60.native-fp16.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_buffer_reference_uvec2 : require diff --git a/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.frag b/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.frag index 99d1a3b..7b3e358 100644 --- a/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.frag +++ b/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.frag @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif layout(set = 0, binding = 0, std140) uniform _10_12 { diff --git a/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.native-fp16.frag b/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.native-fp16.frag index 996fc55..3027d03 100644 --- a/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.native-fp16.frag +++ b/reference/shaders/resources/cbv-legacy-fp16-fp64.sm60.native-fp16.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif layout(set = 0, binding = 0, std140) uniform _10_12 { diff --git a/reference/shaders/resources/cbv.no-legacy-cbuf-layout.bindless.frag b/reference/shaders/resources/cbv.no-legacy-cbuf-layout.bindless.frag index ba78e81..f2b355e 100644 --- a/reference/shaders/resources/cbv.no-legacy-cbuf-layout.bindless.frag +++ b/reference/shaders/resources/cbv.no-legacy-cbuf-layout.bindless.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_nonuniform_qualifier : require #extension GL_EXT_scalar_block_layout : require diff --git a/reference/shaders/resources/cbv.no-legacy-cbuf-layout.native-fp16.sm60.frag b/reference/shaders/resources/cbv.no-legacy-cbuf-layout.native-fp16.sm60.frag index 567eb93..5147786 100644 --- a/reference/shaders/resources/cbv.no-legacy-cbuf-layout.native-fp16.sm60.frag +++ b/reference/shaders/resources/cbv.no-legacy-cbuf-layout.native-fp16.sm60.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_scalar_block_layout : require layout(set = 0, binding = 0, scalar) uniform _9_11 diff --git a/reference/shaders/resources/cbv.root-descriptor.no-legacy-cbuf-layout.frag b/reference/shaders/resources/cbv.root-descriptor.no-legacy-cbuf-layout.frag index fb6a0ab..05a5f48 100644 --- a/reference/shaders/resources/cbv.root-descriptor.no-legacy-cbuf-layout.frag +++ b/reference/shaders/resources/cbv.root-descriptor.no-legacy-cbuf-layout.frag @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #if defined(GL_AMD_gpu_shader_half_float) #extension GL_AMD_gpu_shader_half_float : require #elif defined(GL_EXT_shader_explicit_arithmetic_types_float16) diff --git a/reference/shaders/resources/sm66/atomics-64bit-groupshared.ssbo.sm66.comp b/reference/shaders/resources/sm66/atomics-64bit-groupshared.ssbo.sm66.comp index 5660073..d18395b 100644 --- a/reference/shaders/resources/sm66/atomics-64bit-groupshared.ssbo.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-64bit-groupshared.ssbo.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; struct CmpXchgResult diff --git a/reference/shaders/resources/sm66/atomics-64bit.root-descriptor.sm66.comp b/reference/shaders/resources/sm66/atomics-64bit.root-descriptor.sm66.comp index 6a97050..0756694 100644 --- a/reference/shaders/resources/sm66/atomics-64bit.root-descriptor.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-64bit.root-descriptor.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_buffer_reference_uvec2 : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/atomics-64bit.ssbo.sm66.comp b/reference/shaders/resources/sm66/atomics-64bit.ssbo.sm66.comp index 653e60d..93f1af4 100644 --- a/reference/shaders/resources/sm66/atomics-64bit.ssbo.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-64bit.ssbo.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_nonuniform_qualifier : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/atomics-component-alias.sm66.comp b/reference/shaders/resources/sm66/atomics-component-alias.sm66.comp index 7f2047d..a340f14 100644 --- a/reference/shaders/resources/sm66/atomics-component-alias.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-component-alias.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_samplerless_texture_functions : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/atomics-typed-64bit-heap.sm66.comp b/reference/shaders/resources/sm66/atomics-typed-64bit-heap.sm66.comp index de3f004..7387281 100644 --- a/reference/shaders/resources/sm66/atomics-typed-64bit-heap.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-typed-64bit-heap.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_nonuniform_qualifier : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/atomics-typed-64bit.bindless.sm66.comp b/reference/shaders/resources/sm66/atomics-typed-64bit.bindless.sm66.comp index 9aec3d6..02c463b 100644 --- a/reference/shaders/resources/sm66/atomics-typed-64bit.bindless.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-typed-64bit.bindless.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_nonuniform_qualifier : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/atomics-typed-64bit.sm66.comp b/reference/shaders/resources/sm66/atomics-typed-64bit.sm66.comp index d273110..a368ca3 100644 --- a/reference/shaders/resources/sm66/atomics-typed-64bit.sm66.comp +++ b/reference/shaders/resources/sm66/atomics-typed-64bit.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; layout(set = 0, binding = 0) uniform imageBuffer _8; diff --git a/reference/shaders/resources/sm66/buffer-64bit-double.ssbo.sm66.comp b/reference/shaders/resources/sm66/buffer-64bit-double.ssbo.sm66.comp index e802cf5..f92e47c 100644 --- a/reference/shaders/resources/sm66/buffer-64bit-double.ssbo.sm66.comp +++ b/reference/shaders/resources/sm66/buffer-64bit-double.ssbo.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_nonuniform_qualifier : require #extension GL_EXT_scalar_block_layout : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/buffer-64bit.ssbo.sm66.comp b/reference/shaders/resources/sm66/buffer-64bit.ssbo.sm66.comp index 896ac62..b412a16 100644 --- a/reference/shaders/resources/sm66/buffer-64bit.ssbo.sm66.comp +++ b/reference/shaders/resources/sm66/buffer-64bit.ssbo.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_nonuniform_qualifier : require #extension GL_EXT_scalar_block_layout : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/buffer-64bit.ssbo.ssbo-align.sm66.comp b/reference/shaders/resources/sm66/buffer-64bit.ssbo.ssbo-align.sm66.comp index 0f794c1..d090803 100644 --- a/reference/shaders/resources/sm66/buffer-64bit.ssbo.ssbo-align.sm66.comp +++ b/reference/shaders/resources/sm66/buffer-64bit.ssbo.ssbo-align.sm66.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_nonuniform_qualifier : require #extension GL_KHR_shader_subgroup_ballot : require layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.bindless.sm66.frag b/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.bindless.sm66.frag index ba78e81..f2b355e 100644 --- a/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.bindless.sm66.frag +++ b/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.bindless.sm66.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_nonuniform_qualifier : require #extension GL_EXT_scalar_block_layout : require diff --git a/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.sm66.frag b/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.sm66.frag index 32d7dcf..c159cbf 100644 --- a/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.sm66.frag +++ b/reference/shaders/resources/sm66/cbv.no-legacy-cbuf-layout.sm66.frag @@ -7,7 +7,11 @@ #error No extension available for FP16. #endif #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_scalar_block_layout : require layout(set = 0, binding = 0, scalar) uniform _9_11 diff --git a/reference/shaders/resources/sm66/raygen-heap.ssbo-rtas.sm66.rgen b/reference/shaders/resources/sm66/raygen-heap.ssbo-rtas.sm66.rgen index 8919548..77870d5 100644 --- a/reference/shaders/resources/sm66/raygen-heap.ssbo-rtas.sm66.rgen +++ b/reference/shaders/resources/sm66/raygen-heap.ssbo-rtas.sm66.rgen @@ -25,9 +25,9 @@ layout(location = 1) rayPayloadEXT _20 _22; void main() { uint _24 = subgroupBroadcastFirst(0u); - accelerationStructureEXT _30 = accelerationStructureEXT(_10._m0[_24]); - traceRayEXT(_30, 0u, 0u, 0u, 0u, 0u, vec3(1.0, 2.0, 3.0), 1.0, vec3(0.0, 0.0, 1.0), 4.0, 0); - traceRayEXT(_30, 0u, 1u, 0u, 0u, 0u, vec3(1.0, 2.0, 3.0), 1.0, vec3(0.0, 0.0, 1.0), 4.0, 1); + uvec2 _30 = _10._m0[_24]; + traceRayEXT(accelerationStructureEXT(_30), 0u, 0u, 0u, 0u, 0u, vec3(1.0, 2.0, 3.0), 1.0, vec3(0.0, 0.0, 1.0), 4.0, 0); + traceRayEXT(accelerationStructureEXT(_30), 0u, 1u, 0u, 0u, 0u, vec3(1.0, 2.0, 3.0), 1.0, vec3(0.0, 0.0, 1.0), 4.0, 1); imageStore(_15[1u], ivec2(uvec2(0u)), vec4(_19._m0.x + _22._m0, _19._m0.y + _22._m0, _19._m0.z + _22._m0, _19._m0.w + _22._m0)); } diff --git a/reference/shaders/stages/mesh-basic-line.mesh b/reference/shaders/stages/mesh-basic-line.mesh new file mode 100644 index 0000000..16e9bdb --- /dev/null +++ b/reference/shaders/stages/mesh-basic-line.mesh @@ -0,0 +1,197 @@ +#version 460 +#extension GL_EXT_mesh_shader : require +layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; +layout(max_vertices = 24, max_primitives = 8, lines) out; + +struct _36 +{ + float _m0; +}; + +layout(location = 1) out vec4 B[24]; +layout(location = 3) perprimitiveEXT out vec4 C[8]; +shared float _32[64]; +taskPayloadSharedEXT _36 _38; + +void main() +{ + _32[gl_LocalInvocationIndex] = float(gl_LocalInvocationIndex); + barrier(); + SetMeshOutputsEXT(24u, 8u); + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.x = _32[gl_LocalInvocationIndex]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.y = _32[gl_LocalInvocationIndex]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.z = _32[gl_LocalInvocationIndex]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.w = _32[gl_LocalInvocationIndex]; + float _59 = _38._m0 + _32[gl_LocalInvocationIndex ^ 1u]; + B[gl_LocalInvocationIndex].x = _59; + B[gl_LocalInvocationIndex].y = _59; + B[gl_LocalInvocationIndex].z = _59; + B[gl_LocalInvocationIndex].w = _59; + if (gl_LocalInvocationIndex < 8u) + { + uint _65 = gl_LocalInvocationIndex * 3u; + gl_PrimitiveLineIndicesEXT[gl_LocalInvocationIndex] = uvec2(_65, _65 + 1u); + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_LocalInvocationIndex & 1u) != 0u; + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = int(gl_LocalInvocationIndex); + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = int(gl_LocalInvocationIndex); + uint _77 = gl_LocalInvocationIndex ^ 2u; + C[gl_LocalInvocationIndex].x = _32[_77]; + C[gl_LocalInvocationIndex].y = _32[_77]; + C[gl_LocalInvocationIndex].z = _32[_77]; + C[gl_LocalInvocationIndex].w = _32[_77]; + } +} + + +#if 0 +// SPIR-V disassembly +; SPIR-V +; Version: 1.4 +; Generator: Unknown(30017); 21022 +; Bound: 88 +; Schema: 0 +OpCapability Shader +OpCapability Geometry +OpCapability ShaderViewportIndexLayerEXT +OpCapability MeshShadingEXT +OpExtension "SPV_EXT_mesh_shader" +OpExtension "SPV_EXT_shader_viewport_index_layer" +OpMemoryModel Logical GLSL450 +OpEntryPoint MeshEXT %3 "main" %11 %12 %17 %20 %21 %24 %28 %32 %34 %38 +OpExecutionMode %3 OutputVertices 24 +OpExecutionMode %3 OutputPrimitivesNV 8 +OpExecutionMode %3 OutputLinesNV +OpExecutionMode %3 LocalSize 2 3 4 +OpName %3 "main" +OpName %11 "SV_Position" +OpName %12 "B" +OpName %17 "SV_CullPrimitive" +OpName %20 "SV_RenderTargetArrayIndex" +OpName %21 "SV_PrimitiveID" +OpName %24 "C" +OpName %28 "indices" +OpName %36 "" +OpDecorate %11 BuiltIn Position +OpDecorate %12 Location 1 +OpDecorate %17 BuiltIn CullPrimitiveEXT +OpDecorate %17 PerPrimitiveNV +OpDecorate %20 BuiltIn Layer +OpDecorate %20 PerPrimitiveNV +OpDecorate %21 BuiltIn PrimitiveId +OpDecorate %21 PerPrimitiveNV +OpDecorate %24 Location 3 +OpDecorate %24 PerPrimitiveNV +OpDecorate %28 BuiltIn PrimitiveLineIndicesEXT +OpDecorate %34 BuiltIn LocalInvocationIndex +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%5 = OpTypeFloat 32 +%6 = OpTypeVector %5 4 +%7 = OpTypeInt 32 0 +%8 = OpConstant %7 24 +%9 = OpTypeArray %6 %8 +%10 = OpTypePointer Output %9 +%11 = OpVariable %10 Output +%12 = OpVariable %10 Output +%13 = OpTypeBool +%14 = OpConstant %7 8 +%15 = OpTypeArray %13 %14 +%16 = OpTypePointer Output %15 +%17 = OpVariable %16 Output +%18 = OpTypeArray %7 %14 +%19 = OpTypePointer Output %18 +%20 = OpVariable %19 Output +%21 = OpVariable %19 Output +%22 = OpTypeArray %6 %14 +%23 = OpTypePointer Output %22 +%24 = OpVariable %23 Output +%25 = OpTypeVector %7 2 +%26 = OpTypeArray %25 %14 +%27 = OpTypePointer Output %26 +%28 = OpVariable %27 Output +%29 = OpConstant %7 64 +%30 = OpTypeArray %5 %29 +%31 = OpTypePointer Workgroup %30 +%32 = OpVariable %31 Workgroup +%33 = OpTypePointer Input %7 +%34 = OpVariable %33 Input +%36 = OpTypeStruct %5 +%37 = OpTypePointer TaskPayloadWorkgroupEXT %36 +%38 = OpVariable %37 TaskPayloadWorkgroupEXT +%40 = OpTypePointer Workgroup %5 +%42 = OpConstant %7 2 +%43 = OpConstant %7 264 +%45 = OpTypePointer Output %5 +%47 = OpConstant %7 0 +%49 = OpConstant %7 1 +%52 = OpConstant %7 3 +%56 = OpTypePointer TaskPayloadWorkgroupEXT %5 +%68 = OpTypePointer Output %25 +%72 = OpTypePointer Output %13 +%74 = OpTypePointer Output %7 +%3 = OpFunction %1 None %2 +%4 = OpLabel +OpBranch %84 +%84 = OpLabel +%35 = OpLoad %7 %34 +%39 = OpConvertUToF %5 %35 +%41 = OpAccessChain %40 %32 %35 +OpStore %41 %39 +OpControlBarrier %42 %42 %43 +OpSetMeshOutputsEXT %8 %14 +%44 = OpLoad %5 %41 +%46 = OpAccessChain %45 %11 %35 %47 +OpStore %46 %44 +%48 = OpAccessChain %45 %11 %35 %49 +OpStore %48 %44 +%50 = OpAccessChain %45 %11 %35 %42 +OpStore %50 %44 +%51 = OpAccessChain %45 %11 %35 %52 +OpStore %51 %44 +%53 = OpBitwiseXor %7 %35 %49 +%54 = OpAccessChain %40 %32 %53 +%55 = OpLoad %5 %54 +%57 = OpInBoundsAccessChain %56 %38 %47 +%58 = OpLoad %5 %57 +%59 = OpFAdd %5 %58 %55 +%60 = OpAccessChain %45 %12 %35 %47 +OpStore %60 %59 +%61 = OpAccessChain %45 %12 %35 %49 +OpStore %61 %59 +%62 = OpAccessChain %45 %12 %35 %42 +OpStore %62 %59 +%63 = OpAccessChain %45 %12 %35 %52 +OpStore %63 %59 +%64 = OpULessThan %13 %35 %14 +OpSelectionMerge %86 None +OpBranchConditional %64 %85 %86 +%85 = OpLabel +%65 = OpIMul %7 %35 %52 +%66 = OpIAdd %7 %65 %49 +%67 = OpCompositeConstruct %25 %65 %66 +%69 = OpAccessChain %68 %28 %35 +OpStore %69 %67 +%70 = OpBitwiseAnd %7 %35 %49 +%71 = OpINotEqual %13 %70 %47 +%73 = OpAccessChain %72 %17 %35 +OpStore %73 %71 +%75 = OpAccessChain %74 %21 %35 +OpStore %75 %35 +%76 = OpAccessChain %74 %20 %35 +OpStore %76 %35 +%77 = OpBitwiseXor %7 %35 %42 +%78 = OpAccessChain %40 %32 %77 +%79 = OpLoad %5 %78 +%80 = OpAccessChain %45 %24 %35 %47 +OpStore %80 %79 +%81 = OpAccessChain %45 %24 %35 %49 +OpStore %81 %79 +%82 = OpAccessChain %45 %24 %35 %42 +OpStore %82 %79 +%83 = OpAccessChain %45 %24 %35 %52 +OpStore %83 %79 +OpBranch %86 +%86 = OpLabel +OpReturn +OpFunctionEnd +#endif diff --git a/reference/shaders/stages/mesh-basic.mesh b/reference/shaders/stages/mesh-basic.mesh new file mode 100644 index 0000000..bcd6b20 --- /dev/null +++ b/reference/shaders/stages/mesh-basic.mesh @@ -0,0 +1,198 @@ +#version 460 +#extension GL_EXT_mesh_shader : require +layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) in; +layout(max_vertices = 24, max_primitives = 8, triangles) out; + +struct _36 +{ + float _m0; +}; + +layout(location = 1) out vec4 B[24]; +layout(location = 3) perprimitiveEXT out vec4 C[8]; +shared float _32[64]; +taskPayloadSharedEXT _36 _38; + +void main() +{ + _32[gl_LocalInvocationIndex] = float(gl_LocalInvocationIndex); + barrier(); + SetMeshOutputsEXT(24u, 8u); + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.x = _32[gl_LocalInvocationIndex]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.y = _32[gl_LocalInvocationIndex]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.z = _32[gl_LocalInvocationIndex]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.w = _32[gl_LocalInvocationIndex]; + float _59 = _38._m0 + _32[gl_LocalInvocationIndex ^ 1u]; + B[gl_LocalInvocationIndex].x = _59; + B[gl_LocalInvocationIndex].y = _59; + B[gl_LocalInvocationIndex].z = _59; + B[gl_LocalInvocationIndex].w = _59; + if (gl_LocalInvocationIndex < 8u) + { + uint _65 = gl_LocalInvocationIndex * 3u; + gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uvec3(_65, _65 + 1u, _65 + 2u); + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_LocalInvocationIndex & 1u) != 0u; + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = int(gl_LocalInvocationIndex); + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = int(gl_LocalInvocationIndex); + uint _78 = gl_LocalInvocationIndex ^ 2u; + C[gl_LocalInvocationIndex].x = _32[_78]; + C[gl_LocalInvocationIndex].y = _32[_78]; + C[gl_LocalInvocationIndex].z = _32[_78]; + C[gl_LocalInvocationIndex].w = _32[_78]; + } +} + + +#if 0 +// SPIR-V disassembly +; SPIR-V +; Version: 1.4 +; Generator: Unknown(30017); 21022 +; Bound: 89 +; Schema: 0 +OpCapability Shader +OpCapability Geometry +OpCapability ShaderViewportIndexLayerEXT +OpCapability MeshShadingEXT +OpExtension "SPV_EXT_mesh_shader" +OpExtension "SPV_EXT_shader_viewport_index_layer" +OpMemoryModel Logical GLSL450 +OpEntryPoint MeshEXT %3 "main" %11 %12 %17 %20 %21 %24 %28 %32 %34 %38 +OpExecutionMode %3 OutputVertices 24 +OpExecutionMode %3 OutputPrimitivesNV 8 +OpExecutionMode %3 OutputTrianglesNV +OpExecutionMode %3 LocalSize 2 3 4 +OpName %3 "main" +OpName %11 "SV_Position" +OpName %12 "B" +OpName %17 "SV_CullPrimitive" +OpName %20 "SV_RenderTargetArrayIndex" +OpName %21 "SV_PrimitiveID" +OpName %24 "C" +OpName %28 "indices" +OpName %36 "" +OpDecorate %11 BuiltIn Position +OpDecorate %12 Location 1 +OpDecorate %17 BuiltIn CullPrimitiveEXT +OpDecorate %17 PerPrimitiveNV +OpDecorate %20 BuiltIn Layer +OpDecorate %20 PerPrimitiveNV +OpDecorate %21 BuiltIn PrimitiveId +OpDecorate %21 PerPrimitiveNV +OpDecorate %24 Location 3 +OpDecorate %24 PerPrimitiveNV +OpDecorate %28 BuiltIn PrimitiveTriangleIndicesEXT +OpDecorate %34 BuiltIn LocalInvocationIndex +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%5 = OpTypeFloat 32 +%6 = OpTypeVector %5 4 +%7 = OpTypeInt 32 0 +%8 = OpConstant %7 24 +%9 = OpTypeArray %6 %8 +%10 = OpTypePointer Output %9 +%11 = OpVariable %10 Output +%12 = OpVariable %10 Output +%13 = OpTypeBool +%14 = OpConstant %7 8 +%15 = OpTypeArray %13 %14 +%16 = OpTypePointer Output %15 +%17 = OpVariable %16 Output +%18 = OpTypeArray %7 %14 +%19 = OpTypePointer Output %18 +%20 = OpVariable %19 Output +%21 = OpVariable %19 Output +%22 = OpTypeArray %6 %14 +%23 = OpTypePointer Output %22 +%24 = OpVariable %23 Output +%25 = OpTypeVector %7 3 +%26 = OpTypeArray %25 %14 +%27 = OpTypePointer Output %26 +%28 = OpVariable %27 Output +%29 = OpConstant %7 64 +%30 = OpTypeArray %5 %29 +%31 = OpTypePointer Workgroup %30 +%32 = OpVariable %31 Workgroup +%33 = OpTypePointer Input %7 +%34 = OpVariable %33 Input +%36 = OpTypeStruct %5 +%37 = OpTypePointer TaskPayloadWorkgroupEXT %36 +%38 = OpVariable %37 TaskPayloadWorkgroupEXT +%40 = OpTypePointer Workgroup %5 +%42 = OpConstant %7 2 +%43 = OpConstant %7 264 +%45 = OpTypePointer Output %5 +%47 = OpConstant %7 0 +%49 = OpConstant %7 1 +%52 = OpConstant %7 3 +%56 = OpTypePointer TaskPayloadWorkgroupEXT %5 +%69 = OpTypePointer Output %25 +%73 = OpTypePointer Output %13 +%75 = OpTypePointer Output %7 +%3 = OpFunction %1 None %2 +%4 = OpLabel +OpBranch %85 +%85 = OpLabel +%35 = OpLoad %7 %34 +%39 = OpConvertUToF %5 %35 +%41 = OpAccessChain %40 %32 %35 +OpStore %41 %39 +OpControlBarrier %42 %42 %43 +OpSetMeshOutputsEXT %8 %14 +%44 = OpLoad %5 %41 +%46 = OpAccessChain %45 %11 %35 %47 +OpStore %46 %44 +%48 = OpAccessChain %45 %11 %35 %49 +OpStore %48 %44 +%50 = OpAccessChain %45 %11 %35 %42 +OpStore %50 %44 +%51 = OpAccessChain %45 %11 %35 %52 +OpStore %51 %44 +%53 = OpBitwiseXor %7 %35 %49 +%54 = OpAccessChain %40 %32 %53 +%55 = OpLoad %5 %54 +%57 = OpInBoundsAccessChain %56 %38 %47 +%58 = OpLoad %5 %57 +%59 = OpFAdd %5 %58 %55 +%60 = OpAccessChain %45 %12 %35 %47 +OpStore %60 %59 +%61 = OpAccessChain %45 %12 %35 %49 +OpStore %61 %59 +%62 = OpAccessChain %45 %12 %35 %42 +OpStore %62 %59 +%63 = OpAccessChain %45 %12 %35 %52 +OpStore %63 %59 +%64 = OpULessThan %13 %35 %14 +OpSelectionMerge %87 None +OpBranchConditional %64 %86 %87 +%86 = OpLabel +%65 = OpIMul %7 %35 %52 +%66 = OpIAdd %7 %65 %49 +%67 = OpIAdd %7 %65 %42 +%68 = OpCompositeConstruct %25 %65 %66 %67 +%70 = OpAccessChain %69 %28 %35 +OpStore %70 %68 +%71 = OpBitwiseAnd %7 %35 %49 +%72 = OpINotEqual %13 %71 %47 +%74 = OpAccessChain %73 %17 %35 +OpStore %74 %72 +%76 = OpAccessChain %75 %21 %35 +OpStore %76 %35 +%77 = OpAccessChain %75 %20 %35 +OpStore %77 %35 +%78 = OpBitwiseXor %7 %35 %42 +%79 = OpAccessChain %40 %32 %78 +%80 = OpLoad %5 %79 +%81 = OpAccessChain %45 %24 %35 %47 +OpStore %81 %80 +%82 = OpAccessChain %45 %24 %35 %49 +OpStore %82 %80 +%83 = OpAccessChain %45 %24 %35 %42 +OpStore %83 %80 +%84 = OpAccessChain %45 %24 %35 %52 +OpStore %84 %80 +OpBranch %87 +%87 = OpLabel +OpReturn +OpFunctionEnd +#endif diff --git a/reference/shaders/stages/task-basic.task b/reference/shaders/stages/task-basic.task new file mode 100644 index 0000000..9a42de6 --- /dev/null +++ b/reference/shaders/stages/task-basic.task @@ -0,0 +1,74 @@ +#version 460 +#extension GL_EXT_mesh_shader : require +layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; + +struct _11 +{ + float _m0[64][4]; +}; + +taskPayloadSharedEXT _11 _13; + +void main() +{ + float _17 = float(gl_LocalInvocationIndex); + _13._m0[gl_LocalInvocationIndex][0u] = _17; + _13._m0[gl_LocalInvocationIndex][1u] = _17; + _13._m0[gl_LocalInvocationIndex][2u] = _17; + _13._m0[gl_LocalInvocationIndex][3u] = _17; + EmitMeshTasksEXT(2u, 3u, 4u); +} + + +#if 0 +// SPIR-V disassembly +; SPIR-V +; Version: 1.4 +; Generator: Unknown(30017); 21022 +; Bound: 29 +; Schema: 0 +OpCapability Shader +OpCapability MeshShadingEXT +OpExtension "SPV_EXT_mesh_shader" +OpMemoryModel Logical GLSL450 +OpEntryPoint TaskEXT %3 "main" %13 %15 +OpExecutionMode %3 LocalSize 64 1 1 +OpName %3 "main" +OpName %11 "" +OpDecorate %15 BuiltIn LocalInvocationIndex +%1 = OpTypeVoid +%2 = OpTypeFunction %1 +%5 = OpTypeInt 32 0 +%6 = OpConstant %5 64 +%7 = OpConstant %5 4 +%8 = OpTypeFloat 32 +%9 = OpTypeArray %8 %7 +%10 = OpTypeArray %9 %6 +%11 = OpTypeStruct %10 +%12 = OpTypePointer TaskPayloadWorkgroupEXT %11 +%13 = OpVariable %12 TaskPayloadWorkgroupEXT +%14 = OpTypePointer Input %5 +%15 = OpVariable %14 Input +%18 = OpTypePointer TaskPayloadWorkgroupEXT %8 +%20 = OpConstant %5 0 +%22 = OpConstant %5 1 +%24 = OpConstant %5 2 +%26 = OpConstant %5 3 +%3 = OpFunction %1 None %2 +%4 = OpLabel +OpBranch %27 +%27 = OpLabel +%16 = OpLoad %5 %15 +%17 = OpConvertUToF %8 %16 +%19 = OpAccessChain %18 %13 %20 %16 %20 +OpStore %19 %17 +%21 = OpAccessChain %18 %13 %20 %16 %22 +OpStore %21 %17 +%23 = OpAccessChain %18 %13 %20 %16 %24 +OpStore %23 %17 +%25 = OpAccessChain %18 %13 %20 %16 %26 +OpStore %25 %17 +OpEmitMeshTasksEXT %24 %26 %7 %13 +OpReturn +OpFunctionEnd +#endif diff --git a/reference/shaders/vectorization/copy-byte-address.ssbo.comp b/reference/shaders/vectorization/copy-byte-address.ssbo.comp index 2a2b9eb..2a18c6f 100644 --- a/reference/shaders/vectorization/copy-byte-address.ssbo.comp +++ b/reference/shaders/vectorization/copy-byte-address.ssbo.comp @@ -1,7 +1,11 @@ #version 460 #extension GL_EXT_shader_explicit_arithmetic_types_int16 : require #extension GL_EXT_shader_16bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #if defined(GL_AMD_gpu_shader_half_float) #extension GL_AMD_gpu_shader_half_float : require #elif defined(GL_EXT_shader_explicit_arithmetic_types_float16) diff --git a/reference/shaders/vectorization/copy-double2.ssbo.comp b/reference/shaders/vectorization/copy-double2.ssbo.comp index 29566ec..da9429c 100644 --- a/reference/shaders/vectorization/copy-double2.ssbo.comp +++ b/reference/shaders/vectorization/copy-double2.ssbo.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif layout(local_size_x = 2, local_size_y = 1, local_size_z = 1) in; layout(set = 0, binding = 0, std430) readonly buffer SSBO diff --git a/reference/shaders/vectorization/copy-double2.ssbo.ssbo-align.bindless.comp b/reference/shaders/vectorization/copy-double2.ssbo.ssbo-align.bindless.comp index 8c9fc16..5c72f19 100644 --- a/reference/shaders/vectorization/copy-double2.ssbo.ssbo-align.bindless.comp +++ b/reference/shaders/vectorization/copy-double2.ssbo.ssbo-align.bindless.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_nonuniform_qualifier : require #extension GL_KHR_shader_subgroup_ballot : require diff --git a/reference/shaders/vectorization/copy-double3.ssbo.comp b/reference/shaders/vectorization/copy-double3.ssbo.comp index f8726fc..e395e38 100644 --- a/reference/shaders/vectorization/copy-double3.ssbo.comp +++ b/reference/shaders/vectorization/copy-double3.ssbo.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_scalar_block_layout : require layout(local_size_x = 2, local_size_y = 1, local_size_z = 1) in; diff --git a/reference/shaders/vectorization/copy-double3.ssbo.ssbo-align.bindless.comp b/reference/shaders/vectorization/copy-double3.ssbo.ssbo-align.bindless.comp index e596cd4..cd9522f 100644 --- a/reference/shaders/vectorization/copy-double3.ssbo.ssbo-align.bindless.comp +++ b/reference/shaders/vectorization/copy-double3.ssbo.ssbo-align.bindless.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif #extension GL_EXT_buffer_reference : require #extension GL_EXT_nonuniform_qualifier : require #extension GL_KHR_shader_subgroup_ballot : require diff --git a/reference/shaders/vectorization/copy-double4.ssbo.comp b/reference/shaders/vectorization/copy-double4.ssbo.comp index 4ce6ac6..a1a53b4 100644 --- a/reference/shaders/vectorization/copy-double4.ssbo.comp +++ b/reference/shaders/vectorization/copy-double4.ssbo.comp @@ -1,5 +1,9 @@ #version 460 +#if defined(GL_ARB_gpu_shader_int64) #extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif layout(local_size_x = 2, local_size_y = 1, local_size_z = 1) in; layout(set = 0, binding = 0, std430) readonly buffer SSBO diff --git a/roundtrip_shaders.py b/roundtrip_shaders.py index 6aea71f..4499e97 100755 --- a/roundtrip_shaders.py +++ b/roundtrip_shaders.py @@ -71,6 +71,8 @@ def convert_shaders(args): results.append(pool.apply_async(convert_spirv, args = (in_path, out_path, args, 'rchit'))) results.append(pool.apply_async(convert_spirv, args = (in_path, out_path, args, 'rmiss'))) results.append(pool.apply_async(convert_spirv, args = (in_path, out_path, args, 'rcall'))) + results.append(pool.apply_async(convert_spirv, args = (in_path, out_path, args, 'mesh'))) + results.append(pool.apply_async(convert_spirv, args = (in_path, out_path, args, 'task'))) for res in results: res.get() diff --git a/shaders/stages/mesh-basic-line.mesh b/shaders/stages/mesh-basic-line.mesh new file mode 100644 index 0000000..8602031 --- /dev/null +++ b/shaders/stages/mesh-basic-line.mesh @@ -0,0 +1,43 @@ +struct VOut +{ + float4 pos : SV_Position; + float4 b : B; +}; + +struct PrimOut +{ + bool cull : SV_CullPrimitive; + uint layer : SV_RenderTargetArrayIndex; + uint primid : SV_PrimitiveID; + float4 c : C; +}; + +groupshared float foo[64]; + +struct Payload +{ + float p; +}; + +[numthreads(2, 3, 4)] +[outputtopology("line")] +void main(uint tid : SV_GroupIndex, + in payload Payload p, + out vertices VOut vout[24], + out indices uint2 ind[8], + out primitives PrimOut prim[8]) +{ + foo[tid] = float(tid); + GroupMemoryBarrierWithGroupSync(); + SetMeshOutputCounts(24, 8); + vout[tid].pos = foo[tid].xxxx; + vout[tid].b = foo[tid ^ 1].xxxx + p.p; + if (tid < 8) + { + ind[tid] = 3 * tid + uint2(0, 1); + prim[tid].cull = bool(tid & 1); + prim[tid].primid = tid; + prim[tid].layer = tid; + prim[tid].c = foo[tid ^ 2].xxxx; + } +} diff --git a/shaders/stages/mesh-basic.mesh b/shaders/stages/mesh-basic.mesh new file mode 100644 index 0000000..cf23bc2 --- /dev/null +++ b/shaders/stages/mesh-basic.mesh @@ -0,0 +1,43 @@ +struct VOut +{ + float4 pos : SV_Position; + float4 b : B; +}; + +struct PrimOut +{ + bool cull : SV_CullPrimitive; + uint layer : SV_RenderTargetArrayIndex; + uint primid : SV_PrimitiveID; + float4 c : C; +}; + +groupshared float foo[64]; + +struct Payload +{ + float p; +}; + +[numthreads(2, 3, 4)] +[outputtopology("triangle")] +void main(uint tid : SV_GroupIndex, + in payload Payload p, + out vertices VOut vout[24], + out indices uint3 ind[8], + out primitives PrimOut prim[8]) +{ + foo[tid] = float(tid); + GroupMemoryBarrierWithGroupSync(); + SetMeshOutputCounts(24, 8); + vout[tid].pos = foo[tid].xxxx; + vout[tid].b = foo[tid ^ 1].xxxx + p.p; + if (tid < 8) + { + ind[tid] = 3 * tid + uint3(0, 1, 2); + prim[tid].cull = bool(tid & 1); + prim[tid].primid = tid; + prim[tid].layer = tid; + prim[tid].c = foo[tid ^ 2].xxxx; + } +} diff --git a/shaders/stages/task-basic.task b/shaders/stages/task-basic.task new file mode 100644 index 0000000..755bbdf --- /dev/null +++ b/shaders/stages/task-basic.task @@ -0,0 +1,13 @@ +struct Payload +{ + float4 p[64]; +}; + +groupshared Payload p; + +[numthreads(64, 1, 1)] +void main(uint tid : SV_GroupIndex) +{ + p.p[tid] = float(tid).xxxx; + DispatchMesh(2, 3, 4, p); +} diff --git a/test_shaders.py b/test_shaders.py index 521bc8c..d435ef9 100755 --- a/test_shaders.py +++ b/test_shaders.py @@ -56,6 +56,7 @@ def create_temporary(suff = ''): def get_sm(shader, version_minor): minor_version = '_{}'.format(version_minor) lib_version = 'lib_6_{}'.format(5 if version_minor <= 5 else 6) + mesh_version = '_{}'.format(5 if version_minor <= 5 else version_minor) _, ext = os.path.splitext(shader) if ext == '.vert': return 'vs_6' + minor_version @@ -69,6 +70,10 @@ def get_sm(shader, version_minor): return 'ds_6' + minor_version elif ext == '.geom': return 'gs_6' + minor_version + elif ext == '.mesh': + return 'ms_6' + mesh_version + elif ext == '.task': + return 'as_6' + mesh_version elif ext == '.rmiss': return lib_version elif ext == '.rint': diff --git a/third_party/SPIRV-Cross b/third_party/SPIRV-Cross -Subproject b3ff97d0feafd2b7ca72aec7215cfc3d0998fb7 +Subproject 210a80013067672b52847ec7aa70ff78b2f4d77 diff --git a/third_party/SPIRV-Tools b/third_party/SPIRV-Tools -Subproject 4c456f7da67c5437a6fb7d4d20d78e2a5ae2acf +Subproject 5f45f793ae962a84c71a9b7ff434591c57cdad5 |