Jelajahi Sumber

Add missing intrinsics to query InstanceContributionToHitGroupIndex via RayQuery (#2578)

* Add Candidate_ and Committed_InstanceContributionToHitGroupIndex() intrinsics to RayQuery object
amarpMSFT 5 tahun lalu
induk
melakukan
42a511cb77

+ 220 - 218
docs/DXIL.rst

@@ -2092,224 +2092,226 @@ Opcodes are defined on a dense range and will be provided as enum in a header fi
 .. <py::lines('OPCODES-RST')>hctdb_instrhelp.get_opcodes_rst()</py>
 .. OPCODES-RST:BEGIN
 
-=== ============================================== =======================================================================================================================================================================================================================
-ID  Name                                           Description
-=== ============================================== =======================================================================================================================================================================================================================
-0   TempRegLoad_                                   Helper load operation
-1   TempRegStore_                                  Helper store operation
-2   MinPrecXRegLoad_                               Helper load operation for minprecision
-3   MinPrecXRegStore_                              Helper store operation for minprecision
-4   LoadInput_                                     Loads the value from shader input
-5   StoreOutput_                                   Stores the value to shader output
-6   FAbs_                                          returns the absolute value of the input value.
-7   Saturate_                                      clamps the result of a single or double precision floating point value to [0.0f...1.0f]
-8   IsNaN_                                         Returns true if x is NAN or QNAN, false otherwise.
-9   IsInf_                                         Returns true if x is +INF or -INF, false otherwise.
-10  IsFinite_                                      Returns true if x is finite, false otherwise.
-11  IsNormal_                                      returns IsNormal
-12  Cos_                                           returns cosine(theta) for theta in radians.
-13  Sin_                                           returns sine(theta) for theta in radians.
-14  Tan_                                           returns tan(theta) for theta in radians.
-15  Acos_                                          Returns the arccosine of the specified value. Input should be a floating-point value within the range of -1 to 1.
-16  Asin_                                          Returns the arccosine of the specified value. Input should be a floating-point value within the range of -1 to 1
-17  Atan_                                          Returns the arctangent of the specified value. The return value is within the range of -PI/2 to PI/2.
-18  Hcos_                                          returns the hyperbolic cosine of the specified value.
-19  Hsin_                                          returns the hyperbolic sine of the specified value.
-20  Htan_                                          returns the hyperbolic tangent of the specified value.
-21  Exp_                                           returns 2^exponent
-22  Frc_                                           extract fracitonal component.
-23  Log_                                           returns log base 2.
-24  Sqrt_                                          returns square root
-25  Rsqrt_                                         returns reciprocal square root (1 / sqrt(src)
-26  Round_ne_                                      floating-point round to integral float.
-27  Round_ni_                                      floating-point round to integral float.
-28  Round_pi_                                      floating-point round to integral float.
-29  Round_z_                                       floating-point round to integral float.
-30  Bfrev_                                         Reverses the order of the bits.
-31  Countbits_                                     Counts the number of bits in the input integer.
-32  FirstbitLo_                                    Returns the location of the first set bit starting from the lowest order bit and working upward.
-33  FirstbitHi_                                    Returns the location of the first set bit starting from the highest order bit and working downward.
-34  FirstbitSHi_                                   Returns the location of the first set bit from the highest order bit based on the sign.
-35  FMax_                                          returns a if a >= b, else b
-36  FMin_                                          returns a if a < b, else b
-37  IMax_                                          IMax(a,b) returns a if a > b, else b
-38  IMin_                                          IMin(a,b) returns a if a < b, else b
-39  UMax_                                          unsigned integer maximum. UMax(a,b) = a > b ? a : b
-40  UMin_                                          unsigned integer minimum. UMin(a,b) = a < b ? a : b
-41  IMul_                                          multiply of 32-bit operands to produce the correct full 64-bit result.
-42  UMul_                                          multiply of 32-bit operands to produce the correct full 64-bit result.
-43  UDiv_                                          unsigned divide of the 32-bit operand src0 by the 32-bit operand src1.
-44  UAddc_                                         unsigned add of 32-bit operand with the carry
-45  USubb_                                         unsigned subtract of 32-bit operands with the borrow
-46  FMad_                                          floating point multiply & add
-47  Fma_                                           fused multiply-add
-48  IMad_                                          Signed integer multiply & add
-49  UMad_                                          Unsigned integer multiply & add
-50  Msad_                                          masked Sum of Absolute Differences.
-51  Ibfe_                                          Integer bitfield extract
-52  Ubfe_                                          Unsigned integer bitfield extract
-53  Bfi_                                           Given a bit range from the LSB of a number, places that number of bits in another number at any offset
-54  Dot2_                                          Two-dimensional vector dot-product
-55  Dot3_                                          Three-dimensional vector dot-product
-56  Dot4_                                          Four-dimensional vector dot-product
-57  CreateHandle                                   creates the handle to a resource
-58  CBufferLoad                                    loads a value from a constant buffer resource
-59  CBufferLoadLegacy                              loads a value from a constant buffer resource
-60  Sample                                         samples a texture
-61  SampleBias                                     samples a texture after applying the input bias to the mipmap level
-62  SampleLevel                                    samples a texture using a mipmap-level offset
-63  SampleGrad                                     samples a texture using a gradient to influence the way the sample location is calculated
-64  SampleCmp                                      samples a texture and compares a single component against the specified comparison value
-65  SampleCmpLevelZero                             samples a texture and compares a single component against the specified comparison value
-66  TextureLoad                                    reads texel data without any filtering or sampling
-67  TextureStore                                   reads texel data without any filtering or sampling
-68  BufferLoad                                     reads from a TypedBuffer
-69  BufferStore                                    writes to a RWTypedBuffer
-70  BufferUpdateCounter                            atomically increments/decrements the hidden 32-bit counter stored with a Count or Append UAV
-71  CheckAccessFullyMapped                         determines whether all values from a Sample, Gather, or Load operation accessed mapped tiles in a tiled resource
-72  GetDimensions                                  gets texture size information
-73  TextureGather                                  gathers the four texels that would be used in a bi-linear filtering operation
-74  TextureGatherCmp                               same as TextureGather, except this instrution performs comparison on texels, similar to SampleCmp
-75  Texture2DMSGetSamplePosition                   gets the position of the specified sample
-76  RenderTargetGetSamplePosition                  gets the position of the specified sample
-77  RenderTargetGetSampleCount                     gets the number of samples for a render target
-78  AtomicBinOp                                    performs an atomic operation on two operands
-79  AtomicCompareExchange                          atomic compare and exchange to memory
-80  Barrier                                        inserts a memory barrier in the shader
-81  CalculateLOD                                   calculates the level of detail
-82  Discard                                        discard the current pixel
-83  DerivCoarseX_                                  computes the rate of change per stamp in x direction.
-84  DerivCoarseY_                                  computes the rate of change per stamp in y direction.
-85  DerivFineX_                                    computes the rate of change per pixel in x direction.
-86  DerivFineY_                                    computes the rate of change per pixel in y direction.
-87  EvalSnapped                                    evaluates an input attribute at pixel center with an offset
-88  EvalSampleIndex                                evaluates an input attribute at a sample location
-89  EvalCentroid                                   evaluates an input attribute at pixel center
-90  SampleIndex                                    returns the sample index in a sample-frequency pixel shader
-91  Coverage                                       returns the coverage mask input in a pixel shader
-92  InnerCoverage                                  returns underestimated coverage input from conservative rasterization in a pixel shader
-93  ThreadId                                       reads the thread ID
-94  GroupId                                        reads the group ID (SV_GroupID)
-95  ThreadIdInGroup                                reads the thread ID within the group (SV_GroupThreadID)
-96  FlattenedThreadIdInGroup                       provides a flattened index for a given thread within a given group (SV_GroupIndex)
-97  EmitStream                                     emits a vertex to a given stream
-98  CutStream                                      completes the current primitive topology at the specified stream
-99  EmitThenCutStream                              equivalent to an EmitStream followed by a CutStream
-100 GSInstanceID                                   GSInstanceID
-101 MakeDouble                                     creates a double value
-102 SplitDouble                                    splits a double into low and high parts
-103 LoadOutputControlPoint                         LoadOutputControlPoint
-104 LoadPatchConstant                              LoadPatchConstant
-105 DomainLocation                                 DomainLocation
-106 StorePatchConstant                             StorePatchConstant
-107 OutputControlPointID                           OutputControlPointID
-108 PrimitiveID                                    PrimitiveID
-109 CycleCounterLegacy                             CycleCounterLegacy
-110 WaveIsFirstLane                                returns 1 for the first lane in the wave
-111 WaveGetLaneIndex                               returns the index of the current lane in the wave
-112 WaveGetLaneCount                               returns the number of lanes in the wave
-113 WaveAnyTrue                                    returns 1 if any of the lane evaluates the value to true
-114 WaveAllTrue                                    returns 1 if all the lanes evaluate the value to true
-115 WaveActiveAllEqual                             returns 1 if all the lanes have the same value
-116 WaveActiveBallot                               returns a struct with a bit set for each lane where the condition is true
-117 WaveReadLaneAt                                 returns the value from the specified lane
-118 WaveReadLaneFirst                              returns the value from the first lane
-119 WaveActiveOp                                   returns the result the operation across waves
-120 WaveActiveBit                                  returns the result of the operation across all lanes
-121 WavePrefixOp                                   returns the result of the operation on prior lanes
-122 QuadReadLaneAt                                 reads from a lane in the quad
-123 QuadOp                                         returns the result of a quad-level operation
-124 BitcastI16toF16                                bitcast between different sizes
-125 BitcastF16toI16                                bitcast between different sizes
-126 BitcastI32toF32                                bitcast between different sizes
-127 BitcastF32toI32                                bitcast between different sizes
-128 BitcastI64toF64                                bitcast between different sizes
-129 BitcastF64toI64                                bitcast between different sizes
-130 LegacyF32ToF16                                 legacy fuction to convert float (f32) to half (f16) (this is not related to min-precision)
-131 LegacyF16ToF32                                 legacy fuction to convert half (f16) to float (f32) (this is not related to min-precision)
-132 LegacyDoubleToFloat                            legacy fuction to convert double to float
-133 LegacyDoubleToSInt32                           legacy fuction to convert double to int32
-134 LegacyDoubleToUInt32                           legacy fuction to convert double to uint32
-135 WaveAllBitCount                                returns the count of bits set to 1 across the wave
-136 WavePrefixBitCount                             returns the count of bits set to 1 on prior lanes
-137 AttributeAtVertex_                             returns the values of the attributes at the vertex.
-138 ViewID                                         returns the view index
-139 RawBufferLoad                                  reads from a raw buffer and structured buffer
-140 RawBufferStore                                 writes to a RWByteAddressBuffer or RWStructuredBuffer
-141 InstanceID                                     The user-provided InstanceID on the bottom-level acceleration structure instance within the top-level structure
-142 InstanceIndex                                  The autogenerated index of the current instance in the top-level structure
-143 HitKind                                        Returns the value passed as HitKind in ReportIntersection().  If intersection was reported by fixed-function triangle intersection, HitKind will be one of HIT_KIND_TRIANGLE_FRONT_FACE or HIT_KIND_TRIANGLE_BACK_FACE.
-144 RayFlags                                       uint containing the current ray flags.
-145 DispatchRaysIndex                              The current x and y location within the Width and Height
-146 DispatchRaysDimensions                         The Width and Height values from the D3D12_DISPATCH_RAYS_DESC structure provided to the originating DispatchRays() call.
-147 WorldRayOrigin                                 The world-space origin for the current ray.
-148 WorldRayDirection                              The world-space direction for the current ray.
-149 ObjectRayOrigin                                Object-space origin for the current ray.
-150 ObjectRayDirection                             Object-space direction for the current ray.
-151 ObjectToWorld                                  Matrix for transforming from object-space to world-space.
-152 WorldToObject                                  Matrix for transforming from world-space to object-space.
-153 RayTMin                                        float representing the parametric starting point for the ray.
-154 RayTCurrent                                    float representing the current parametric ending point for the ray
-155 IgnoreHit                                      Used in an any hit shader to reject an intersection and terminate the shader
-156 AcceptHitAndEndSearch                          Used in an any hit shader to abort the ray query and the intersection shader (if any). The current hit is committed and execution passes to the closest hit shader with the closest hit recorded so far
-157 TraceRay                                       initiates raytrace
-158 ReportHit                                      returns true if hit was accepted
-159 CallShader                                     Call a shader in the callable shader table supplied through the DispatchRays() API
-160 CreateHandleForLib                             create resource handle from resource struct for library
-161 PrimitiveIndex                                 PrimitiveIndex for raytracing shaders
-162 Dot2AddHalf                                    2D half dot product with accumulate to float
-163 Dot4AddI8Packed                                signed dot product of 4 x i8 vectors packed into i32, with accumulate to i32
-164 Dot4AddU8Packed                                unsigned dot product of 4 x u8 vectors packed into i32, with accumulate to i32
-165 WaveMatch                                      returns the bitmask of active lanes that have the same value
-166 WaveMultiPrefixOp                              returns the result of the operation on groups of lanes identified by a bitmask
-167 WaveMultiPrefixBitCount                        returns the count of bits set to 1 on groups of lanes identified by a bitmask
-168 SetMeshOutputCounts                            Mesh shader intrinsic SetMeshOutputCounts
-169 EmitIndices                                    emit a primitive's vertex indices in a mesh shader
-170 GetMeshPayload                                 get the mesh payload which is from amplification shader
-171 StoreVertexOutput                              stores the value to mesh shader vertex output
-172 StorePrimitiveOutput                           stores the value to mesh shader primitive output
-173 DispatchMesh                                   Amplification shader intrinsic DispatchMesh
-174 WriteSamplerFeedback                           updates a feedback texture for a sampling operation
-175 WriteSamplerFeedbackBias                       updates a feedback texture for a sampling operation with a bias on the mipmap level
-176 WriteSamplerFeedbackLevel                      updates a feedback texture for a sampling operation with a mipmap-level offset
-177 WriteSamplerFeedbackGrad                       updates a feedback texture for a sampling operation with explicit gradients
-178 AllocateRayQuery                               allocates space for RayQuery and return handle
-179 RayQuery_TraceRayInline                        initializes RayQuery for raytrace
-180 RayQuery_Proceed                               advances a ray query
-181 RayQuery_Abort                                 aborts a ray query
-182 RayQuery_CommitNonOpaqueTriangleHit            commits a non opaque triangle hit
-183 RayQuery_CommitProceduralPrimitiveHit          commits a procedural primitive hit
-184 RayQuery_CommittedStatus                       returns uint status (COMMITTED_STATUS) of the committed hit in a ray query
-185 RayQuery_CandidateType                         returns uint candidate type (CANDIDATE_TYPE) of the current hit candidate in a ray query, after Proceed() has returned true
-186 RayQuery_CandidateObjectToWorld3x4             returns matrix for transforming from object-space to world-space for a candidate hit.
-187 RayQuery_CandidateWorldToObject3x4             returns matrix for transforming from world-space to object-space for a candidate hit.
-188 RayQuery_CommittedObjectToWorld3x4             returns matrix for transforming from object-space to world-space for a Committed hit.
-189 RayQuery_CommittedWorldToObject3x4             returns matrix for transforming from world-space to object-space for a Committed hit.
-190 RayQuery_CandidateProceduralPrimitiveNonOpaque returns if current candidate procedural primitive is non opaque
-191 RayQuery_CandidateTriangleFrontFace            returns if current candidate triangle is front facing
-192 RayQuery_CommittedTriangleFrontFace            returns if current committed triangle is front facing
-193 RayQuery_CandidateTriangleBarycentrics         returns candidate triangle hit barycentrics
-194 RayQuery_CommittedTriangleBarycentrics         returns committed triangle hit barycentrics
-195 RayQuery_RayFlags                              returns ray flags
-196 RayQuery_WorldRayOrigin                        returns world ray origin
-197 RayQuery_WorldRayDirection                     returns world ray direction
-198 RayQuery_RayTMin                               returns float representing the parametric starting point for the ray.
-199 RayQuery_CandidateTriangleRayT                 returns float representing the parametric point on the ray for the current candidate triangle hit.
-200 RayQuery_CommittedRayT                         returns float representing the parametric point on the ray for the current committed hit.
-201 RayQuery_CandidateInstanceIndex                returns candidate hit instance index
-202 RayQuery_CandidateInstanceID                   returns candidate hit instance ID
-203 RayQuery_CandidateGeometryIndex                returns candidate hit geometry index
-204 RayQuery_CandidatePrimitiveIndex               returns candidate hit geometry index
-205 RayQuery_CandidateObjectRayOrigin              returns candidate hit object ray origin
-206 RayQuery_CandidateObjectRayDirection           returns candidate object ray direction
-207 RayQuery_CommittedInstanceIndex                returns committed hit instance index
-208 RayQuery_CommittedInstanceID                   returns committed hit instance ID
-209 RayQuery_CommittedGeometryIndex                returns committed hit geometry index
-210 RayQuery_CommittedPrimitiveIndex               returns committed hit geometry index
-211 RayQuery_CommittedObjectRayOrigin              returns committed hit object ray origin
-212 RayQuery_CommittedObjectRayDirection           returns committed object ray direction
-213 GeometryIndex                                  The autogenerated index of the current geometry in the bottom-level structure
-=== ============================================== =======================================================================================================================================================================================================================
+=== ===================================================== =======================================================================================================================================================================================================================
+ID  Name                                                  Description
+=== ===================================================== =======================================================================================================================================================================================================================
+0   TempRegLoad_                                          Helper load operation
+1   TempRegStore_                                         Helper store operation
+2   MinPrecXRegLoad_                                      Helper load operation for minprecision
+3   MinPrecXRegStore_                                     Helper store operation for minprecision
+4   LoadInput_                                            Loads the value from shader input
+5   StoreOutput_                                          Stores the value to shader output
+6   FAbs_                                                 returns the absolute value of the input value.
+7   Saturate_                                             clamps the result of a single or double precision floating point value to [0.0f...1.0f]
+8   IsNaN_                                                Returns true if x is NAN or QNAN, false otherwise.
+9   IsInf_                                                Returns true if x is +INF or -INF, false otherwise.
+10  IsFinite_                                             Returns true if x is finite, false otherwise.
+11  IsNormal_                                             returns IsNormal
+12  Cos_                                                  returns cosine(theta) for theta in radians.
+13  Sin_                                                  returns sine(theta) for theta in radians.
+14  Tan_                                                  returns tan(theta) for theta in radians.
+15  Acos_                                                 Returns the arccosine of the specified value. Input should be a floating-point value within the range of -1 to 1.
+16  Asin_                                                 Returns the arccosine of the specified value. Input should be a floating-point value within the range of -1 to 1
+17  Atan_                                                 Returns the arctangent of the specified value. The return value is within the range of -PI/2 to PI/2.
+18  Hcos_                                                 returns the hyperbolic cosine of the specified value.
+19  Hsin_                                                 returns the hyperbolic sine of the specified value.
+20  Htan_                                                 returns the hyperbolic tangent of the specified value.
+21  Exp_                                                  returns 2^exponent
+22  Frc_                                                  extract fracitonal component.
+23  Log_                                                  returns log base 2.
+24  Sqrt_                                                 returns square root
+25  Rsqrt_                                                returns reciprocal square root (1 / sqrt(src)
+26  Round_ne_                                             floating-point round to integral float.
+27  Round_ni_                                             floating-point round to integral float.
+28  Round_pi_                                             floating-point round to integral float.
+29  Round_z_                                              floating-point round to integral float.
+30  Bfrev_                                                Reverses the order of the bits.
+31  Countbits_                                            Counts the number of bits in the input integer.
+32  FirstbitLo_                                           Returns the location of the first set bit starting from the lowest order bit and working upward.
+33  FirstbitHi_                                           Returns the location of the first set bit starting from the highest order bit and working downward.
+34  FirstbitSHi_                                          Returns the location of the first set bit from the highest order bit based on the sign.
+35  FMax_                                                 returns a if a >= b, else b
+36  FMin_                                                 returns a if a < b, else b
+37  IMax_                                                 IMax(a,b) returns a if a > b, else b
+38  IMin_                                                 IMin(a,b) returns a if a < b, else b
+39  UMax_                                                 unsigned integer maximum. UMax(a,b) = a > b ? a : b
+40  UMin_                                                 unsigned integer minimum. UMin(a,b) = a < b ? a : b
+41  IMul_                                                 multiply of 32-bit operands to produce the correct full 64-bit result.
+42  UMul_                                                 multiply of 32-bit operands to produce the correct full 64-bit result.
+43  UDiv_                                                 unsigned divide of the 32-bit operand src0 by the 32-bit operand src1.
+44  UAddc_                                                unsigned add of 32-bit operand with the carry
+45  USubb_                                                unsigned subtract of 32-bit operands with the borrow
+46  FMad_                                                 floating point multiply & add
+47  Fma_                                                  fused multiply-add
+48  IMad_                                                 Signed integer multiply & add
+49  UMad_                                                 Unsigned integer multiply & add
+50  Msad_                                                 masked Sum of Absolute Differences.
+51  Ibfe_                                                 Integer bitfield extract
+52  Ubfe_                                                 Unsigned integer bitfield extract
+53  Bfi_                                                  Given a bit range from the LSB of a number, places that number of bits in another number at any offset
+54  Dot2_                                                 Two-dimensional vector dot-product
+55  Dot3_                                                 Three-dimensional vector dot-product
+56  Dot4_                                                 Four-dimensional vector dot-product
+57  CreateHandle                                          creates the handle to a resource
+58  CBufferLoad                                           loads a value from a constant buffer resource
+59  CBufferLoadLegacy                                     loads a value from a constant buffer resource
+60  Sample                                                samples a texture
+61  SampleBias                                            samples a texture after applying the input bias to the mipmap level
+62  SampleLevel                                           samples a texture using a mipmap-level offset
+63  SampleGrad                                            samples a texture using a gradient to influence the way the sample location is calculated
+64  SampleCmp                                             samples a texture and compares a single component against the specified comparison value
+65  SampleCmpLevelZero                                    samples a texture and compares a single component against the specified comparison value
+66  TextureLoad                                           reads texel data without any filtering or sampling
+67  TextureStore                                          reads texel data without any filtering or sampling
+68  BufferLoad                                            reads from a TypedBuffer
+69  BufferStore                                           writes to a RWTypedBuffer
+70  BufferUpdateCounter                                   atomically increments/decrements the hidden 32-bit counter stored with a Count or Append UAV
+71  CheckAccessFullyMapped                                determines whether all values from a Sample, Gather, or Load operation accessed mapped tiles in a tiled resource
+72  GetDimensions                                         gets texture size information
+73  TextureGather                                         gathers the four texels that would be used in a bi-linear filtering operation
+74  TextureGatherCmp                                      same as TextureGather, except this instrution performs comparison on texels, similar to SampleCmp
+75  Texture2DMSGetSamplePosition                          gets the position of the specified sample
+76  RenderTargetGetSamplePosition                         gets the position of the specified sample
+77  RenderTargetGetSampleCount                            gets the number of samples for a render target
+78  AtomicBinOp                                           performs an atomic operation on two operands
+79  AtomicCompareExchange                                 atomic compare and exchange to memory
+80  Barrier                                               inserts a memory barrier in the shader
+81  CalculateLOD                                          calculates the level of detail
+82  Discard                                               discard the current pixel
+83  DerivCoarseX_                                         computes the rate of change per stamp in x direction.
+84  DerivCoarseY_                                         computes the rate of change per stamp in y direction.
+85  DerivFineX_                                           computes the rate of change per pixel in x direction.
+86  DerivFineY_                                           computes the rate of change per pixel in y direction.
+87  EvalSnapped                                           evaluates an input attribute at pixel center with an offset
+88  EvalSampleIndex                                       evaluates an input attribute at a sample location
+89  EvalCentroid                                          evaluates an input attribute at pixel center
+90  SampleIndex                                           returns the sample index in a sample-frequency pixel shader
+91  Coverage                                              returns the coverage mask input in a pixel shader
+92  InnerCoverage                                         returns underestimated coverage input from conservative rasterization in a pixel shader
+93  ThreadId                                              reads the thread ID
+94  GroupId                                               reads the group ID (SV_GroupID)
+95  ThreadIdInGroup                                       reads the thread ID within the group (SV_GroupThreadID)
+96  FlattenedThreadIdInGroup                              provides a flattened index for a given thread within a given group (SV_GroupIndex)
+97  EmitStream                                            emits a vertex to a given stream
+98  CutStream                                             completes the current primitive topology at the specified stream
+99  EmitThenCutStream                                     equivalent to an EmitStream followed by a CutStream
+100 GSInstanceID                                          GSInstanceID
+101 MakeDouble                                            creates a double value
+102 SplitDouble                                           splits a double into low and high parts
+103 LoadOutputControlPoint                                LoadOutputControlPoint
+104 LoadPatchConstant                                     LoadPatchConstant
+105 DomainLocation                                        DomainLocation
+106 StorePatchConstant                                    StorePatchConstant
+107 OutputControlPointID                                  OutputControlPointID
+108 PrimitiveID                                           PrimitiveID
+109 CycleCounterLegacy                                    CycleCounterLegacy
+110 WaveIsFirstLane                                       returns 1 for the first lane in the wave
+111 WaveGetLaneIndex                                      returns the index of the current lane in the wave
+112 WaveGetLaneCount                                      returns the number of lanes in the wave
+113 WaveAnyTrue                                           returns 1 if any of the lane evaluates the value to true
+114 WaveAllTrue                                           returns 1 if all the lanes evaluate the value to true
+115 WaveActiveAllEqual                                    returns 1 if all the lanes have the same value
+116 WaveActiveBallot                                      returns a struct with a bit set for each lane where the condition is true
+117 WaveReadLaneAt                                        returns the value from the specified lane
+118 WaveReadLaneFirst                                     returns the value from the first lane
+119 WaveActiveOp                                          returns the result the operation across waves
+120 WaveActiveBit                                         returns the result of the operation across all lanes
+121 WavePrefixOp                                          returns the result of the operation on prior lanes
+122 QuadReadLaneAt                                        reads from a lane in the quad
+123 QuadOp                                                returns the result of a quad-level operation
+124 BitcastI16toF16                                       bitcast between different sizes
+125 BitcastF16toI16                                       bitcast between different sizes
+126 BitcastI32toF32                                       bitcast between different sizes
+127 BitcastF32toI32                                       bitcast between different sizes
+128 BitcastI64toF64                                       bitcast between different sizes
+129 BitcastF64toI64                                       bitcast between different sizes
+130 LegacyF32ToF16                                        legacy fuction to convert float (f32) to half (f16) (this is not related to min-precision)
+131 LegacyF16ToF32                                        legacy fuction to convert half (f16) to float (f32) (this is not related to min-precision)
+132 LegacyDoubleToFloat                                   legacy fuction to convert double to float
+133 LegacyDoubleToSInt32                                  legacy fuction to convert double to int32
+134 LegacyDoubleToUInt32                                  legacy fuction to convert double to uint32
+135 WaveAllBitCount                                       returns the count of bits set to 1 across the wave
+136 WavePrefixBitCount                                    returns the count of bits set to 1 on prior lanes
+137 AttributeAtVertex_                                    returns the values of the attributes at the vertex.
+138 ViewID                                                returns the view index
+139 RawBufferLoad                                         reads from a raw buffer and structured buffer
+140 RawBufferStore                                        writes to a RWByteAddressBuffer or RWStructuredBuffer
+141 InstanceID                                            The user-provided InstanceID on the bottom-level acceleration structure instance within the top-level structure
+142 InstanceIndex                                         The autogenerated index of the current instance in the top-level structure
+143 HitKind                                               Returns the value passed as HitKind in ReportIntersection().  If intersection was reported by fixed-function triangle intersection, HitKind will be one of HIT_KIND_TRIANGLE_FRONT_FACE or HIT_KIND_TRIANGLE_BACK_FACE.
+144 RayFlags                                              uint containing the current ray flags.
+145 DispatchRaysIndex                                     The current x and y location within the Width and Height
+146 DispatchRaysDimensions                                The Width and Height values from the D3D12_DISPATCH_RAYS_DESC structure provided to the originating DispatchRays() call.
+147 WorldRayOrigin                                        The world-space origin for the current ray.
+148 WorldRayDirection                                     The world-space direction for the current ray.
+149 ObjectRayOrigin                                       Object-space origin for the current ray.
+150 ObjectRayDirection                                    Object-space direction for the current ray.
+151 ObjectToWorld                                         Matrix for transforming from object-space to world-space.
+152 WorldToObject                                         Matrix for transforming from world-space to object-space.
+153 RayTMin                                               float representing the parametric starting point for the ray.
+154 RayTCurrent                                           float representing the current parametric ending point for the ray
+155 IgnoreHit                                             Used in an any hit shader to reject an intersection and terminate the shader
+156 AcceptHitAndEndSearch                                 Used in an any hit shader to abort the ray query and the intersection shader (if any). The current hit is committed and execution passes to the closest hit shader with the closest hit recorded so far
+157 TraceRay                                              initiates raytrace
+158 ReportHit                                             returns true if hit was accepted
+159 CallShader                                            Call a shader in the callable shader table supplied through the DispatchRays() API
+160 CreateHandleForLib                                    create resource handle from resource struct for library
+161 PrimitiveIndex                                        PrimitiveIndex for raytracing shaders
+162 Dot2AddHalf                                           2D half dot product with accumulate to float
+163 Dot4AddI8Packed                                       signed dot product of 4 x i8 vectors packed into i32, with accumulate to i32
+164 Dot4AddU8Packed                                       unsigned dot product of 4 x u8 vectors packed into i32, with accumulate to i32
+165 WaveMatch                                             returns the bitmask of active lanes that have the same value
+166 WaveMultiPrefixOp                                     returns the result of the operation on groups of lanes identified by a bitmask
+167 WaveMultiPrefixBitCount                               returns the count of bits set to 1 on groups of lanes identified by a bitmask
+168 SetMeshOutputCounts                                   Mesh shader intrinsic SetMeshOutputCounts
+169 EmitIndices                                           emit a primitive's vertex indices in a mesh shader
+170 GetMeshPayload                                        get the mesh payload which is from amplification shader
+171 StoreVertexOutput                                     stores the value to mesh shader vertex output
+172 StorePrimitiveOutput                                  stores the value to mesh shader primitive output
+173 DispatchMesh                                          Amplification shader intrinsic DispatchMesh
+174 WriteSamplerFeedback                                  updates a feedback texture for a sampling operation
+175 WriteSamplerFeedbackBias                              updates a feedback texture for a sampling operation with a bias on the mipmap level
+176 WriteSamplerFeedbackLevel                             updates a feedback texture for a sampling operation with a mipmap-level offset
+177 WriteSamplerFeedbackGrad                              updates a feedback texture for a sampling operation with explicit gradients
+178 AllocateRayQuery                                      allocates space for RayQuery and return handle
+179 RayQuery_TraceRayInline                               initializes RayQuery for raytrace
+180 RayQuery_Proceed                                      advances a ray query
+181 RayQuery_Abort                                        aborts a ray query
+182 RayQuery_CommitNonOpaqueTriangleHit                   commits a non opaque triangle hit
+183 RayQuery_CommitProceduralPrimitiveHit                 commits a procedural primitive hit
+184 RayQuery_CommittedStatus                              returns uint status (COMMITTED_STATUS) of the committed hit in a ray query
+185 RayQuery_CandidateType                                returns uint candidate type (CANDIDATE_TYPE) of the current hit candidate in a ray query, after Proceed() has returned true
+186 RayQuery_CandidateObjectToWorld3x4                    returns matrix for transforming from object-space to world-space for a candidate hit.
+187 RayQuery_CandidateWorldToObject3x4                    returns matrix for transforming from world-space to object-space for a candidate hit.
+188 RayQuery_CommittedObjectToWorld3x4                    returns matrix for transforming from object-space to world-space for a Committed hit.
+189 RayQuery_CommittedWorldToObject3x4                    returns matrix for transforming from world-space to object-space for a Committed hit.
+190 RayQuery_CandidateProceduralPrimitiveNonOpaque        returns if current candidate procedural primitive is non opaque
+191 RayQuery_CandidateTriangleFrontFace                   returns if current candidate triangle is front facing
+192 RayQuery_CommittedTriangleFrontFace                   returns if current committed triangle is front facing
+193 RayQuery_CandidateTriangleBarycentrics                returns candidate triangle hit barycentrics
+194 RayQuery_CommittedTriangleBarycentrics                returns committed triangle hit barycentrics
+195 RayQuery_RayFlags                                     returns ray flags
+196 RayQuery_WorldRayOrigin                               returns world ray origin
+197 RayQuery_WorldRayDirection                            returns world ray direction
+198 RayQuery_RayTMin                                      returns float representing the parametric starting point for the ray.
+199 RayQuery_CandidateTriangleRayT                        returns float representing the parametric point on the ray for the current candidate triangle hit.
+200 RayQuery_CommittedRayT                                returns float representing the parametric point on the ray for the current committed hit.
+201 RayQuery_CandidateInstanceIndex                       returns candidate hit instance index
+202 RayQuery_CandidateInstanceID                          returns candidate hit instance ID
+203 RayQuery_CandidateGeometryIndex                       returns candidate hit geometry index
+204 RayQuery_CandidatePrimitiveIndex                      returns candidate hit geometry index
+205 RayQuery_CandidateObjectRayOrigin                     returns candidate hit object ray origin
+206 RayQuery_CandidateObjectRayDirection                  returns candidate object ray direction
+207 RayQuery_CommittedInstanceIndex                       returns committed hit instance index
+208 RayQuery_CommittedInstanceID                          returns committed hit instance ID
+209 RayQuery_CommittedGeometryIndex                       returns committed hit geometry index
+210 RayQuery_CommittedPrimitiveIndex                      returns committed hit geometry index
+211 RayQuery_CommittedObjectRayOrigin                     returns committed hit object ray origin
+212 RayQuery_CommittedObjectRayDirection                  returns committed object ray direction
+213 GeometryIndex                                         The autogenerated index of the current geometry in the bottom-level structure
+214 RayQuery_CandidateInstanceContributionToHitGroupIndex returns candidate hit InstanceContributionToHitGroupIndex
+215 RayQuery_CommittedInstanceContributionToHitGroupIndex returns committed hit InstanceContributionToHitGroupIndex
+=== ===================================================== =======================================================================================================================================================================================================================
 
 
 Acos

+ 4 - 2
include/dxc/DXIL/DxilConstants.h

@@ -428,6 +428,7 @@ namespace DXIL {
     AllocateRayQuery = 178, // allocates space for RayQuery and return handle
     RayQuery_Abort = 181, // aborts a ray query
     RayQuery_CandidateGeometryIndex = 203, // returns candidate hit geometry index
+    RayQuery_CandidateInstanceContributionToHitGroupIndex = 214, // returns candidate hit InstanceContributionToHitGroupIndex
     RayQuery_CandidateInstanceID = 202, // returns candidate hit instance ID
     RayQuery_CandidateInstanceIndex = 201, // returns candidate hit instance index
     RayQuery_CandidateObjectRayDirection = 206, // returns candidate object ray direction
@@ -443,6 +444,7 @@ namespace DXIL {
     RayQuery_CommitNonOpaqueTriangleHit = 182, // commits a non opaque triangle hit
     RayQuery_CommitProceduralPrimitiveHit = 183, // commits a procedural primitive hit
     RayQuery_CommittedGeometryIndex = 209, // returns committed hit geometry index
+    RayQuery_CommittedInstanceContributionToHitGroupIndex = 215, // returns committed hit InstanceContributionToHitGroupIndex
     RayQuery_CommittedInstanceID = 208, // returns committed hit instance ID
     RayQuery_CommittedInstanceIndex = 207, // returns committed hit instance index
     RayQuery_CommittedObjectRayDirection = 212, // returns committed object ray direction
@@ -656,9 +658,9 @@ namespace DXIL {
     NumOpCodes_Dxil_1_2 = 141,
     NumOpCodes_Dxil_1_3 = 162,
     NumOpCodes_Dxil_1_4 = 165,
-    NumOpCodes_Dxil_1_5 = 214,
+    NumOpCodes_Dxil_1_5 = 216,
   
-    NumOpCodes = 214 // exclusive last value of enumeration
+    NumOpCodes = 216 // exclusive last value of enumeration
   };
   // OPCODE-ENUM:END
 

+ 50 - 0
include/dxc/DXIL/DxilInstructions.h

@@ -6937,5 +6937,55 @@ struct DxilInst_GeometryIndex {
   // Metadata
   bool requiresUniformInputs() const { return false; }
 };
+
+/// This instruction returns candidate hit InstanceContributionToHitGroupIndex
+struct DxilInst_RayQuery_CandidateInstanceContributionToHitGroupIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateInstanceContributionToHitGroupIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateInstanceContributionToHitGroupIndex);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+};
+
+/// This instruction returns committed hit InstanceContributionToHitGroupIndex
+struct DxilInst_RayQuery_CommittedInstanceContributionToHitGroupIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedInstanceContributionToHitGroupIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedInstanceContributionToHitGroupIndex);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+};
 // INSTR-HELPER:END
 } // namespace hlsl

