Skip to content

Commit cb9c604

Browse files
committed
update rspirv: add support for bary_coord_hkr, but keep _nv variant around
1 parent 3847e90 commit cb9c604

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636
- [PR#12](https://github.com/rust-gpu/rust-gpu/pull/12) updated toolchain to `nightly-2024-04-24`
3737
- [PR#9](https://github.com/Rust-GPU/rust-gpu/pull/9) relaxed `glam` version requirements (`>=0.22, <=0.29`)
3838
- [PR#1118](https://github.com/EmbarkStudios/rust-gpu/pull/1118) update rspirv to 0.12
39-
- `bary_coord_nv`/`bary_coord_no_persp_nv` have their `_nv` suffix omitted
39+
- added support for `VK_KHR_fragment_shader_barycentric` with `bary_coord`/`bary_coord_no_persp` buildins
4040
- [PR#1127](https://github.com/EmbarkStudios/rust-gpu/pull/1127) updated `spirv-tools` to `0.10.0`, which follows `vulkan-sdk-1.3.275`
4141
- [PR#1101](https://github.com/EmbarkStudios/rust-gpu/pull/1101) added `ignore` and `no_run` to documentation to make `cargo test` pass
4242
- [PR#1112](https://github.com/EmbarkStudios/rust-gpu/pull/1112) updated wgpu and winit in example runners

crates/rustc_codegen_spirv/src/symbols.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ const BUILTINS: &[(&str, BuiltIn)] = {
116116
("layer_per_view_nv", LayerPerViewNV),
117117
("mesh_view_count_nv", MeshViewCountNV),
118118
("mesh_view_indices_nv", MeshViewIndicesNV),
119+
("bary_coord_nv", BuiltIn::BaryCoordNV),
120+
("bary_coord_no_persp_nv", BuiltIn::BaryCoordNoPerspNV),
119121
("bary_coord", BaryCoordKHR),
120122
("bary_coord_no_persp", BaryCoordNoPerspKHR),
121123
("frag_size_ext", FragSizeEXT),

tests/ui/spirv-attr/all-builtins.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// build-pass
22
// only-vulkan1.1
3-
// 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
3+
// 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
44

55
use spirv_std::glam::*;
66
use spirv_std::spirv;
@@ -82,11 +82,11 @@ pub fn vertex(
8282

8383
#[spirv(fragment)]
8484
pub fn fragment(
85+
#[spirv(bary_coord_no_persp)] bary_coord_no_persp: Vec3,
8586
#[spirv(bary_coord_no_persp_amd)] bary_coord_no_persp_amd: Vec3,
8687
#[spirv(bary_coord_no_persp_centroid_amd)] bary_coord_no_persp_centroid_amd: Vec3,
87-
#[spirv(bary_coord_no_persp_nv)] bary_coord_no_persp_nv: Vec3,
8888
#[spirv(bary_coord_no_persp_sample_amd)] bary_coord_no_persp_sample_amd: Vec3,
89-
#[spirv(bary_coord_nv)] bary_coord_nv: Vec3,
89+
#[spirv(bary_coord)] bary_coord: Vec3,
9090
#[spirv(bary_coord_pull_model_amd)] bary_coord_pull_model_amd: Vec3,
9191
#[spirv(bary_coord_smooth_amd)] bary_coord_smooth_amd: Vec3,
9292
#[spirv(bary_coord_smooth_centroid_amd)] bary_coord_smooth_centroid_amd: Vec3,

0 commit comments

Comments
 (0)