Skip to content

Commit

Permalink
MSL: centroid/sample barycentrics aren't supported after all.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKristian-Work committed Nov 13, 2024
1 parent f669d0c commit 5b93397
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 228 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 10 additions & 2 deletions spirv_msl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13063,7 +13063,11 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
{
if (!quals.empty())
quals += ", ";
if (has_member_decoration(type.self, index, DecorationNoPerspective) || builtin == BuiltInBaryCoordNoPerspKHR)

if (builtin == BuiltInBaryCoordNoPerspKHR || builtin == BuiltInBaryCoordKHR)
SPIRV_CROSS_THROW("Centroid interpolation not supported for barycentrics in MSL.");

if (has_member_decoration(type.self, index, DecorationNoPerspective))
quals += "centroid_no_perspective";
else
quals += "centroid_perspective";
Expand All @@ -13072,7 +13076,11 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
{
if (!quals.empty())
quals += ", ";
if (has_member_decoration(type.self, index, DecorationNoPerspective) || builtin == BuiltInBaryCoordNoPerspKHR)

if (builtin == BuiltInBaryCoordNoPerspKHR || builtin == BuiltInBaryCoordKHR)
SPIRV_CROSS_THROW("Sample interpolation not supported for barycentrics in MSL.");

if (has_member_decoration(type.self, index, DecorationNoPerspective))
quals += "sample_no_perspective";
else
quals += "sample_perspective";
Expand Down

0 comments on commit 5b93397

Please sign in to comment.