diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 9ac33c8dbb..d370a62334 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -1703,6 +1703,12 @@ std::string GeneratorImpl::builtin_to_attribute(ast::Builtin builtin) const { return "SV_GroupIndex"; case ast::Builtin::kGlobalInvocationId: return "SV_DispatchThreadID"; + case ast::Builtin::kSampleId: + return "SV_SampleIndex"; + case ast::Builtin::kSampleMaskIn: + return "SV_Coverage"; + case ast::Builtin::kSampleMaskOut: + return "SV_Coverage"; default: break; } diff --git a/src/writer/hlsl/generator_impl_test.cc b/src/writer/hlsl/generator_impl_test.cc index cae4d60200..33d8f5ba59 100644 --- a/src/writer/hlsl/generator_impl_test.cc +++ b/src/writer/hlsl/generator_impl_test.cc @@ -95,7 +95,10 @@ INSTANTIATE_TEST_SUITE_P( HlslBuiltinData{ast::Builtin::kLocalInvocationId, "SV_GroupThreadID"}, HlslBuiltinData{ast::Builtin::kLocalInvocationIndex, "SV_GroupIndex"}, HlslBuiltinData{ast::Builtin::kGlobalInvocationId, - "SV_DispatchThreadID"})); + "SV_DispatchThreadID"}, + HlslBuiltinData{ast::Builtin::kSampleId, "SV_SampleIndex"}, + HlslBuiltinData{ast::Builtin::kSampleMaskIn, "SV_Coverage"}, + HlslBuiltinData{ast::Builtin::kSampleMaskOut, "SV_Coverage"})); } // namespace } // namespace hlsl