+ 2 - 0
include/dxc/HlslIntrinsicOp.h

@@ -270,6 +270,7 @@ import hctdb_instrhelp
   MOP_WriteSamplerFeedbackLevel,
   MOP_Abort,
   MOP_CandidateGeometryIndex,
+  MOP_CandidateInstanceContributionToHitGroupIndex,
   MOP_CandidateInstanceID,
   MOP_CandidateInstanceIndex,
   MOP_CandidateObjectRayDirection,
@@ -287,6 +288,7 @@ import hctdb_instrhelp
   MOP_CommitNonOpaqueTriangleHit,
   MOP_CommitProceduralPrimitiveHit,
   MOP_CommittedGeometryIndex,
+  MOP_CommittedInstanceContributionToHitGroupIndex,
   MOP_CommittedInstanceID,
   MOP_CommittedInstanceIndex,
   MOP_CommittedObjectRayDirection,

+ 14 - 2
lib/DXIL/DxilOperations.cpp

@@ -380,6 +380,10 @@ const OP::OpCodeProperty OP::m_OpCodeProps[(unsigned)OP::OpCode::NumOpCodes] = {
 
   // Raytracing object space uint System Values, raytracing tier 1.1                                                         void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64,   udt,   obj ,  function attribute
   {  OC::GeometryIndex,           "GeometryIndex",            OCC::GeometryIndex,            "geometryIndex",             { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadNone, },
+
+  // Inline Ray Query                                                                                                        void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64,   udt,   obj ,  function attribute
+  {  OC::RayQuery_CandidateInstanceContributionToHitGroupIndex, "RayQuery_CandidateInstanceContributionToHitGroupIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedInstanceContributionToHitGroupIndex, "RayQuery_CommittedInstanceContributionToHitGroupIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
 };
 // OPCODE-OLOADS:END
 
@@ -766,8 +770,10 @@ void OP::GetMinShaderModelAndMask(OpCode C, bool bWithTranslation,
   // RayQuery_CommittedInstanceIndex=207, RayQuery_CommittedInstanceID=208,
   // RayQuery_CommittedGeometryIndex=209, RayQuery_CommittedPrimitiveIndex=210,
   // RayQuery_CommittedObjectRayOrigin=211,
-  // RayQuery_CommittedObjectRayDirection=212
-  if ((176 <= op && op <= 212)) {
+  // RayQuery_CommittedObjectRayDirection=212,
+  // RayQuery_CandidateInstanceContributionToHitGroupIndex=214,
+  // RayQuery_CommittedInstanceContributionToHitGroupIndex=215
+  if ((176 <= op && op <= 212) || (214 <= op && op <= 215)) {
     major = 6;  minor = 5;
     return;
   }
@@ -1291,6 +1297,10 @@ Function *OP::GetOpFunc(OpCode opCode, Type *pOverloadType) {
 
     // Raytracing object space uint System Values, raytracing tier 1.1
   case OpCode::GeometryIndex:          A(pI32);     A(pI32); break;
+
+    // Inline Ray Query
+  case OpCode::RayQuery_CandidateInstanceContributionToHitGroupIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedInstanceContributionToHitGroupIndex:A(pI32);     A(pI32); A(pI32); break;
   // OPCODE-OLOAD-FUNCS:END
   default: DXASSERT(false, "otherwise unhandled case"); break;
   }
@@ -1494,6 +1504,8 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) {
   case OpCode::RayQuery_CommittedGeometryIndex:
   case OpCode::RayQuery_CommittedPrimitiveIndex:
   case OpCode::GeometryIndex:
+  case OpCode::RayQuery_CandidateInstanceContributionToHitGroupIndex:
+  case OpCode::RayQuery_CommittedInstanceContributionToHitGroupIndex:
     return IntegerType::get(m_Ctx, 32);
   case OpCode::CalculateLOD:
   case OpCode::DomainLocation:

+ 4 - 2
lib/HLSL/DxilValidation.cpp

@@ -930,8 +930,10 @@ static bool ValidateOpcodeInProfile(DXIL::OpCode opcode,
   // RayQuery_CommittedInstanceIndex=207, RayQuery_CommittedInstanceID=208,
   // RayQuery_CommittedGeometryIndex=209, RayQuery_CommittedPrimitiveIndex=210,
   // RayQuery_CommittedObjectRayOrigin=211,
-  // RayQuery_CommittedObjectRayDirection=212
-  if ((176 <= op && op <= 212))
+  // RayQuery_CommittedObjectRayDirection=212,
+  // RayQuery_CandidateInstanceContributionToHitGroupIndex=214,
+  // RayQuery_CommittedInstanceContributionToHitGroupIndex=215
+  if ((176 <= op && op <= 212) || (214 <= op && op <= 215))
     return (major > 6 || (major == 6 && minor >= 5));
   // Instructions: DispatchMesh=173
   if (op == 173)

+ 2 - 0
lib/HLSL/HLOperationLower.cpp

@@ -5378,6 +5378,7 @@ IntrinsicLower gLowerTable[] = {
 
     {IntrinsicOp::MOP_Abort, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_Abort},
     {IntrinsicOp::MOP_CandidateGeometryIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateGeometryIndex},
+    {IntrinsicOp::MOP_CandidateInstanceContributionToHitGroupIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateInstanceContributionToHitGroupIndex},
     {IntrinsicOp::MOP_CandidateInstanceID, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateInstanceID},
     {IntrinsicOp::MOP_CandidateInstanceIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateInstanceIndex},
     {IntrinsicOp::MOP_CandidateObjectRayDirection, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_CandidateObjectRayDirection},
@@ -5395,6 +5396,7 @@ IntrinsicLower gLowerTable[] = {
     {IntrinsicOp::MOP_CommitNonOpaqueTriangleHit, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommitNonOpaqueTriangleHit},
     {IntrinsicOp::MOP_CommitProceduralPrimitiveHit, TranslateCommitProceduralPrimitiveHit, DXIL::OpCode::RayQuery_CommitProceduralPrimitiveHit},
     {IntrinsicOp::MOP_CommittedGeometryIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedGeometryIndex},
+    {IntrinsicOp::MOP_CommittedInstanceContributionToHitGroupIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedInstanceContributionToHitGroupIndex},
     {IntrinsicOp::MOP_CommittedInstanceID, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedInstanceID},
     {IntrinsicOp::MOP_CommittedInstanceIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedInstanceIndex},
     {IntrinsicOp::MOP_CommittedObjectRayDirection, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_CommittedObjectRayDirection},

+ 85 - 73
tools/clang/lib/Sema/gen_intrin_main_tables_15.h

@@ -5996,171 +5996,181 @@ static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args1[] =
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args2[] =
 {
-    {"CandidateInstanceID", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+    {"CandidateInstanceContributionToHitGroupIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args3[] =
 {
-    {"CandidateInstanceIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+    {"CandidateInstanceID", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args4[] =
 {
-    {"CandidateObjectRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+    {"CandidateInstanceIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args5[] =
 {
-    {"CandidateObjectRayOrigin", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+    {"CandidateObjectRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args6[] =
 {
-    {"CandidateObjectToWorld3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
+    {"CandidateObjectRayOrigin", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args7[] =
 {
-    {"CandidateObjectToWorld4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
+    {"CandidateObjectToWorld3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args8[] =
 {
-    {"CandidatePrimitiveIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+    {"CandidateObjectToWorld4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args9[] =
 {
-    {"CandidateProceduralPrimitiveNonOpaque", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
+    {"CandidatePrimitiveIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args10[] =
 {
-    {"CandidateTriangleBarycentrics", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 2},
+    {"CandidateProceduralPrimitiveNonOpaque", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args11[] =
 {
-    {"CandidateTriangleFrontFace", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
+    {"CandidateTriangleBarycentrics", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 2},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args12[] =
 {
-    {"CandidateTriangleRayT", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
+    {"CandidateTriangleFrontFace", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args13[] =
 {
-    {"CandidateType", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+    {"CandidateTriangleRayT", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args14[] =
 {
-    {"CandidateWorldToObject3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
+    {"CandidateType", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args15[] =
 {
-    {"CandidateWorldToObject4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
+    {"CandidateWorldToObject3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args16[] =
 {
-    {"CommitNonOpaqueTriangleHit", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
+    {"CandidateWorldToObject4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
 };
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args17[] =
+{
+    {"CommitNonOpaqueTriangleHit", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args18[] =
 {
     {"CommitProceduralPrimitiveHit", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
     {"t", AR_QUAL_IN, 1, LITEMPLATE_SCALAR, 1, LICOMPTYPE_FLOAT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args18[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args19[] =
 {
     {"CommittedGeometryIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args19[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args20[] =
+{
+    {"CommittedInstanceContributionToHitGroupIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args21[] =
 {
     {"CommittedInstanceID", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args20[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args22[] =
 {
     {"CommittedInstanceIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args21[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args23[] =
 {
     {"CommittedObjectRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args22[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args24[] =
 {
     {"CommittedObjectRayOrigin", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args23[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args25[] =
 {
     {"CommittedObjectToWorld3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args24[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args26[] =
 {
     {"CommittedObjectToWorld4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args25[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args27[] =
 {
     {"CommittedPrimitiveIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args26[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args28[] =
 {
     {"CommittedRayT", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args27[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args29[] =
 {
     {"CommittedStatus", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args28[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args30[] =
 {
     {"CommittedTriangleBarycentrics", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 2},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args29[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args31[] =
 {
     {"CommittedTriangleFrontFace", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args30[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args32[] =
 {
     {"CommittedWorldToObject3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args31[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args33[] =
 {
     {"CommittedWorldToObject4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args32[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args34[] =
 {
     {"Proceed", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args33[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args35[] =
 {
     {"RayFlags", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args34[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args36[] =
 {
     {"RayTMin", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args35[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args37[] =
 {
     {"TraceRayInline", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
     {"AccelerationStructure", AR_QUAL_IN, 1, LITEMPLATE_OBJECT, 1, LICOMPTYPE_ACCELERATION_STRUCT, 1, 1},
@@ -6169,12 +6179,12 @@ static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args35[] =
     {"Ray", AR_QUAL_IN, 4, LITEMPLATE_OBJECT, 4, LICOMPTYPE_RAYDESC, 1, 1},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args36[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args38[] =
 {
     {"WorldRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
 };
 
-static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args37[] =
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args39[] =
 {
     {"WorldRayOrigin", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
 };
@@ -6183,42 +6193,44 @@ static const HLSL_INTRINSIC g_RayQueryMethods[] =
 {
     {(UINT)hlsl::IntrinsicOp::MOP_Abort, false, false, -1, 1, g_RayQueryMethods_Args0},
     {(UINT)hlsl::IntrinsicOp::MOP_CandidateGeometryIndex, true, false, -1, 1, g_RayQueryMethods_Args1},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateInstanceID, true, false, -1, 1, g_RayQueryMethods_Args2},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateInstanceIndex, true, false, -1, 1, g_RayQueryMethods_Args3},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectRayDirection, true, false, -1, 1, g_RayQueryMethods_Args4},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectRayOrigin, true, false, -1, 1, g_RayQueryMethods_Args5},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectToWorld3x4, true, false, -1, 1, g_RayQueryMethods_Args6},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectToWorld4x3, true, false, -1, 1, g_RayQueryMethods_Args7},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidatePrimitiveIndex, true, false, -1, 1, g_RayQueryMethods_Args8},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateProceduralPrimitiveNonOpaque, true, false, -1, 1, g_RayQueryMethods_Args9},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateTriangleBarycentrics, true, false, -1, 1, g_RayQueryMethods_Args10},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateTriangleFrontFace, true, false, -1, 1, g_RayQueryMethods_Args11},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateTriangleRayT, true, false, -1, 1, g_RayQueryMethods_Args12},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateType, true, false, -1, 1, g_RayQueryMethods_Args13},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateWorldToObject3x4, true, false, -1, 1, g_RayQueryMethods_Args14},
-    {(UINT)hlsl::IntrinsicOp::MOP_CandidateWorldToObject4x3, true, false, -1, 1, g_RayQueryMethods_Args15},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommitNonOpaqueTriangleHit, false, false, -1, 1, g_RayQueryMethods_Args16},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommitProceduralPrimitiveHit, false, false, -1, 2, g_RayQueryMethods_Args17},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedGeometryIndex, true, false, -1, 1, g_RayQueryMethods_Args18},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedInstanceID, true, false, -1, 1, g_RayQueryMethods_Args19},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedInstanceIndex, true, false, -1, 1, g_RayQueryMethods_Args20},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectRayDirection, true, false, -1, 1, g_RayQueryMethods_Args21},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectRayOrigin, true, false, -1, 1, g_RayQueryMethods_Args22},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectToWorld3x4, true, false, -1, 1, g_RayQueryMethods_Args23},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectToWorld4x3, true, false, -1, 1, g_RayQueryMethods_Args24},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedPrimitiveIndex, true, false, -1, 1, g_RayQueryMethods_Args25},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedRayT, true, false, -1, 1, g_RayQueryMethods_Args26},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedStatus, true, false, -1, 1, g_RayQueryMethods_Args27},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedTriangleBarycentrics, true, false, -1, 1, g_RayQueryMethods_Args28},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedTriangleFrontFace, true, false, -1, 1, g_RayQueryMethods_Args29},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedWorldToObject3x4, true, false, -1, 1, g_RayQueryMethods_Args30},
-    {(UINT)hlsl::IntrinsicOp::MOP_CommittedWorldToObject4x3, true, false, -1, 1, g_RayQueryMethods_Args31},
-    {(UINT)hlsl::IntrinsicOp::MOP_Proceed, false, false, -1, 1, g_RayQueryMethods_Args32},
-    {(UINT)hlsl::IntrinsicOp::MOP_RayFlags, true, false, -1, 1, g_RayQueryMethods_Args33},
-    {(UINT)hlsl::IntrinsicOp::MOP_RayTMin, true, false, -1, 1, g_RayQueryMethods_Args34},
-    {(UINT)hlsl::IntrinsicOp::MOP_TraceRayInline, false, false, -1, 5, g_RayQueryMethods_Args35},
-    {(UINT)hlsl::IntrinsicOp::MOP_WorldRayDirection, true, false, -1, 1, g_RayQueryMethods_Args36},
-    {(UINT)hlsl::IntrinsicOp::MOP_WorldRayOrigin, true, false, -1, 1, g_RayQueryMethods_Args37},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateInstanceContributionToHitGroupIndex, true, false, -1, 1, g_RayQueryMethods_Args2},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateInstanceID, true, false, -1, 1, g_RayQueryMethods_Args3},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateInstanceIndex, true, false, -1, 1, g_RayQueryMethods_Args4},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectRayDirection, true, false, -1, 1, g_RayQueryMethods_Args5},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectRayOrigin, true, false, -1, 1, g_RayQueryMethods_Args6},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectToWorld3x4, true, false, -1, 1, g_RayQueryMethods_Args7},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateObjectToWorld4x3, true, false, -1, 1, g_RayQueryMethods_Args8},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidatePrimitiveIndex, true, false, -1, 1, g_RayQueryMethods_Args9},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateProceduralPrimitiveNonOpaque, true, false, -1, 1, g_RayQueryMethods_Args10},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateTriangleBarycentrics, true, false, -1, 1, g_RayQueryMethods_Args11},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateTriangleFrontFace, true, false, -1, 1, g_RayQueryMethods_Args12},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateTriangleRayT, true, false, -1, 1, g_RayQueryMethods_Args13},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateType, true, false, -1, 1, g_RayQueryMethods_Args14},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateWorldToObject3x4, true, false, -1, 1, g_RayQueryMethods_Args15},
+    {(UINT)hlsl::IntrinsicOp::MOP_CandidateWorldToObject4x3, true, false, -1, 1, g_RayQueryMethods_Args16},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommitNonOpaqueTriangleHit, false, false, -1, 1, g_RayQueryMethods_Args17},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommitProceduralPrimitiveHit, false, false, -1, 2, g_RayQueryMethods_Args18},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedGeometryIndex, true, false, -1, 1, g_RayQueryMethods_Args19},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedInstanceContributionToHitGroupIndex, true, false, -1, 1, g_RayQueryMethods_Args20},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedInstanceID, true, false, -1, 1, g_RayQueryMethods_Args21},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedInstanceIndex, true, false, -1, 1, g_RayQueryMethods_Args22},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectRayDirection, true, false, -1, 1, g_RayQueryMethods_Args23},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectRayOrigin, true, false, -1, 1, g_RayQueryMethods_Args24},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectToWorld3x4, true, false, -1, 1, g_RayQueryMethods_Args25},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedObjectToWorld4x3, true, false, -1, 1, g_RayQueryMethods_Args26},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedPrimitiveIndex, true, false, -1, 1, g_RayQueryMethods_Args27},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedRayT, true, false, -1, 1, g_RayQueryMethods_Args28},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedStatus, true, false, -1, 1, g_RayQueryMethods_Args29},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedTriangleBarycentrics, true, false, -1, 1, g_RayQueryMethods_Args30},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedTriangleFrontFace, true, false, -1, 1, g_RayQueryMethods_Args31},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedWorldToObject3x4, true, false, -1, 1, g_RayQueryMethods_Args32},
+    {(UINT)hlsl::IntrinsicOp::MOP_CommittedWorldToObject4x3, true, false, -1, 1, g_RayQueryMethods_Args33},
+    {(UINT)hlsl::IntrinsicOp::MOP_Proceed, false, false, -1, 1, g_RayQueryMethods_Args34},
+    {(UINT)hlsl::IntrinsicOp::MOP_RayFlags, true, false, -1, 1, g_RayQueryMethods_Args35},
+    {(UINT)hlsl::IntrinsicOp::MOP_RayTMin, true, false, -1, 1, g_RayQueryMethods_Args36},
+    {(UINT)hlsl::IntrinsicOp::MOP_TraceRayInline, false, false, -1, 5, g_RayQueryMethods_Args37},
+    {(UINT)hlsl::IntrinsicOp::MOP_WorldRayDirection, true, false, -1, 1, g_RayQueryMethods_Args38},
+    {(UINT)hlsl::IntrinsicOp::MOP_WorldRayOrigin, true, false, -1, 1, g_RayQueryMethods_Args39},
 };
 
 //
@@ -6276,7 +6288,7 @@ static const UINT g_uRWTexture1DMethodsCount = 4;
 static const UINT g_uRWTexture2DArrayMethodsCount = 4;
 static const UINT g_uRWTexture2DMethodsCount = 4;
 static const UINT g_uRWTexture3DMethodsCount = 4;
-static const UINT g_uRayQueryMethodsCount = 38;
+static const UINT g_uRayQueryMethodsCount = 40;
 static const UINT g_uStreamMethodsCount = 2;
 static const UINT g_uStructuredBufferMethodsCount = 3;
 static const UINT g_uTexture1DArrayMethodsCount = 31;
@@ -6291,7 +6303,7 @@ static const UINT g_uTextureCUBEMethodsCount = 42;
 static const UINT g_uVkSubpassInputMSMethodsCount = 1;
 static const UINT g_uVkSubpassInputMethodsCount = 1;
 
-static const int g_MaxIntrinsicName = 37; // Count of characters for longest intrinsic name - 'CandidateProceduralPrimitiveNonOpaque'
+static const int g_MaxIntrinsicName = 44; // Count of characters for longest intrinsic name - 'CandidateInstanceContributionToHitGroupIndex'
 static const int g_MaxIntrinsicParamName = 48; // Count of characters for longest intrinsic parameter name - 'MultiplierForGeometryContributionToHitGroupIndex'
 static const int g_MaxIntrinsicParamCount = 8; // Count of parameters (without return) for longest intrinsic argument list - 'TraceRay'
 // HLSL-INTRINSIC-STATS:END

+ 10 - 0
tools/clang/test/HLSLFileCheck/hlsl/objects/RayQuery/tryAllOps.hlsl

@@ -22,6 +22,7 @@
 // CHECK: call float @dx.op.rayQuery_StateVector.f32(i32 205, i32 %[[hRayQuery]], i8 1)
 // CHECK: call i32 @dx.op.rayQuery_StateScalar.i32(i32 204, i32 %[[hRayQuery]])
 // CHECK: call float @dx.op.rayQuery_StateScalar.f32(i32 199, i32 %[[hRayQuery]])
+// CHECK: call i32 @dx.op.rayQuery_StateScalar.i32(i32 214, i32 %[[hRayQuery]])
 // CHECK: call i1 @dx.op.rayQuery_Proceed.i1(i32 180, i32 %[[hRayQuery]])
 // CHECK: call float @dx.op.rayQuery_StateMatrix.f32(i32 187, i32 %[[hRayQuery]], i32 0, i8 0)
 // CHECK: call i1 @dx.op.rayQuery_StateScalar.i1(i32 190, i32 %[[hRayQuery]])
@@ -32,6 +33,7 @@
 // CHECK: call float @dx.op.rayQuery_StateMatrix.f32(i32 189, i32 %[[hRayQuery]], i32 0, i8 0)
 // CHECK: call i1 @dx.op.rayQuery_StateScalar.i1(i32 192, i32 %[[hRayQuery]])
 // CHECK: call float @dx.op.rayQuery_StateVector.f32(i32 194, i32 %[[hRayQuery]], i8 1)
+// CHECL: call i32 @dx.op.rayQuery_StateScalar.i32(i32 215, i32 %[[hRayQuery]])
 // CHECK: call i32 @dx.op.rayQuery_StateScalar.i32(i32 209, i32 %[[hRayQuery]])
 // CHECK: call i32 @dx.op.rayQuery_StateScalar.i32(i32 208, i32 %[[hRayQuery]])
 // CHECK: call i32 @dx.op.rayQuery_StateScalar.i32(i32 207, i32 %[[hRayQuery]])
@@ -115,6 +117,10 @@ void CS()
             {
                 DoSomething();
             }
+            if(q.CandidateInstanceContributionToHitGroupIndex())
+            {
+                DoSomething();
+            }
             break;
         case CANDIDATE_PROCEDURAL_PRIMITIVE:
         {
@@ -152,6 +158,10 @@ void CS()
         {
             DoSomething();
         }
+        if(q.CommittedInstanceContributionToHitGroupIndex())
+        {
+            DoSomething();
+        }
         break;
     case COMMITTED_PROCEDURAL_PRIMITIVE_HIT:
         if(q.CommittedGeometryIndex())

+ 3 - 1
tools/clang/tools/dxcompiler/dxcdisassembler.cpp

@@ -1274,7 +1274,9 @@ static const char *OpCodeSignatures[] = {
   "(rayQueryHandle)",  // RayQuery_CommittedPrimitiveIndex
   "(rayQueryHandle,component)",  // RayQuery_CommittedObjectRayOrigin
   "(rayQueryHandle,component)",  // RayQuery_CommittedObjectRayDirection
-  "()"  // GeometryIndex
+  "()",  // GeometryIndex
+  "(rayQueryHandle)",  // RayQuery_CandidateInstanceContributionToHitGroupIndex
+  "(rayQueryHandle)"  // RayQuery_CommittedInstanceContributionToHitGroupIndex
 };
 // OPCODE-SIGS:END
 

+ 2 - 0
utils/hct/gen_intrin_main.txt

@@ -908,6 +908,8 @@ uint [[ro]] CommittedGeometryIndex();
 uint [[ro]] CommittedPrimitiveIndex();
 float<3> [[ro]] CommittedObjectRayOrigin();
 float<3> [[ro]] CommittedObjectRayDirection();
+uint [[ro]] CandidateInstanceContributionToHitGroupIndex();
+uint [[ro]] CommittedInstanceContributionToHitGroupIndex();
 
 } namespace
 

+ 12 - 2
utils/hct/hctdb.py

@@ -414,7 +414,7 @@ class db_dxil(object):
                  "RayQuery_CandidateObjectRayOrigin,RayQuery_CandidateObjectRayDirection,RayQuery_CommittedInstanceIndex,RayQuery_CommittedInstanceID,RayQuery_CommittedGeometryIndex,RayQuery_CommittedPrimitiveIndex,"+
                  "RayQuery_CommittedObjectRayOrigin,RayQuery_CommittedObjectRayDirection,RayQuery_CandidateProceduralPrimitiveNonOpaque,RayQuery_CandidateTriangleFrontFace,RayQuery_CommittedTriangleFrontFace,"+
                  "RayQuery_CandidateTriangleBarycentrics,RayQuery_CommittedTriangleBarycentrics,RayQuery_CommittedStatus,RayQuery_CandidateType,RayQuery_CandidateObjectToWorld3x4,"+
-                 "RayQuery_CandidateWorldToObject3x4,RayQuery_CommittedObjectToWorld3x4,RayQuery_CommittedWorldToObject3x4").split(","):
+                 "RayQuery_CandidateWorldToObject3x4,RayQuery_CommittedObjectToWorld3x4,RayQuery_CommittedWorldToObject3x4,RayQuery_CandidateInstanceContributionToHitGroupIndex,RayQuery_CommittedInstanceContributionToHitGroupIndex").split(","):
             self.name_idx[i].category = "Inline Ray Query"
             self.name_idx[i].shader_model = 6,5
 
@@ -1713,9 +1713,19 @@ class db_dxil(object):
             db_dxil_param(0, "i32", "", "result")])
         next_op_idx += 1
 
+        self.add_dxil_op("RayQuery_CandidateInstanceContributionToHitGroupIndex", next_op_idx, "RayQuery_StateScalar", "returns candidate hit InstanceContributionToHitGroupIndex", "i", "ro", [
+            db_dxil_param(0, "i32", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedInstanceContributionToHitGroupIndex", next_op_idx, "RayQuery_StateScalar", "returns committed hit InstanceContributionToHitGroupIndex", "i", "ro", [
+            db_dxil_param(0, "i32", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
         # End of DXIL 1.5 opcodes.
         self.set_op_count_for_version(1, 5, next_op_idx)
-        assert next_op_idx == 214, "214 is expected next operation index but encountered %d and thus opcodes are broken" % next_op_idx
+        assert next_op_idx == 216, "216 is expected next operation index but encountered %d and thus opcodes are broken" % next_op_idx
 
         # Set interesting properties.
         self.build_indices()