Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/DxilValidation/DxilValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,9 @@ static bool ValidateType(Type *Ty, ValidationContext &ValCtx,
// Allow HitObject type.
if (ST == HlslOP->GetHitObjectType())
return true;
// Allow LinAlgMatrix type.
if (dxilutil::IsHLSLLinAlgMatrixType(ST))
return true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for now, but as a follow up, I think we'll have to be careful where we allow this type in DXIL. For instance, we probably shouldn't allow it in user function parameters or return types. We should probably file an issue, since this change alone might lead us to be overly-permissive of the type.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are a couple cases were it is in the return type of final DXIL but I'll go ahead and file an issues to tighten this up

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (IsDxilBuiltinStructType(ST, HlslOP)) {
ValCtx.EmitTypeError(Ty, ValidationRule::InstrDxilStructUser);
Result = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
; RUN: %dxv %s 2>&1 | FileCheck %s

; CHECK-NOT: uses a reserved prefix.
; CHECK-NOT: Validation failed.
; CHECK: Validation succeeded.

target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64"
target triple = "dxil-ms-dx"

%dx.types.LinAlgMatrixC8M16N16U0S0 = type { i8* }
%struct.ByteAddressBuffer = type { i32 }

define void @main() {
%1 = alloca %dx.types.LinAlgMatrixC8M16N16U0S0
ret void
}

!dx.targetTypes = !{!0}
!llvm.ident = !{!1}
!dx.version = !{!2}
!dx.valver = !{!2}
!dx.shaderModel = !{!3}
!dx.resources = !{!4}
!dx.entryPoints = !{!7}

!0 = !{%dx.types.LinAlgMatrixC8M16N16U0S0 undef, i32 8, i32 16, i32 16, i32 0, i32 0}
!1 = !{!"dxc(private) 1.9.0.5348 (issue-8433, 167fd829e-dirty)"}
!2 = !{i32 1, i32 10}
!3 = !{!"cs", i32 6, i32 10}
!4 = !{!5, null, null, null}
!5 = !{!6}
!6 = !{i32 0, %struct.ByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i32 0, null}
!7 = !{void ()* @main, !"main", null, !4, !8}
!8 = !{i32 0, i64 8388625, i32 4, !9}
!9 = !{i32 8, i32 1, i32 1}
Loading