Skip to content

[SER] Validate HitObject accessors #7371

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

Merged
merged 5 commits into from
Apr 25, 2025

Conversation

simoll
Copy link
Contributor

@simoll simoll commented Apr 23, 2025

Validate:
HitObject_GeometryIndex
HitObject_HitKind
HitObject_InstanceID
HitObject_InstanceIndex
HitObject_IsHit
HitObject_IsMiss
HitObject_IsNop
HitObject_LoadLocalRootTableConstant
HitObject_ObjectRayDirection
HitObject_ObjectRayOrigin
HitObject_ObjectToWorld3x4
HitObject_PrimitiveIndex
HitObject_RayFlags
HitObject_RayTCurrent
HitObject_RayTMin
HitObject_SetShaderTableIndex
HitObject_ShaderTableIndex
HitObject_WorldRayDirection
HitObject_WorldRayOrigin

Rules:

  • No undef parameters (HitObject, RecordIndex, RootTableOffset)
  • row/col/component indices are constant and in-bounds
  • If constant, RootTableOffset % 4 == 0

SER implementation tracker: #7214

Validate:
 HitObject_GeometryIndex
 HitObject_HitKind
 HitObject_InstanceID
 HitObject_InstanceIndex
 HitObject_IsHit
 HitObject_IsMiss
 HitObject_IsNop
 HitObject_LoadLocalRootTableConstant
 HitObject_ObjectRayDirection
 HitObject_ObjectRayOrigin
 HitObject_ObjectToWorld3x4
 HitObject_PrimitiveIndex
 HitObject_RayFlags
 HitObject_RayTCurrent
 HitObject_RayTMin
 HitObject_SetShaderTableIndex
 HitObject_ShaderTableIndex
 HitObject_WorldRayDirection
 HitObject_WorldRayOrigin

Rules:
* No undef parameters (HitObject, RecordIndex, RootTableOffset)
* row/col/component indices are constant and in-bounds
* If constant, RootTableOffset % 4 == 0

SER implementation tracker: microsoft#7214
Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

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

Only one minor nit.

@simoll
Copy link
Contributor Author

simoll commented Apr 23, 2025

  • Merged main
  • Made err msg conform to standards
  • Fixed off-by-one but in constant range validation (upper bound was excluded)

Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

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

Looks good.

@damyanp damyanp moved this to Active in HLSL Support Apr 25, 2025
@damyanp damyanp merged commit 0f7af1b into microsoft:main Apr 25, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Active to Closed in HLSL Support Apr 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Apr 25, 2025
@simoll simoll deleted the ser_dxvaccessors_patch branch April 28, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants