Skip to content

Commit

Permalink
update rspirv: add support for bary_coord_hkr, but keep _nv variant a…
Browse files Browse the repository at this point in the history
…round
  • Loading branch information
Firestar99 committed Feb 7, 2024
1 parent a90f9e2 commit 08575eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions crates/rustc_codegen_spirv/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 3 additions & 1 deletion tests/ui/spirv-attr/all-builtins.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 08575eb

Please sign in to comment.