This is an archive of the discontinued LLVM Phabricator instance.

[Sema][HLSL] Fix naming of anyhit/closesthit shaders
ClosedPublic

Authored by bogner on Aug 25 2023, 12:35 AM.

Details

Summary

Also test all shader types and be a bit more careful to make shaders
reasonably valid in these tests.

Diff Detail

Event Timeline

bogner created this revision.Aug 25 2023, 12:35 AM
Herald added a project: Restricted Project. · View Herald Transcript
bogner requested review of this revision.Aug 25 2023, 12:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 12:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bob80905 added inline comments.
clang/test/SemaHLSL/shader_type_attr.hlsl
30

I don't think we should expect this error, given that there is no previous declaration for doubledUp(). Maybe something else like %0 and %1 are incompatible attributes?

bogner added inline comments.Aug 25 2023, 11:05 AM
clang/test/SemaHLSL/shader_type_attr.hlsl
30

I don't necessarily disagree, but if we're going to change that I think it should be in a different change than this one.

bob80905 added inline comments.Aug 25 2023, 11:44 AM
clang/test/SemaHLSL/entry_shader.hlsl
1

Why was this changed to mesh instead of "anyhit" ?

clang/test/SemaHLSL/shader_type_attr.hlsl
30

I'm also curious, why is the change from compute to pixel necessary here?

beanz added inline comments.Aug 25 2023, 11:49 AM
clang/test/SemaHLSL/shader_type_attr.hlsl
30

I suspect this change is just to prevent the presence of the compute annotation from triggering the missing numthreads error.

61

Oh interesting! DXC doesn't actually support this syntax, but I think it is worth supporting in Clang.
Should we also check for the numthreads attribute?

beanz accepted this revision.Aug 25 2023, 11:50 AM
This revision is now accepted and ready to land.Aug 25 2023, 11:50 AM
bogner added inline comments.Aug 25 2023, 12:20 PM
clang/test/SemaHLSL/entry_shader.hlsl
1

Another case of trying to keep things to one error - anyhit doesn't support the numthreads attribute

clang/test/SemaHLSL/shader_type_attr.hlsl
30

That's correct - just trying to keep to testing the conflicting attribute error and not have a spurious numthreads as well.

61

Hm, it might be better to stick to the syntax dxc handles for these tests at least. I'll update that. Sure, checking both attributes seems like a good idea.

bob80905 accepted this revision.Aug 25 2023, 12:26 PM
bogner updated this revision to Diff 553588.Aug 25 2023, 1:09 PM

Address feedback and simplify valid shader stage test

This revision was landed with ongoing or failed builds.Aug 25 2023, 1:17 PM
This revision was automatically updated to reflect the committed changes.