diff --git a/CHANGELOG.md b/CHANGELOG.md index f67eff2712..64fcf5e1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed 🛠 - [PR#1118](https://github.com/EmbarkStudios/rust-gpu/pull/1118) update rspirv to 0.12 - - `bary_coord_nv`/`bary_coord_no_persp_nv` have their `_nv` suffix omitted + - added support for `VK_KHR_fragment_shader_barycentric` with `bary_coord`/`bary_coord_no_persp` buildins - [PR#1127](https://github.com/EmbarkStudios/rust-gpu/pull/1127) updated `spirv-tools` to `0.10.0`, which follows `vulkan-sdk-1.3.275`. - [PR#1101](https://github.com/EmbarkStudios/rust-gpu/pull/1101) Add `ignore` and `no_run` to documentation to make `cargo test` pass. - [PR#1112](https://github.com/EmbarkStudios/rust-gpu/pull/1112) updated wgpu and winit in example runners diff --git a/crates/rustc_codegen_spirv/src/symbols.rs b/crates/rustc_codegen_spirv/src/symbols.rs index 98bc6d4727..80a33ba97e 100644 --- a/crates/rustc_codegen_spirv/src/symbols.rs +++ b/crates/rustc_codegen_spirv/src/symbols.rs @@ -118,6 +118,8 @@ const BUILTINS: &[(&str, BuiltIn)] = { ("layer_per_view_nv", LayerPerViewNV), ("mesh_view_count_nv", MeshViewCountNV), ("mesh_view_indices_nv", MeshViewIndicesNV), + ("bary_coord_nv", BuiltIn::BaryCoordNV), + ("bary_coord_no_persp_nv", BuiltIn::BaryCoordNoPerspNV), ("bary_coord", BaryCoordKHR), ("bary_coord_no_persp", BaryCoordNoPerspKHR), ("frag_size_ext", FragSizeEXT), diff --git a/tests/ui/spirv-attr/all-builtins.rs b/tests/ui/spirv-attr/all-builtins.rs index 3f79ae484e..8ad8a988a0 100644 --- a/tests/ui/spirv-attr/all-builtins.rs +++ b/tests/ui/spirv-attr/all-builtins.rs @@ -1,6 +1,6 @@ // build-pass // only-vulkan1.1 -// compile-flags: -Ctarget-feature=+DeviceGroup,+DrawParameters,+FragmentBarycentricNV,+FragmentDensityEXT,+FragmentFullyCoveredEXT,+Geometry,+GroupNonUniform,+GroupNonUniformBallot,+MeshShadingNV,+MultiView,+MultiViewport,+RayTracingKHR,+SampleRateShading,+ShaderSMBuiltinsNV,+ShaderStereoViewNV,+StencilExportEXT,+Tessellation,+ext:SPV_AMD_shader_explicit_vertex_parameter,+ext:SPV_EXT_fragment_fully_covered,+ext:SPV_EXT_fragment_invocation_density,+ext:SPV_EXT_shader_stencil_export,+ext:SPV_KHR_ray_tracing,+ext:SPV_NV_fragment_shader_barycentric,+ext:SPV_NV_mesh_shader,+ext:SPV_NV_shader_sm_builtins,+ext:SPV_NV_stereo_view_rendering +// compile-flags: -Ctarget-feature=+DeviceGroup,+DrawParameters,+FragmentBarycentricNV,+FragmentBarycentricKHR,+FragmentDensityEXT,+FragmentFullyCoveredEXT,+Geometry,+GroupNonUniform,+GroupNonUniformBallot,+MeshShadingNV,+MultiView,+MultiViewport,+RayTracingKHR,+SampleRateShading,+ShaderSMBuiltinsNV,+ShaderStereoViewNV,+StencilExportEXT,+Tessellation,+ext:SPV_AMD_shader_explicit_vertex_parameter,+ext:SPV_EXT_fragment_fully_covered,+ext:SPV_EXT_fragment_invocation_density,+ext:SPV_EXT_shader_stencil_export,+ext:SPV_KHR_ray_tracing,+ext:SPV_NV_fragment_shader_barycentric,+ext:SPV_NV_mesh_shader,+ext:SPV_NV_shader_sm_builtins,+ext:SPV_NV_stereo_view_rendering use spirv_std::glam::*; use spirv_std::spirv; @@ -82,10 +82,12 @@ pub fn vertex( #[spirv(fragment)] pub fn fragment( + #[spirv(bary_coord_no_persp)] bary_coord_no_persp: Vec3, #[spirv(bary_coord_no_persp_amd)] bary_coord_no_persp_amd: Vec3, #[spirv(bary_coord_no_persp_centroid_amd)] bary_coord_no_persp_centroid_amd: Vec3, #[spirv(bary_coord_no_persp_nv)] bary_coord_no_persp_nv: Vec3, #[spirv(bary_coord_no_persp_sample_amd)] bary_coord_no_persp_sample_amd: Vec3, + #[spirv(bary_coord)] bary_coord: Vec3, #[spirv(bary_coord_nv)] bary_coord_nv: Vec3, #[spirv(bary_coord_pull_model_amd)] bary_coord_pull_model_amd: Vec3, #[spirv(bary_coord_smooth_amd)] bary_coord_smooth_amd: Vec3,