Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXIL Validator doesn't notice obviously bad indices in the createHandleFromBinding op #7019

Open
bogner opened this issue Nov 22, 2024 · 0 comments
Labels
bug Bug, regression, crash needs-triage Awaiting triage

Comments

@bogner
Copy link
Collaborator

bogner commented Nov 22, 2024

Description
Giving the CreateHandle operation an index that is less-than the binding lower bound fails validation:

Function: main: error: Constant values must be in-range for operation.
note: at '%0 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 1, i32 1, i32 0, i1 false)' in block 'entry' of function 'main'.

However, this passes the validator if we have the same error but are using DXIL 1.6+'s CreateHandleFromBinding.

Steps to Reproduce
Craft a resource binding with a lower bound greater than zero and then index it at 0.

; call has binding info starting at 1 but index at 0:
call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 1, i32 1, i32 4, i8 1 }, i32 0, i1 false)
; metadata for the same binding:
!{i32 1, %"class.RWBuffer<vector<float, 4> >"* undef, !"", i32 4, i32 1, i32 1, i32 10, i1 false, i1 false, i1 false, !7}

Environment

  • DXC version: dxcompiler.dll: 1.8 - 1.8.0.14766 (main, ac36a79); dxil.dll: 1.8(1.8.0.14766)
@bogner bogner added bug Bug, regression, crash needs-triage Awaiting triage labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage
Projects
Status: No status
Development

No branches or pull requests

1 participant