Przeglądaj źródła

Merged PR 120: Adding RayQuery intrinsics

Amar Patel (GRAPHICS) 6 lat temu
rodzic
commit
6bac49fd65

+ 207 - 174
docs/DXIL.rst

@@ -2085,180 +2085,213 @@ 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 AllocateRayQuery              allocate space for RayQuery and return handle
-169 TraceRayInline                initialize RayQuery for raytrace
-=== ============================= =======================================================================================================================================================================================================================
+=== ============================================== =======================================================================================================================================================================================================================
+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 AllocateRayQuery                               allocates space for RayQuery and return handle
+169 RayQuery_TraceRayInline                        initializes RayQuery for raytrace
+170 RayQuery_Proceed                               advances a ray query
+171 RayQuery_Abort                                 aborts a ray query
+172 RayQuery_CommitNonOpaqueTriangleHit            commits a non opaque triangle hit
+173 RayQuery_CommitProceduralPrimitiveHit          commits a procedural primitive hit
+174 RayQuery_CommittedStatus                       returns uint status (COMMITTED_STATUS) of the committed hit in a ray query
+175 RayQuery_CandidateType                         returns uint candidate type (CANDIDATE_TYPE) of the current hit candidate in a ray query, after Proceed() has returned true
+176 RayQuery_CandidateObjectToWorld3x4             returns matrix for transforming from object-space to world-space for a candidate hit.
+177 RayQuery_CandidateWorldToObject3x4             returns matrix for transforming from world-space to object-space for a candidate hit.
+178 RayQuery_CommittedObjectToWorld3x4             returns matrix for transforming from object-space to world-space for a Committed hit.
+179 RayQuery_CommittedWorldToObject3x4             returns matrix for transforming from world-space to object-space for a Committed hit.
+180 RayQuery_CandidateProceduralPrimitiveNonOpaque returns if current candidate procedural primitive is non opaque
+181 RayQuery_CandidateTriangleFrontFace            returns if current candidate triangle is front facing
+182 RayQuery_CommittedTriangleFrontFace            returns if current committed triangle is front facing
+183 RayQuery_CandidateTriangleBarycentrics         returns candidate triangle hit barycentrics
+184 RayQuery_CommittedTriangleBarycentrics         returns committed triangle hit barycentrics
+185 RayQuery_RayFlags                              returns ray flags
+186 RayQuery_WorldRayOrigin                        returns world ray origin
+187 RayQuery_WorldRayDirection                     returns world ray direction
+188 RayQuery_RayTMin                               returns float representing the parametric starting point for the ray.
+189 RayQuery_CandidateTriangleRayT                 returns float representing the parametric point on the ray for the current candidate triangle hit.
+190 RayQuery_CommittedRayT                         returns float representing the parametric point on the ray for the current committed hit.
+191 RayQuery_CandidateInstanceIndex                returns candidate hit instance index
+192 RayQuery_CandidateInstanceID                   returns candidate hit instance ID
+193 RayQuery_CandidateGeometryIndex                returns candidate hit geometry index
+194 RayQuery_CandidatePrimitiveIndex               returns candidate hit geometry index
+195 RayQuery_CandidateObjectRayOrigin              returns candidate hit object ray origin
+196 RayQuery_CandidateObjectRayDirection           returns candidate object ray direction
+197 RayQuery_CommittedInstanceIndex                returns committed hit instance index
+198 RayQuery_CommittedInstanceID                   returns committed hit instance ID
+199 RayQuery_CommittedGeometryIndex                returns committed hit geometry index
+200 RayQuery_CommittedPrimitiveIndex               returns committed hit geometry index
+201 RayQuery_CommittedObjectRayOrigin              returns committed hit object ray origin
+202 RayQuery_CommittedObjectRayDirection           returns committed object ray direction
+=== ============================================== =======================================================================================================================================================================================================================
 
 
 Acos

+ 62 - 13
include/dxc/DXIL/DxilConstants.h

@@ -299,9 +299,6 @@ namespace DXIL {
   // OPCODE-ENUM:BEGIN
   // Enumeration for operations specified by DXIL
   enum class OpCode : unsigned {
-    // 
-    AllocateRayQuery = 168, // allocate space for RayQuery and return handle
-  
     // AnyHit Terminals
     AcceptHitAndEndSearch = 156, // 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
     IgnoreHit = 155, // Used in an any hit shader to reject an intersection and terminate the shader
@@ -389,7 +386,41 @@ namespace DXIL {
     TraceRay = 157, // initiates raytrace
   
     // Inline Ray Query
-    TraceRayInline = 169, // initialize RayQuery for raytrace
+    AllocateRayQuery = 168, // allocates space for RayQuery and return handle
+    RayQuery_Abort = 171, // aborts a ray query
+    RayQuery_CandidateGeometryIndex = 193, // returns candidate hit geometry index
+    RayQuery_CandidateInstanceID = 192, // returns candidate hit instance ID
+    RayQuery_CandidateInstanceIndex = 191, // returns candidate hit instance index
+    RayQuery_CandidateObjectRayDirection = 196, // returns candidate object ray direction
+    RayQuery_CandidateObjectRayOrigin = 195, // returns candidate hit object ray origin
+    RayQuery_CandidateObjectToWorld3x4 = 176, // returns matrix for transforming from object-space to world-space for a candidate hit.
+    RayQuery_CandidatePrimitiveIndex = 194, // returns candidate hit geometry index
+    RayQuery_CandidateProceduralPrimitiveNonOpaque = 180, // returns if current candidate procedural primitive is non opaque
+    RayQuery_CandidateTriangleBarycentrics = 183, // returns candidate triangle hit barycentrics
+    RayQuery_CandidateTriangleFrontFace = 181, // returns if current candidate triangle is front facing
+    RayQuery_CandidateTriangleRayT = 189, // returns float representing the parametric point on the ray for the current candidate triangle hit.
+    RayQuery_CandidateType = 175, // returns uint candidate type (CANDIDATE_TYPE) of the current hit candidate in a ray query, after Proceed() has returned true
+    RayQuery_CandidateWorldToObject3x4 = 177, // returns matrix for transforming from world-space to object-space for a candidate hit.
+    RayQuery_CommitNonOpaqueTriangleHit = 172, // commits a non opaque triangle hit
+    RayQuery_CommitProceduralPrimitiveHit = 173, // commits a procedural primitive hit
+    RayQuery_CommittedGeometryIndex = 199, // returns committed hit geometry index
+    RayQuery_CommittedInstanceID = 198, // returns committed hit instance ID
+    RayQuery_CommittedInstanceIndex = 197, // returns committed hit instance index
+    RayQuery_CommittedObjectRayDirection = 202, // returns committed object ray direction
+    RayQuery_CommittedObjectRayOrigin = 201, // returns committed hit object ray origin
+    RayQuery_CommittedObjectToWorld3x4 = 178, // returns matrix for transforming from object-space to world-space for a Committed hit.
+    RayQuery_CommittedPrimitiveIndex = 200, // returns committed hit geometry index
+    RayQuery_CommittedRayT = 190, // returns float representing the parametric point on the ray for the current committed hit.
+    RayQuery_CommittedStatus = 174, // returns uint status (COMMITTED_STATUS) of the committed hit in a ray query
+    RayQuery_CommittedTriangleBarycentrics = 184, // returns committed triangle hit barycentrics
+    RayQuery_CommittedTriangleFrontFace = 182, // returns if current committed triangle is front facing
+    RayQuery_CommittedWorldToObject3x4 = 179, // returns matrix for transforming from world-space to object-space for a Committed hit.
+    RayQuery_Proceed = 170, // advances a ray query
+    RayQuery_RayFlags = 185, // returns ray flags
+    RayQuery_RayTMin = 188, // returns float representing the parametric starting point for the ray.
+    RayQuery_TraceRayInline = 169, // initializes RayQuery for raytrace
+    RayQuery_WorldRayDirection = 187, // returns world ray direction
+    RayQuery_WorldRayOrigin = 186, // returns world ray origin
   
     // Legacy floating-point
     LegacyF16ToF32 = 131, // legacy fuction to convert half (f16) to float (f32) (this is not related to min-precision)
@@ -568,9 +599,9 @@ namespace DXIL {
     NumOpCodes_Dxil_1_2 = 141,
     NumOpCodes_Dxil_1_3 = 162,
     NumOpCodes_Dxil_1_4 = 165,
-    NumOpCodes_Dxil_1_5 = 170,
+    NumOpCodes_Dxil_1_5 = 203,
   
-    NumOpCodes = 170 // exclusive last value of enumeration
+    NumOpCodes = 203 // exclusive last value of enumeration
   };
   // OPCODE-ENUM:END
 
@@ -578,9 +609,6 @@ namespace DXIL {
   // OPCODECLASS-ENUM:BEGIN
   // Groups for DXIL operations with equivalent function templates
   enum class OpCodeClass : unsigned {
-    // 
-    AllocateRayQuery,
-  
     // AnyHit Terminals
     AcceptHitAndEndSearch,
     IgnoreHit,
@@ -653,7 +681,15 @@ namespace DXIL {
     TraceRay,
   
     // Inline Ray Query
-    TraceRayInline,
+    AllocateRayQuery,
+    RayQuery_Abort,
+    RayQuery_CommitNonOpaqueTriangleHit,
+    RayQuery_CommitProceduralPrimitiveHit,
+    RayQuery_Proceed,
+    RayQuery_StateMatrix,
+    RayQuery_StateScalar,
+    RayQuery_StateVector,
+    RayQuery_TraceRayInline,
   
     // LLVM Instructions
     LlvmInst,
@@ -790,9 +826,9 @@ namespace DXIL {
     NumOpClasses_Dxil_1_2 = 97,
     NumOpClasses_Dxil_1_3 = 118,
     NumOpClasses_Dxil_1_4 = 120,
-    NumOpClasses_Dxil_1_5 = 125,
+    NumOpClasses_Dxil_1_5 = 132,
   
-    NumOpClasses = 125 // exclusive last value of enumeration
+    NumOpClasses = 132 // exclusive last value of enumeration
   };
   // OPCODECLASS-ENUM:END
 
@@ -1181,8 +1217,10 @@ namespace DXIL {
   const uint64_t ShaderFeatureInfo_Barycentrics = 0x20000;
   const uint64_t ShaderFeatureInfo_NativeLowPrecision = 0x40000;
   const uint64_t ShaderFeatureInfo_ShadingRate = 0x80000;
+  const uint64_t ShaderFeatureInfo_Raytracing_Tier_1_1 = 0x100000;
+  const uint64_t ShaderFeatureInfo_SamplerFeedback = 0x200000;
 
-  const unsigned ShaderFeatureInfoCount = 20;
+  const unsigned ShaderFeatureInfoCount = 22;
 
   // DxilSubobjectType must match D3D12_STATE_SUBOBJECT_TYPE, with
   // certain values reserved, since they cannot be used from Dxil.
@@ -1216,6 +1254,17 @@ namespace DXIL {
     LastEntry,
   };
 
+  enum class CommittedStatus : uint32_t {
+    CommittedNothing = 0,
+    CommittedTriangleHit = 1,
+    CommittedProceduralPrimitiveHit = 2,
+  };
+
+  enum class CandidateType : uint32_t {
+    CandidateNonOpaqueTriangle = 0,
+    CandidateProceduralPrimitive = 1,
+  };
+
   inline bool IsValidHitGroupType(HitGroupType type) {
     return (type >= HitGroupType::Triangle && type < HitGroupType::LastEntry);
   }

+ 897 - 5
include/dxc/DXIL/DxilInstructions.h

@@ -5550,7 +5550,7 @@ struct DxilInst_WaveMultiPrefixBitCount {
   void set_mask3(llvm::Value *val) { Instr->setOperand(5, val); }
 };
 
-/// This instruction allocate space for RayQuery and return handle
+/// This instruction allocates space for RayQuery and return handle
 struct DxilInst_AllocateRayQuery {
   llvm::Instruction *Instr;
   // Construction and identification
@@ -5577,13 +5577,13 @@ struct DxilInst_AllocateRayQuery {
   void set_constRayFlags_val(uint32_t val) { Instr->setOperand(1, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 32), llvm::APInt(32, (uint64_t)val))); }
 };
 
-/// This instruction initialize RayQuery for raytrace
-struct DxilInst_TraceRayInline {
+/// This instruction initializes RayQuery for raytrace
+struct DxilInst_RayQuery_TraceRayInline {
   llvm::Instruction *Instr;
   // Construction and identification
-  DxilInst_TraceRayInline(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  DxilInst_RayQuery_TraceRayInline(llvm::Instruction *pInstr) : Instr(pInstr) {}
   operator bool() const {
-    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::TraceRayInline);
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_TraceRayInline);
   }
   // Validation support
   bool isAllowed() const { return true; }
@@ -5634,5 +5634,897 @@ struct DxilInst_TraceRayInline {
   llvm::Value *get_tMax() const { return Instr->getOperand(12); }
   void set_tMax(llvm::Value *val) { Instr->setOperand(12, val); }
 };
+
+/// This instruction advances a ray query
+struct DxilInst_RayQuery_Proceed {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_Proceed(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_Proceed);
+  }
+  // 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 aborts a ray query
+struct DxilInst_RayQuery_Abort {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_Abort(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_Abort);
+  }
+  // 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 commits a non opaque triangle hit
+struct DxilInst_RayQuery_CommitNonOpaqueTriangleHit {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommitNonOpaqueTriangleHit(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommitNonOpaqueTriangleHit);
+  }
+  // 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 commits a procedural primitive hit
+struct DxilInst_RayQuery_CommitProceduralPrimitiveHit {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommitProceduralPrimitiveHit(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommitProceduralPrimitiveHit);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_t = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_t() const { return Instr->getOperand(2); }
+  void set_t(llvm::Value *val) { Instr->setOperand(2, val); }
+};
+
+/// This instruction returns uint status (COMMITTED_STATUS) of the committed hit in a ray query
+struct DxilInst_RayQuery_CommittedStatus {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedStatus(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedStatus);
+  }
+  // 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 uint candidate type (CANDIDATE_TYPE) of the current hit candidate in a ray query, after Proceed() has returned true
+struct DxilInst_RayQuery_CandidateType {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateType(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateType);
+  }
+  // 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 matrix for transforming from object-space to world-space for a candidate hit.
+struct DxilInst_RayQuery_CandidateObjectToWorld3x4 {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateObjectToWorld3x4(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateObjectToWorld3x4);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (4 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_row = 2,
+    arg_col = 3,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_row() const { return Instr->getOperand(2); }
+  void set_row(llvm::Value *val) { Instr->setOperand(2, val); }
+  llvm::Value *get_col() const { return Instr->getOperand(3); }
+  void set_col(llvm::Value *val) { Instr->setOperand(3, val); }
+};
+
+/// This instruction returns matrix for transforming from world-space to object-space for a candidate hit.
+struct DxilInst_RayQuery_CandidateWorldToObject3x4 {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateWorldToObject3x4(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateWorldToObject3x4);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (4 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_row = 2,
+    arg_col = 3,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_row() const { return Instr->getOperand(2); }
+  void set_row(llvm::Value *val) { Instr->setOperand(2, val); }
+  llvm::Value *get_col() const { return Instr->getOperand(3); }
+  void set_col(llvm::Value *val) { Instr->setOperand(3, val); }
+};
+
+/// This instruction returns matrix for transforming from object-space to world-space for a Committed hit.
+struct DxilInst_RayQuery_CommittedObjectToWorld3x4 {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedObjectToWorld3x4(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedObjectToWorld3x4);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (4 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_row = 2,
+    arg_col = 3,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_row() const { return Instr->getOperand(2); }
+  void set_row(llvm::Value *val) { Instr->setOperand(2, val); }
+  llvm::Value *get_col() const { return Instr->getOperand(3); }
+  void set_col(llvm::Value *val) { Instr->setOperand(3, val); }
+};
+
+/// This instruction returns matrix for transforming from world-space to object-space for a Committed hit.
+struct DxilInst_RayQuery_CommittedWorldToObject3x4 {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedWorldToObject3x4(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedWorldToObject3x4);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (4 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_row = 2,
+    arg_col = 3,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_row() const { return Instr->getOperand(2); }
+  void set_row(llvm::Value *val) { Instr->setOperand(2, val); }
+  llvm::Value *get_col() const { return Instr->getOperand(3); }
+  void set_col(llvm::Value *val) { Instr->setOperand(3, val); }
+};
+
+/// This instruction returns if current candidate procedural primitive is non opaque
+struct DxilInst_RayQuery_CandidateProceduralPrimitiveNonOpaque {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateProceduralPrimitiveNonOpaque(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateProceduralPrimitiveNonOpaque);
+  }
+  // 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 if current candidate triangle is front facing
+struct DxilInst_RayQuery_CandidateTriangleFrontFace {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateTriangleFrontFace(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateTriangleFrontFace);
+  }
+  // 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 if current committed triangle is front facing
+struct DxilInst_RayQuery_CommittedTriangleFrontFace {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedTriangleFrontFace(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedTriangleFrontFace);
+  }
+  // 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 candidate triangle hit barycentrics
+struct DxilInst_RayQuery_CandidateTriangleBarycentrics {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateTriangleBarycentrics(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateTriangleBarycentrics);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns committed triangle hit barycentrics
+struct DxilInst_RayQuery_CommittedTriangleBarycentrics {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedTriangleBarycentrics(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedTriangleBarycentrics);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns ray flags
+struct DxilInst_RayQuery_RayFlags {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_RayFlags(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_RayFlags);
+  }
+  // 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 world ray origin
+struct DxilInst_RayQuery_WorldRayOrigin {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_WorldRayOrigin(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_WorldRayOrigin);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns world ray direction
+struct DxilInst_RayQuery_WorldRayDirection {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_WorldRayDirection(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_WorldRayDirection);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns float representing the parametric starting point for the ray.
+struct DxilInst_RayQuery_RayTMin {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_RayTMin(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_RayTMin);
+  }
+  // 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 float representing the parametric point on the ray for the current candidate triangle hit.
+struct DxilInst_RayQuery_CandidateTriangleRayT {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateTriangleRayT(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateTriangleRayT);
+  }
+  // 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 float representing the parametric point on the ray for the current committed hit.
+struct DxilInst_RayQuery_CommittedRayT {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedRayT(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedRayT);
+  }
+  // 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 candidate hit instance index
+struct DxilInst_RayQuery_CandidateInstanceIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateInstanceIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateInstanceIndex);
+  }
+  // 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 candidate hit instance ID
+struct DxilInst_RayQuery_CandidateInstanceID {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateInstanceID(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateInstanceID);
+  }
+  // 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 candidate hit geometry index
+struct DxilInst_RayQuery_CandidateGeometryIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateGeometryIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateGeometryIndex);
+  }
+  // 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 candidate hit geometry index
+struct DxilInst_RayQuery_CandidatePrimitiveIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidatePrimitiveIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidatePrimitiveIndex);
+  }
+  // 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 candidate hit object ray origin
+struct DxilInst_RayQuery_CandidateObjectRayOrigin {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateObjectRayOrigin(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateObjectRayOrigin);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns candidate object ray direction
+struct DxilInst_RayQuery_CandidateObjectRayDirection {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CandidateObjectRayDirection(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CandidateObjectRayDirection);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns committed hit instance index
+struct DxilInst_RayQuery_CommittedInstanceIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedInstanceIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedInstanceIndex);
+  }
+  // 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 instance ID
+struct DxilInst_RayQuery_CommittedInstanceID {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedInstanceID(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedInstanceID);
+  }
+  // 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 geometry index
+struct DxilInst_RayQuery_CommittedGeometryIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedGeometryIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedGeometryIndex);
+  }
+  // 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 geometry index
+struct DxilInst_RayQuery_CommittedPrimitiveIndex {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedPrimitiveIndex(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedPrimitiveIndex);
+  }
+  // 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 object ray origin
+struct DxilInst_RayQuery_CommittedObjectRayOrigin {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedObjectRayOrigin(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedObjectRayOrigin);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
+
+/// This instruction returns committed object ray direction
+struct DxilInst_RayQuery_CommittedObjectRayDirection {
+  llvm::Instruction *Instr;
+  // Construction and identification
+  DxilInst_RayQuery_CommittedObjectRayDirection(llvm::Instruction *pInstr) : Instr(pInstr) {}
+  operator bool() const {
+    return hlsl::OP::IsDxilOpFuncCallInst(Instr, hlsl::OP::OpCode::RayQuery_CommittedObjectRayDirection);
+  }
+  // Validation support
+  bool isAllowed() const { return true; }
+  bool isArgumentListValid() const {
+    if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
+    return true;
+  }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
+  // Operand indexes
+  enum OperandIdx {
+    arg_rayQueryHandle = 1,
+    arg_component = 2,
+  };
+  // Accessors
+  llvm::Value *get_rayQueryHandle() const { return Instr->getOperand(1); }
+  void set_rayQueryHandle(llvm::Value *val) { Instr->setOperand(1, val); }
+  llvm::Value *get_component() const { return Instr->getOperand(2); }
+  void set_component(llvm::Value *val) { Instr->setOperand(2, val); }
+  int8_t get_component_val() const { return (int8_t)(llvm::dyn_cast<llvm::ConstantInt>(Instr->getOperand(2))->getZExtValue()); }
+  void set_component_val(int8_t val) { Instr->setOperand(2, llvm::Constant::getIntegerValue(llvm::IntegerType::get(Instr->getContext(), 8), llvm::APInt(8, (uint64_t)val))); }
+};
 // INSTR-HELPER:END
 } // namespace hlsl

+ 10 - 1
include/dxc/DXIL/DxilShaderFlags.h

@@ -108,6 +108,12 @@ namespace hlsl {
     void SetShadingRate(bool flag) { m_bShadingRate = flag; }
     bool GetShadingRate() const { return m_bShadingRate; }
 
+	void SetRaytracingTier1_1(bool flag) { m_bRaytracingTier1_1 = flag; }
+    bool GetRaytracingTier1_1() const { return m_bRaytracingTier1_1; }
+
+	void SetSamplerFeedback(bool flag) { m_bSamplerFeedback = flag; }
+    bool GetSamplerFeedback() const { return m_bSamplerFeedback; }
+
   private:
     unsigned m_bDisableOptimizations :1;   // D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION
     unsigned m_bDisableMathRefactoring :1; //~D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED
@@ -143,7 +149,10 @@ namespace hlsl {
 
     unsigned m_bShadingRate : 1;      // SHADER_FEATURE_SHADINGRATE
 
-    unsigned m_align0 : 7;        // align to 32 bit.
+	unsigned m_bRaytracingTier1_1 : 1; // SHADER_FEATURE_RAYTRACING_TIER_1_1
+    unsigned m_bSamplerFeedback : 1; // SHADER_FEATURE_SAMPLER_FEEDBACK
+
+    unsigned m_align0 : 5;        // align to 32 bit.
     uint32_t m_align1;            // align to 64 bit.
   };
 

+ 37 - 0
include/dxc/HlslIntrinsicOp.h

@@ -260,7 +260,44 @@ import hctdb_instrhelp
   MOP_DecrementCounter,
   MOP_IncrementCounter,
   MOP_Consume,
+  MOP_Abort,
+  MOP_CandidateGeometryIndex,
+  MOP_CandidateInstanceID,
+  MOP_CandidateInstanceIndex,
+  MOP_CandidateObjectRayDirection,
+  MOP_CandidateObjectRayOrigin,
+  MOP_CandidateObjectToWorld3x4,
+  MOP_CandidateObjectToWorld4x3,
+  MOP_CandidatePrimitiveIndex,
+  MOP_CandidateProceduralPrimitiveNonOpaque,
+  MOP_CandidateTriangleBarycentrics,
+  MOP_CandidateTriangleFrontFace,
+  MOP_CandidateTriangleRayT,
+  MOP_CandidateType,
+  MOP_CandidateWorldToObject3x4,
+  MOP_CandidateWorldToObject4x3,
+  MOP_CommitNonOpaqueTriangleHit,
+  MOP_CommitProceduralPrimitiveHit,
+  MOP_CommittedGeometryIndex,
+  MOP_CommittedInstanceID,
+  MOP_CommittedInstanceIndex,
+  MOP_CommittedObjectRayDirection,
+  MOP_CommittedObjectRayOrigin,
+  MOP_CommittedObjectToWorld3x4,
+  MOP_CommittedObjectToWorld4x3,
+  MOP_CommittedPrimitiveIndex,
+  MOP_CommittedRayT,
+  MOP_CommittedStatus,
+  MOP_CommittedTriangleBarycentrics,
+  MOP_CommittedTriangleFrontFace,
+  MOP_CommittedWorldToObject3x4,
+  MOP_CommittedWorldToObject4x3,
+  MOP_Proceed,
+  MOP_RayFlags,
+  MOP_RayTMin,
   MOP_TraceRayInline,
+  MOP_WorldRayDirection,
+  MOP_WorldRayOrigin,
 #ifdef ENABLE_SPIRV_CODEGEN
   MOP_SubpassLoad,
 #endif // ENABLE_SPIRV_CODEGEN

+ 129 - 11
lib/DXIL/DxilOperations.cpp

@@ -322,11 +322,42 @@ const OP::OpCodeProperty OP::m_OpCodeProps[(unsigned)OP::OpCode::NumOpCodes] = {
   {  OC::WaveMultiPrefixOp,       "WaveMultiPrefixOp",        OCC::WaveMultiPrefixOp,        "waveMultiPrefixOp",         { false,  true,  true,  true, false,  true,  true,  true,  true, false, false}, Attribute::None,     },
   {  OC::WaveMultiPrefixBitCount, "WaveMultiPrefixBitCount",  OCC::WaveMultiPrefixBitCount,  "waveMultiPrefixBitCount",   {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
 
-  //                                                                                                                         void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64,   udt,   obj ,  function attribute
-  {  OC::AllocateRayQuery,        "AllocateRayQuery",         OCC::AllocateRayQuery,         "allocateRayQuery",          {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
-
   // Inline Ray Query                                                                                                        void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64,   udt,   obj ,  function attribute
-  {  OC::TraceRayInline,          "TraceRayInline",           OCC::TraceRayInline,           "traceRayInline",            {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::AllocateRayQuery,        "AllocateRayQuery",         OCC::AllocateRayQuery,         "allocateRayQuery",          {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::RayQuery_TraceRayInline, "RayQuery_TraceRayInline",  OCC::RayQuery_TraceRayInline,  "rayQuery_TraceRayInline",   {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::RayQuery_Proceed,        "RayQuery_Proceed",         OCC::RayQuery_Proceed,         "rayQuery_Proceed",          { false, false, false, false,  true, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::RayQuery_Abort,          "RayQuery_Abort",           OCC::RayQuery_Abort,           "rayQuery_Abort",            {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::RayQuery_CommitNonOpaqueTriangleHit, "RayQuery_CommitNonOpaqueTriangleHit", OCC::RayQuery_CommitNonOpaqueTriangleHit, "rayQuery_CommitNonOpaqueTriangleHit", {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::RayQuery_CommitProceduralPrimitiveHit, "RayQuery_CommitProceduralPrimitiveHit", OCC::RayQuery_CommitProceduralPrimitiveHit, "rayQuery_CommitProceduralPrimitiveHit", {  true, false, false, false, false, false, false, false, false, false, false}, Attribute::None,     },
+  {  OC::RayQuery_CommittedStatus, "RayQuery_CommittedStatus", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateType,  "RayQuery_CandidateType",   OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateObjectToWorld3x4, "RayQuery_CandidateObjectToWorld3x4", OCC::RayQuery_StateMatrix,     "rayQuery_StateMatrix",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateWorldToObject3x4, "RayQuery_CandidateWorldToObject3x4", OCC::RayQuery_StateMatrix,     "rayQuery_StateMatrix",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedObjectToWorld3x4, "RayQuery_CommittedObjectToWorld3x4", OCC::RayQuery_StateMatrix,     "rayQuery_StateMatrix",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedWorldToObject3x4, "RayQuery_CommittedWorldToObject3x4", OCC::RayQuery_StateMatrix,     "rayQuery_StateMatrix",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateProceduralPrimitiveNonOpaque, "RayQuery_CandidateProceduralPrimitiveNonOpaque", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false,  true, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateTriangleFrontFace, "RayQuery_CandidateTriangleFrontFace", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false,  true, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedTriangleFrontFace, "RayQuery_CommittedTriangleFrontFace", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false,  true, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateTriangleBarycentrics, "RayQuery_CandidateTriangleBarycentrics", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedTriangleBarycentrics, "RayQuery_CommittedTriangleBarycentrics", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_RayFlags,       "RayQuery_RayFlags",        OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_WorldRayOrigin, "RayQuery_WorldRayOrigin",  OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_WorldRayDirection, "RayQuery_WorldRayDirection", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_RayTMin,        "RayQuery_RayTMin",         OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateTriangleRayT, "RayQuery_CandidateTriangleRayT", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedRayT,  "RayQuery_CommittedRayT",   OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateInstanceIndex, "RayQuery_CandidateInstanceIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateInstanceID, "RayQuery_CandidateInstanceID", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateGeometryIndex, "RayQuery_CandidateGeometryIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidatePrimitiveIndex, "RayQuery_CandidatePrimitiveIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateObjectRayOrigin, "RayQuery_CandidateObjectRayOrigin", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CandidateObjectRayDirection, "RayQuery_CandidateObjectRayDirection", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedInstanceIndex, "RayQuery_CommittedInstanceIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedInstanceID, "RayQuery_CommittedInstanceID", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedGeometryIndex, "RayQuery_CommittedGeometryIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedPrimitiveIndex, "RayQuery_CommittedPrimitiveIndex", OCC::RayQuery_StateScalar,     "rayQuery_StateScalar",      { false, false, false, false, false, false, false,  true, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedObjectRayOrigin, "RayQuery_CommittedObjectRayOrigin", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
+  {  OC::RayQuery_CommittedObjectRayDirection, "RayQuery_CommittedObjectRayDirection", OCC::RayQuery_StateVector,     "rayQuery_StateVector",      { false, false,  true, false, false, false, false, false, false, false, false}, Attribute::ReadOnly, },
 };
 // OPCODE-OLOADS:END
 
@@ -663,8 +694,30 @@ void OP::GetMinShaderModelAndMask(OpCode C, bool bWithTranslation,
     return;
   }
   // Instructions: WaveMatch=165, WaveMultiPrefixOp=166,
-  // WaveMultiPrefixBitCount=167, TraceRayInline=169
-  if ((165 <= op && op <= 167) || op == 169) {
+  // WaveMultiPrefixBitCount=167, AllocateRayQuery=168,
+  // RayQuery_TraceRayInline=169, RayQuery_Proceed=170, RayQuery_Abort=171,
+  // RayQuery_CommitNonOpaqueTriangleHit=172,
+  // RayQuery_CommitProceduralPrimitiveHit=173, RayQuery_CommittedStatus=174,
+  // RayQuery_CandidateType=175, RayQuery_CandidateObjectToWorld3x4=176,
+  // RayQuery_CandidateWorldToObject3x4=177,
+  // RayQuery_CommittedObjectToWorld3x4=178,
+  // RayQuery_CommittedWorldToObject3x4=179,
+  // RayQuery_CandidateProceduralPrimitiveNonOpaque=180,
+  // RayQuery_CandidateTriangleFrontFace=181,
+  // RayQuery_CommittedTriangleFrontFace=182,
+  // RayQuery_CandidateTriangleBarycentrics=183,
+  // RayQuery_CommittedTriangleBarycentrics=184, RayQuery_RayFlags=185,
+  // RayQuery_WorldRayOrigin=186, RayQuery_WorldRayDirection=187,
+  // RayQuery_RayTMin=188, RayQuery_CandidateTriangleRayT=189,
+  // RayQuery_CommittedRayT=190, RayQuery_CandidateInstanceIndex=191,
+  // RayQuery_CandidateInstanceID=192, RayQuery_CandidateGeometryIndex=193,
+  // RayQuery_CandidatePrimitiveIndex=194, RayQuery_CandidateObjectRayOrigin=195,
+  // RayQuery_CandidateObjectRayDirection=196,
+  // RayQuery_CommittedInstanceIndex=197, RayQuery_CommittedInstanceID=198,
+  // RayQuery_CommittedGeometryIndex=199, RayQuery_CommittedPrimitiveIndex=200,
+  // RayQuery_CommittedObjectRayOrigin=201,
+  // RayQuery_CommittedObjectRayDirection=202
+  if ((165 <= op && op <= 202)) {
     major = 6;  minor = 5;
     return;
   }
@@ -1069,11 +1122,42 @@ Function *OP::GetOpFunc(OpCode opCode, Type *pOverloadType) {
   case OpCode::WaveMultiPrefixOp:      A(pETy);     A(pI32); A(pETy); A(pI32); A(pI32); A(pI32); A(pI32); A(pI8);  A(pI8);  break;
   case OpCode::WaveMultiPrefixBitCount:A(pI32);     A(pI32); A(pI1);  A(pI32); A(pI32); A(pI32); A(pI32); break;
 
-    // 
-  case OpCode::AllocateRayQuery:       A(pI32);     A(pI32); A(pI32); break;
-
     // Inline Ray Query
-  case OpCode::TraceRayInline:         A(pV);       A(pI32); A(pI32); A(pRes); A(pI32); A(pI32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); break;
+  case OpCode::AllocateRayQuery:       A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_TraceRayInline:A(pV);       A(pI32); A(pI32); A(pRes); A(pI32); A(pI32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); A(pF32); break;
+  case OpCode::RayQuery_Proceed:       A(pI1);      A(pI32); A(pI32); break;
+  case OpCode::RayQuery_Abort:         A(pV);       A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommitNonOpaqueTriangleHit:A(pV);       A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommitProceduralPrimitiveHit:A(pV);       A(pI32); A(pI32); A(pF32); break;
+  case OpCode::RayQuery_CommittedStatus:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateType: A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateObjectToWorld3x4:A(pF32);     A(pI32); A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CandidateWorldToObject3x4:A(pF32);     A(pI32); A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CommittedObjectToWorld3x4:A(pF32);     A(pI32); A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CommittedWorldToObject3x4:A(pF32);     A(pI32); A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CandidateProceduralPrimitiveNonOpaque:A(pI1);      A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateTriangleFrontFace:A(pI1);      A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedTriangleFrontFace:A(pI1);      A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateTriangleBarycentrics:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CommittedTriangleBarycentrics:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_RayFlags:      A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_WorldRayOrigin:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_WorldRayDirection:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_RayTMin:       A(pF32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateTriangleRayT:A(pF32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedRayT: A(pF32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateInstanceIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateInstanceID:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateGeometryIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidatePrimitiveIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CandidateObjectRayOrigin:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CandidateObjectRayDirection:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CommittedInstanceIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedInstanceID:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedGeometryIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedPrimitiveIndex:A(pI32);     A(pI32); A(pI32); break;
+  case OpCode::RayQuery_CommittedObjectRayOrigin:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
+  case OpCode::RayQuery_CommittedObjectRayDirection:A(pF32);     A(pI32); A(pI32); A(pI8);  break;
   // OPCODE-OLOAD-FUNCS:END
   default: DXASSERT(false, "otherwise unhandled case"); break;
   }
@@ -1228,7 +1312,10 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) {
   case OpCode::AcceptHitAndEndSearch:
   case OpCode::WaveMultiPrefixBitCount:
   case OpCode::AllocateRayQuery:
-  case OpCode::TraceRayInline:
+  case OpCode::RayQuery_TraceRayInline:
+  case OpCode::RayQuery_Abort:
+  case OpCode::RayQuery_CommitNonOpaqueTriangleHit:
+  case OpCode::RayQuery_CommitProceduralPrimitiveHit:
     return Type::getVoidTy(m_Ctx);
   case OpCode::CheckAccessFullyMapped:
   case OpCode::AtomicBinOp:
@@ -1253,6 +1340,17 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) {
   case OpCode::PrimitiveIndex:
   case OpCode::Dot4AddI8Packed:
   case OpCode::Dot4AddU8Packed:
+  case OpCode::RayQuery_CommittedStatus:
+  case OpCode::RayQuery_CandidateType:
+  case OpCode::RayQuery_RayFlags:
+  case OpCode::RayQuery_CandidateInstanceIndex:
+  case OpCode::RayQuery_CandidateInstanceID:
+  case OpCode::RayQuery_CandidateGeometryIndex:
+  case OpCode::RayQuery_CandidatePrimitiveIndex:
+  case OpCode::RayQuery_CommittedInstanceIndex:
+  case OpCode::RayQuery_CommittedInstanceID:
+  case OpCode::RayQuery_CommittedGeometryIndex:
+  case OpCode::RayQuery_CommittedPrimitiveIndex:
     return IntegerType::get(m_Ctx, 32);
   case OpCode::CalculateLOD:
   case OpCode::DomainLocation:
@@ -1264,10 +1362,30 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) {
   case OpCode::WorldToObject:
   case OpCode::RayTMin:
   case OpCode::RayTCurrent:
+  case OpCode::RayQuery_CandidateObjectToWorld3x4:
+  case OpCode::RayQuery_CandidateWorldToObject3x4:
+  case OpCode::RayQuery_CommittedObjectToWorld3x4:
+  case OpCode::RayQuery_CommittedWorldToObject3x4:
+  case OpCode::RayQuery_CandidateTriangleBarycentrics:
+  case OpCode::RayQuery_CommittedTriangleBarycentrics:
+  case OpCode::RayQuery_WorldRayOrigin:
+  case OpCode::RayQuery_WorldRayDirection:
+  case OpCode::RayQuery_RayTMin:
+  case OpCode::RayQuery_CandidateTriangleRayT:
+  case OpCode::RayQuery_CommittedRayT:
+  case OpCode::RayQuery_CandidateObjectRayOrigin:
+  case OpCode::RayQuery_CandidateObjectRayDirection:
+  case OpCode::RayQuery_CommittedObjectRayOrigin:
+  case OpCode::RayQuery_CommittedObjectRayDirection:
     return Type::getFloatTy(m_Ctx);
   case OpCode::MakeDouble:
   case OpCode::SplitDouble:
     return Type::getDoubleTy(m_Ctx);
+  case OpCode::RayQuery_Proceed:
+  case OpCode::RayQuery_CandidateProceduralPrimitiveNonOpaque:
+  case OpCode::RayQuery_CandidateTriangleFrontFace:
+  case OpCode::RayQuery_CommittedTriangleFrontFace:
+    return IntegerType::get(m_Ctx, 1);
   case OpCode::CBufferLoadLegacy:
   case OpCode::Sample:
   case OpCode::SampleBias:

+ 13 - 0
lib/DXIL/DxilShaderFlags.cpp

@@ -47,6 +47,8 @@ ShaderFlags::ShaderFlags():
 , m_bBarycentrics(false)
 , m_bUseNativeLowPrecision(false)
 , m_bShadingRate(false)
+, m_bSamplerFeedback(false)
+, m_bRaytracingTier1_1(false)
 , m_align0(0)
 , m_align1(0)
 {}
@@ -93,6 +95,8 @@ uint64_t ShaderFlags::GetFeatureInfo() const {
   Flags |= m_bViewID ? hlsl::DXIL::ShaderFeatureInfo_ViewID : 0;
   Flags |= m_bBarycentrics ? hlsl::DXIL::ShaderFeatureInfo_Barycentrics : 0;
   Flags |= m_bShadingRate ? hlsl::DXIL::ShaderFeatureInfo_ShadingRate : 0;
+  Flags |= m_bRaytracingTier1_1 ? hlsl::DXIL::ShaderFeatureInfo_Raytracing_Tier_1_1 : 0;
+  Flags |= m_bSamplerFeedback ? hlsl::DXIL::ShaderFeatureInfo_SamplerFeedback : 0;
 
   return Flags;
 }
@@ -145,6 +149,8 @@ uint64_t ShaderFlags::GetShaderFlagsRawForCollection() {
   Flags.SetViewID(true);
   Flags.SetBarycentrics(true);
   Flags.SetShadingRate(true);
+  Flags.SetRaytracingTier1_1(true);
+  Flags.SetSamplerFeedback(true);
   return Flags.GetShaderFlagsRaw();
 }
 
@@ -247,6 +253,8 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
   bool hasMulticomponentUAVLoads = false;
   bool hasViewportOrRTArrayIndex = false;
   bool hasShadingRate = false;
+  bool hasSamplerFeedback = false;
+  bool hasRaytracingTier1_1 = false;
 
   // Try to maintain compatibility with a v1.0 validator if that's what we have.
   uint32_t valMajor, valMinor;
@@ -381,6 +389,9 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
         case DXIL::OpCode::ViewID:
           hasViewID = true;
           break;
+        case DXIL::OpCode::AllocateRayQuery:
+          hasRaytracingTier1_1 = true;
+          break;
         default:
           // Normal opcodes.
           break;
@@ -460,6 +471,8 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
   flag.SetViewID(hasViewID);
   flag.SetViewportAndRTArrayIndex(hasViewportOrRTArrayIndex);
   flag.SetShadingRate(hasShadingRate);
+  flag.SetSamplerFeedback(hasSamplerFeedback);
+  flag.SetRaytracingTier1_1(hasRaytracingTier1_1);
 
   return flag;
 }

+ 1 - 1
lib/DxilPIXPasses/DxilShaderAccessTracking.cpp

@@ -453,7 +453,7 @@ bool DxilShaderAccessTracking::runOnModule(Module &M)
 
 
     // todo: should "GetDimensions" mean a resource access?
-    static_assert(DXIL::OpCode::NumOpCodes == static_cast<DXIL::OpCode>(170), "Please update PIX passes if any resource access opcodes are added");
+    static_assert(DXIL::OpCode::NumOpCodes == static_cast<DXIL::OpCode>(203), "Please update PIX passes if any resource access opcodes are added");
     ResourceAccessFunction raFunctions[] = {
       { DXIL::OpCode::CBufferLoadLegacy     , ShaderAccessFlags::Read   , false, f32i32f64 },
       { DXIL::OpCode::CBufferLoad           , ShaderAccessFlags::Read   , false, f16f32f64i16i32i64 },

+ 1 - 16
lib/HLSL/DxilContainerReflection.cpp

@@ -2152,22 +2152,7 @@ UINT DxilShaderReflection::GetThreadGroupSize(UINT *pSizeX, UINT *pSizeY, UINT *
 }
 
 UINT64 DxilShaderReflection::GetRequiresFlags() {
-  UINT64 result = 0;
-  uint64_t features = m_pDxilModule->m_ShaderFlags.GetFeatureInfo();
-  if (features & ShaderFeatureInfo_Doubles) result |= D3D_SHADER_REQUIRES_DOUBLES;
-  if (features & ShaderFeatureInfo_UAVsAtEveryStage) result |= D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE;
-  if (features & ShaderFeatureInfo_64UAVs) result |= D3D_SHADER_REQUIRES_64_UAVS;
-  if (features & ShaderFeatureInfo_MinimumPrecision) result |= D3D_SHADER_REQUIRES_MINIMUM_PRECISION;
-  if (features & ShaderFeatureInfo_11_1_DoubleExtensions) result |= D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS;
-  if (features & ShaderFeatureInfo_11_1_ShaderExtensions) result |= D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS;
-  if (features & ShaderFeatureInfo_LEVEL9ComparisonFiltering) result |= D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING;
-  if (features & ShaderFeatureInfo_TiledResources) result |= D3D_SHADER_REQUIRES_TILED_RESOURCES;
-  if (features & ShaderFeatureInfo_StencilRef) result |= D3D_SHADER_REQUIRES_STENCIL_REF;
-  if (features & ShaderFeatureInfo_InnerCoverage) result |= D3D_SHADER_REQUIRES_INNER_COVERAGE;
-  if (features & ShaderFeatureInfo_TypedUAVLoadAdditionalFormats) result |= D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS;
-  if (features & ShaderFeatureInfo_ROVs) result |= D3D_SHADER_REQUIRES_ROVS;
-  if (features & ShaderFeatureInfo_ViewportAndRTArrayIndexFromAnyShaderFeedingRasterizer) result |= D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER;
-  return result;
+  return m_pDxilModule->m_ShaderFlags.GetFeatureInfo();
 }
 
 

+ 24 - 2
lib/HLSL/DxilValidation.cpp

@@ -856,8 +856,30 @@ static bool ValidateOpcodeInProfile(DXIL::OpCode opcode,
   if ((162 <= op && op <= 164))
     return (major > 6 || (major == 6 && minor >= 4));
   // Instructions: WaveMatch=165, WaveMultiPrefixOp=166,
-  // WaveMultiPrefixBitCount=167, TraceRayInline=169
-  if ((165 <= op && op <= 167) || op == 169)
+  // WaveMultiPrefixBitCount=167, AllocateRayQuery=168,
+  // RayQuery_TraceRayInline=169, RayQuery_Proceed=170, RayQuery_Abort=171,
+  // RayQuery_CommitNonOpaqueTriangleHit=172,
+  // RayQuery_CommitProceduralPrimitiveHit=173, RayQuery_CommittedStatus=174,
+  // RayQuery_CandidateType=175, RayQuery_CandidateObjectToWorld3x4=176,
+  // RayQuery_CandidateWorldToObject3x4=177,
+  // RayQuery_CommittedObjectToWorld3x4=178,
+  // RayQuery_CommittedWorldToObject3x4=179,
+  // RayQuery_CandidateProceduralPrimitiveNonOpaque=180,
+  // RayQuery_CandidateTriangleFrontFace=181,
+  // RayQuery_CommittedTriangleFrontFace=182,
+  // RayQuery_CandidateTriangleBarycentrics=183,
+  // RayQuery_CommittedTriangleBarycentrics=184, RayQuery_RayFlags=185,
+  // RayQuery_WorldRayOrigin=186, RayQuery_WorldRayDirection=187,
+  // RayQuery_RayTMin=188, RayQuery_CandidateTriangleRayT=189,
+  // RayQuery_CommittedRayT=190, RayQuery_CandidateInstanceIndex=191,
+  // RayQuery_CandidateInstanceID=192, RayQuery_CandidateGeometryIndex=193,
+  // RayQuery_CandidatePrimitiveIndex=194, RayQuery_CandidateObjectRayOrigin=195,
+  // RayQuery_CandidateObjectRayDirection=196,
+  // RayQuery_CommittedInstanceIndex=197, RayQuery_CommittedInstanceID=198,
+  // RayQuery_CommittedGeometryIndex=199, RayQuery_CommittedPrimitiveIndex=200,
+  // RayQuery_CommittedObjectRayOrigin=201,
+  // RayQuery_CommittedObjectRayDirection=202
+  if ((165 <= op && op <= 202))
     return (major > 6 || (major == 6 && minor >= 5));
   return true;
   // VALOPCODESM-TEXT:END

+ 144 - 9
lib/HLSL/HLOperationLower.cpp

@@ -4678,6 +4678,16 @@ void AllocateRayQueryObjects(llvm::Module *M, HLOperationLowerHelper &helper) {
   }
 }
 
+static Value* TranslateThisPointerToi32Handle(CallInst*CI, hlsl::OP *hlslOP)
+{
+  IRBuilder<> Builder(CI);
+  Value *thisArg = CI->getArgOperand(1);
+  Constant *i32Zero = hlslOP->GetI32Const(0);
+  Value *handleGEP = Builder.CreateGEP(thisArg, {i32Zero, i32Zero});
+  Value *handleValue = Builder.CreateLoad(handleGEP);
+  return handleValue;
+  }
+
 Value *TranslateTraceRayInline(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
                          HLOperationLowerHelper &helper,
                          HLObjectOperationLowerHelper *pObjHelper,
@@ -4691,13 +4701,8 @@ Value *TranslateTraceRayInline(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
   Value *Args[DXIL::OperandIndex::kTraceRayInlineNumOp];
   Args[0] = opArg;
 
-  // Translate RayQuery `this` pointer to i32 handle by-value
-  IRBuilder<> Builder(CI);
-  Value *thisArg = CI->getArgOperand(1);
-  Constant *i32Zero = hlslOP->GetI32Const(0);
-  Value *handleGEP = Builder.CreateGEP(thisArg, {i32Zero, i32Zero});
-  Value *handleValue = Builder.CreateLoad(handleGEP);
-  Args[1] = handleValue;
+  // Translate this pointer to i32 handle value
+  Args[1] = TranslateThisPointerToi32Handle(CI, hlslOP);
 
   for (unsigned i = 2; i < HLOperandIndex::kTraceRayInlineRayDescOpIdx; i++) {
     Args[i] = CI->getArgOperand(i);
@@ -4709,6 +4714,7 @@ Value *TranslateTraceRayInline(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
   //    float3 Direction;
   //    float  TMax;
   //};
+  IRBuilder<> Builder(CI);
   Value *zeroIdx = hlslOP->GetU32Const(0);
   Value *origin = Builder.CreateGEP(rayDesc, {zeroIdx, zeroIdx});
   origin = Builder.CreateLoad(origin);
@@ -4739,6 +4745,98 @@ Value *TranslateTraceRayInline(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
   return Builder.CreateCall(F, Args);
 }
 
+Value *TranslateCommitProceduralPrimitiveHit(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
+                         HLOperationLowerHelper &helper,
+                         HLObjectOperationLowerHelper *pObjHelper,
+                         bool &Translated) {
+  hlsl::OP *hlslOP = &helper.hlslOP;
+  Value *THit = CI->getArgOperand(HLOperandIndex::kBinaryOpSrc1Idx);
+  Value *opArg = hlslOP->GetU32Const(static_cast<unsigned>(opcode));
+
+  Value *Args[] = {opArg,TranslateThisPointerToi32Handle(CI, hlslOP),THit};
+
+  IRBuilder<> Builder(CI);
+  Function *F = hlslOP->GetOpFunc(opcode, Builder.getVoidTy());
+
+  return Builder.CreateCall(F, Args);
+}
+
+Value *TranslateGenericRayQueryMethod(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
+                         HLOperationLowerHelper &helper,
+                         HLObjectOperationLowerHelper *pObjHelper,
+                         bool &Translated) {
+  hlsl::OP *hlslOP = &helper.hlslOP;
+
+  Value *opArg = hlslOP->GetU32Const(static_cast<unsigned>(opcode));
+
+  Value *Args[] = {opArg,TranslateThisPointerToi32Handle(CI, hlslOP)};
+
+  IRBuilder<> Builder(CI);
+  Function *F = hlslOP->GetOpFunc(opcode, CI->getType());
+
+  return Builder.CreateCall(F, Args);
+}
+
+Value *TranslateRayQueryMatrix3x4Operation(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
+                         HLOperationLowerHelper &helper,
+                         HLObjectOperationLowerHelper *pObjHelper,
+                         bool &Translated) {
+  hlsl::OP *hlslOP = &helper.hlslOP;
+  VectorType *Ty = cast<VectorType>(CI->getType());
+  Value* handle = TranslateThisPointerToi32Handle(CI, hlslOP);
+  uint32_t rVals[] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2};
+  Constant *rows = ConstantDataVector::get(CI->getContext(), rVals);
+  uint8_t cVals[] = {0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3};
+  Constant *cols = ConstantDataVector::get(CI->getContext(), cVals);
+  Value *retVal =
+      TrivialDxilOperation(opcode, {nullptr, handle, rows, cols}, Ty, CI, hlslOP);
+  return retVal;
+}
+
+Value *TranslateRayQueryTransposedMatrix3x4Operation(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
+                                                  HLOperationLowerHelper &helper,
+                                                  HLObjectOperationLowerHelper *pObjHelper,
+                                                  bool &Translated) {
+  hlsl::OP *hlslOP = &helper.hlslOP; 
+  VectorType *Ty = cast<VectorType>(CI->getType());
+  Value* handle = TranslateThisPointerToi32Handle(CI, hlslOP);
+  uint32_t rVals[] = { 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2 };
+  Constant *rows = ConstantDataVector::get(CI->getContext(), rVals);
+  uint8_t cVals[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3 };
+  Constant *cols = ConstantDataVector::get(CI->getContext(), cVals);
+  Value *retVal =
+      TrivialDxilOperation(opcode, {nullptr, handle, rows, cols}, Ty, CI, hlslOP);
+  return retVal;
+}
+
+Value *TranslateRayQueryFloat2Getter(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
+                         HLOperationLowerHelper &helper,
+                         HLObjectOperationLowerHelper *pObjHelper,
+                         bool &Translated) {
+  hlsl::OP *hlslOP = &helper.hlslOP;
+  VectorType *Ty = cast<VectorType>(CI->getType());
+  Value* handle = TranslateThisPointerToi32Handle(CI, hlslOP);
+  uint8_t elementVals[] = {0, 1};
+  Constant *element = ConstantDataVector::get(CI->getContext(), elementVals);
+  Value *retVal =
+      TrivialDxilOperation(opcode, {nullptr, handle, element}, Ty, CI, hlslOP);
+  return retVal;
+}
+
+Value *TranslateRayQueryFloat3Getter(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
+                         HLOperationLowerHelper &helper,
+                         HLObjectOperationLowerHelper *pObjHelper,
+                         bool &Translated) {
+  hlsl::OP *hlslOP = &helper.hlslOP;
+  VectorType *Ty = cast<VectorType>(CI->getType());
+  Value* handle = TranslateThisPointerToi32Handle(CI, hlslOP);
+  uint8_t elementVals[] = {0, 1, 2};
+  Constant *element = ConstantDataVector::get(CI->getContext(), elementVals);
+  Value *retVal =
+      TrivialDxilOperation(opcode, {nullptr, handle, element}, Ty, CI, hlslOP);
+  return retVal;
+}
+
 Value *TranslateNoArgVectorOperation(CallInst *CI, IntrinsicOp IOP, OP::OpCode opcode,
                          HLOperationLowerHelper &helper,
                          HLObjectOperationLowerHelper *pObjHelper,
@@ -5131,7 +5229,44 @@ IntrinsicLower gLowerTable[static_cast<unsigned>(IntrinsicOp::Num_Intrinsics)] =
     {IntrinsicOp::MOP_IncrementCounter, GenerateUpdateCounter, DXIL::OpCode::NumOpCodes},
     {IntrinsicOp::MOP_Consume, EmptyLower, DXIL::OpCode::NumOpCodes},
 
-    {IntrinsicOp::MOP_TraceRayInline, TranslateTraceRayInline, DXIL::OpCode::TraceRayInline},
+    {IntrinsicOp::MOP_Abort, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_Abort},
+    {IntrinsicOp::MOP_CandidateGeometryIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateGeometryIndex},
+    {IntrinsicOp::MOP_CandidateInstanceID, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateInstanceID},
+    {IntrinsicOp::MOP_CandidateInstanceIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateInstanceIndex},
+    {IntrinsicOp::MOP_CandidateObjectRayDirection, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_CandidateObjectRayDirection},
+    {IntrinsicOp::MOP_CandidateObjectRayOrigin, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_CandidateObjectRayOrigin},
+    {IntrinsicOp::MOP_CandidateObjectToWorld3x4, TranslateRayQueryMatrix3x4Operation, DXIL::OpCode::RayQuery_CandidateObjectToWorld3x4},
+    {IntrinsicOp::MOP_CandidateObjectToWorld4x3, TranslateRayQueryTransposedMatrix3x4Operation, DXIL::OpCode::RayQuery_CandidateObjectToWorld3x4},
+    {IntrinsicOp::MOP_CandidatePrimitiveIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidatePrimitiveIndex},
+    {IntrinsicOp::MOP_CandidateProceduralPrimitiveNonOpaque, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateProceduralPrimitiveNonOpaque},
+    {IntrinsicOp::MOP_CandidateTriangleBarycentrics, TranslateRayQueryFloat2Getter, DXIL::OpCode::RayQuery_CandidateTriangleBarycentrics},
+    {IntrinsicOp::MOP_CandidateTriangleFrontFace, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateTriangleFrontFace},
+    {IntrinsicOp::MOP_CandidateTriangleRayT, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateTriangleRayT},
+    {IntrinsicOp::MOP_CandidateType, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CandidateType},
+    {IntrinsicOp::MOP_CandidateWorldToObject3x4, TranslateRayQueryMatrix3x4Operation, DXIL::OpCode::RayQuery_CandidateWorldToObject3x4},
+    {IntrinsicOp::MOP_CandidateWorldToObject4x3, TranslateRayQueryTransposedMatrix3x4Operation, DXIL::OpCode::RayQuery_CandidateWorldToObject3x4},
+    {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_CommittedInstanceID, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedInstanceID},
+    {IntrinsicOp::MOP_CommittedInstanceIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedInstanceIndex},
+    {IntrinsicOp::MOP_CommittedObjectRayDirection, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_CommittedObjectRayDirection},
+    {IntrinsicOp::MOP_CommittedObjectRayOrigin, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_CommittedObjectRayOrigin},
+    {IntrinsicOp::MOP_CommittedObjectToWorld3x4, TranslateRayQueryMatrix3x4Operation, DXIL::OpCode::RayQuery_CommittedObjectToWorld3x4},
+    {IntrinsicOp::MOP_CommittedObjectToWorld4x3, TranslateRayQueryTransposedMatrix3x4Operation, DXIL::OpCode::RayQuery_CommittedObjectToWorld3x4},
+    {IntrinsicOp::MOP_CommittedPrimitiveIndex, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedPrimitiveIndex},
+    {IntrinsicOp::MOP_CommittedRayT, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedRayT},
+    {IntrinsicOp::MOP_CommittedStatus, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedStatus},
+    {IntrinsicOp::MOP_CommittedTriangleBarycentrics, TranslateRayQueryFloat2Getter, DXIL::OpCode::RayQuery_CommittedTriangleBarycentrics},
+    {IntrinsicOp::MOP_CommittedTriangleFrontFace, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_CommittedTriangleFrontFace},
+    {IntrinsicOp::MOP_CommittedWorldToObject3x4, TranslateRayQueryMatrix3x4Operation, DXIL::OpCode::RayQuery_CommittedWorldToObject3x4},
+    {IntrinsicOp::MOP_CommittedWorldToObject4x3, TranslateRayQueryTransposedMatrix3x4Operation, DXIL::OpCode::RayQuery_CommittedWorldToObject3x4},
+    {IntrinsicOp::MOP_Proceed, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_Proceed},
+    {IntrinsicOp::MOP_RayFlags, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_RayFlags},
+    {IntrinsicOp::MOP_RayTMin, TranslateGenericRayQueryMethod, DXIL::OpCode::RayQuery_RayTMin},
+    {IntrinsicOp::MOP_TraceRayInline,  TranslateTraceRayInline,  DXIL::OpCode::RayQuery_TraceRayInline},
+    {IntrinsicOp::MOP_WorldRayDirection, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_WorldRayDirection},
+    {IntrinsicOp::MOP_WorldRayOrigin, TranslateRayQueryFloat3Getter, DXIL::OpCode::RayQuery_WorldRayOrigin},
 
     // SPIRV change starts
 #ifdef ENABLE_SPIRV_CODEGEN
@@ -6367,7 +6502,7 @@ void TranslateStructBufMatSt(Type *matType, IRBuilder<> &Builder, Value *handle,
   for (unsigned i = 0; i < matSize; i++)
     elts[i] = Builder.CreateExtractElement(val, i);
 
-  for (unsigned i = 0; i < matSize; i += 4) {
+  for (unsigned i = 0; i < matSize; i += 4) { 
     uint8_t mask = 0;
     for (unsigned j = 0; j < 4 && (i+j) < matSize; j++) {
       if (elts[i+j] != undefElt)

+ 2 - 0
tools/clang/include/clang/AST/HlslTypes.h

@@ -305,6 +305,8 @@ void AddRecordTypeWithHandle(
 void AddRayFlags(clang::ASTContext& context);
 void AddHitKinds(clang::ASTContext& context);
 void AddStateObjectFlags(clang::ASTContext& context);
+void AddCommittedStatus(clang::ASTContext& context);
+void AddCandidateType(clang::ASTContext& context);
 
 /// <summary>Adds the implementation for std::is_equal.</summary>
 void AddStdIsEqualImplementation(clang::ASTContext& context, clang::Sema& sema);

+ 29 - 0
tools/clang/lib/AST/ASTContextHLSL.cpp

@@ -576,6 +576,35 @@ void hlsl::AddStateObjectFlags(ASTContext& context) {
   AddConstUInt(context, curDC, StringRef("STATE_OBJECT_FLAGS_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS"), (unsigned)DXIL::StateObjectFlags::AllowExternalDependenciesOnLocalDefinitions);
 }
 
+/// <summary> Adds const integers for committed status </summary>
+void hlsl::AddCommittedStatus(ASTContext& context) {
+  DeclContext *curDC = context.getTranslationUnitDecl();
+  // typedef uint COMMITTED_STATUS;
+  IdentifierInfo &enumId = context.Idents.get(StringRef("COMMITTED_STATUS"), tok::TokenKind::identifier);
+  TypeSourceInfo *uintTypeSource = context.getTrivialTypeSourceInfo(context.UnsignedIntTy, NoLoc);
+  TypedefDecl *enumDecl = TypedefDecl::Create(context, curDC, NoLoc, NoLoc, &enumId, uintTypeSource);
+  curDC->addDecl(enumDecl);
+  enumDecl->setImplicit(true);
+  // static const uint COMMITTED_* = *;
+  AddConstUInt(context, curDC, StringRef("COMMITTED_NOTHING"), (unsigned)DXIL::CommittedStatus::CommittedNothing);
+  AddConstUInt(context, curDC, StringRef("COMMITTED_TRIANGLE_HIT"), (unsigned)DXIL::CommittedStatus::CommittedTriangleHit);
+  AddConstUInt(context, curDC, StringRef("COMMITTED_PROCEDURAL_PRIMITIVE_HIT"), (unsigned)DXIL::CommittedStatus::CommittedProceduralPrimitiveHit);
+}
+
+/// <summary> Adds const integers for candidate type </summary>
+void hlsl::AddCandidateType(ASTContext& context) {
+  DeclContext *curDC = context.getTranslationUnitDecl();
+  // typedef uint CANDIDATE_TYPE;
+  IdentifierInfo &enumId = context.Idents.get(StringRef("CANDIDATE_TYPE"), tok::TokenKind::identifier);
+  TypeSourceInfo *uintTypeSource = context.getTrivialTypeSourceInfo(context.UnsignedIntTy, NoLoc);
+  TypedefDecl *enumDecl = TypedefDecl::Create(context, curDC, NoLoc, NoLoc, &enumId, uintTypeSource);
+  curDC->addDecl(enumDecl);
+  enumDecl->setImplicit(true);
+  // static const uint CANDIDATE_* = *;
+  AddConstUInt(context, curDC, StringRef("CANDIDATE_NON_OPAQUE_TRIANGLE"), (unsigned)DXIL::CandidateType::CandidateNonOpaqueTriangle);
+  AddConstUInt(context, curDC, StringRef("CANDIDATE_PROCEDURAL_PRIMITIVE"), (unsigned)DXIL::CandidateType::CandidateProceduralPrimitive);
+}
+
 static
 Expr* IntConstantAsBoolExpr(clang::Sema& sema, uint64_t value)
 {

+ 2 - 0
tools/clang/lib/Sema/SemaHLSL.cpp

@@ -4184,6 +4184,8 @@ public:
     AddRayFlags(*m_context);
     AddHitKinds(*m_context);
     AddStateObjectFlags(*m_context);
+    AddCommittedStatus(*m_context);
+    AddCandidateType(*m_context);
 
     return true;
   }

+ 226 - 3
tools/clang/lib/Sema/gen_intrin_main_tables_15.h

@@ -5792,6 +5792,182 @@ static const HLSL_INTRINSIC g_ConsumeStructuredBufferMethods[] =
 //
 
 static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args0[] =
+{
+    {"Abort", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args1[] =
+{
+    {"CandidateGeometryIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args2[] =
+{
+    {"CandidateInstanceID", 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},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args4[] =
+{
+    {"CandidateObjectRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args5[] =
+{
+    {"CandidateObjectRayOrigin", 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},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args7[] =
+{
+    {"CandidateObjectToWorld4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args8[] =
+{
+    {"CandidatePrimitiveIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args9[] =
+{
+    {"CandidateProceduralPrimitiveNonOpaque", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args10[] =
+{
+    {"CandidateTriangleBarycentrics", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 2},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args11[] =
+{
+    {"CandidateTriangleFrontFace", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args12[] =
+{
+    {"CandidateTriangleRayT", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args13[] =
+{
+    {"CandidateType", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args14[] =
+{
+    {"CandidateWorldToObject3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args15[] =
+{
+    {"CandidateWorldToObject4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args16[] =
+{
+    {"CommitNonOpaqueTriangleHit", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args17[] =
+{
+    {"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[] =
+{
+    {"CommittedGeometryIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args19[] =
+{
+    {"CommittedInstanceID", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args20[] =
+{
+    {"CommittedInstanceIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args21[] =
+{
+    {"CommittedObjectRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args22[] =
+{
+    {"CommittedObjectRayOrigin", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args23[] =
+{
+    {"CommittedObjectToWorld3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args24[] =
+{
+    {"CommittedObjectToWorld4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args25[] =
+{
+    {"CommittedPrimitiveIndex", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args26[] =
+{
+    {"CommittedRayT", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args27[] =
+{
+    {"CommittedStatus", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args28[] =
+{
+    {"CommittedTriangleBarycentrics", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 2},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args29[] =
+{
+    {"CommittedTriangleFrontFace", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args30[] =
+{
+    {"CommittedWorldToObject3x4", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 3, 4},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args31[] =
+{
+    {"CommittedWorldToObject4x3", AR_QUAL_OUT, 0, LITEMPLATE_MATRIX, 0, LICOMPTYPE_FLOAT, 4, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args32[] =
+{
+    {"Proceed", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_BOOL, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args33[] =
+{
+    {"RayFlags", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_UINT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args34[] =
+{
+    {"RayTMin", AR_QUAL_OUT, 0, LITEMPLATE_SCALAR, 0, LICOMPTYPE_FLOAT, 1, 1},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args35[] =
 {
     {"TraceRayInline", 0, 0, LITEMPLATE_VOID, 0, LICOMPTYPE_VOID, 0, 0},
     {"AccelerationStructure", AR_QUAL_IN, 1, LITEMPLATE_OBJECT, 1, LICOMPTYPE_ACCELERATION_STRUCT, 1, 1},
@@ -5800,9 +5976,56 @@ static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args0[] =
     {"Ray", AR_QUAL_IN, 4, LITEMPLATE_OBJECT, 4, LICOMPTYPE_RAYDESC, 1, 1},
 };
 
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args36[] =
+{
+    {"WorldRayDirection", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+};
+
+static const HLSL_INTRINSIC_ARGUMENT g_RayQueryMethods_Args37[] =
+{
+    {"WorldRayOrigin", AR_QUAL_OUT, 0, LITEMPLATE_VECTOR, 0, LICOMPTYPE_FLOAT, 1, 3},
+};
+
 static const HLSL_INTRINSIC g_RayQueryMethods[] =
 {
-    {(UINT)hlsl::IntrinsicOp::MOP_TraceRayInline, false, false, -1, 5, g_RayQueryMethods_Args0},
+    {(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},
 };
 
 //
@@ -5858,7 +6081,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 = 1;
+static const UINT g_uRayQueryMethodsCount = 38;
 static const UINT g_uStreamMethodsCount = 2;
 static const UINT g_uStructuredBufferMethodsCount = 3;
 static const UINT g_uTexture1DArrayMethodsCount = 31;
@@ -5873,7 +6096,7 @@ static const UINT g_uTextureCUBEMethodsCount = 42;
 static const UINT g_uVkSubpassInputMSMethodsCount = 1;
 static const UINT g_uVkSubpassInputMethodsCount = 1;
 
-static const int g_MaxIntrinsicName = 32; // Count of characters for longest intrinsic name - 'DeviceMemoryBarrierWithGroupSync'
+static const int g_MaxIntrinsicName = 37; // Count of characters for longest intrinsic name - 'CandidateProceduralPrimitiveNonOpaque'
 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

+ 163 - 0
tools/clang/test/CodeGenHLSL/batch/shader_stages/raytracing/rayquery/tryAllOps.hlsl

@@ -0,0 +1,163 @@
+// RUN: %dxc -T cs_6_5 -E CS %s | FileCheck %s
+
+//  CHECK: define void @CS()
+
+RaytracingAccelerationStructure AccelerationStructure : register(t0);
+RWByteAddressBuffer log : register(u0);
+
+RayDesc MakeRayDesc()
+{
+    RayDesc desc;
+    desc.Origin = float3(0,0,0);
+    desc.Direction = float3(1,0,0);
+    desc.TMin = 0.0f;
+    desc.TMax = 9999.0;
+    return desc;
+}
+
+void DoSomething()
+{
+    log.Store(0,1);
+}
+
+[numThreads(1,1,1)]
+void CS()
+{
+    RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH> q;
+    RayDesc ray = MakeRayDesc();
+    q.TraceRayInline(AccelerationStructure,RAY_FLAG_NONE,0xFF,ray);
+    float4x3 mat4x3;
+    float3x4 mat3x4;
+    while(q.Proceed())
+    {
+        switch(q.CandidateType())
+        {
+        case CANDIDATE_NON_OPAQUE_TRIANGLE:
+            q.Abort();
+            mat3x4 = q.CandidateObjectToWorld3x4();
+            mat4x3 = q.CandidateObjectToWorld4x3();
+            q.CommitNonOpaqueTriangleHit();
+            if(q.CandidateTriangleFrontFace())
+            {
+                DoSomething();
+            }
+            if(q.CandidateTriangleBarycentrics().x == 0)
+            {
+                DoSomething();
+            }
+            if(q.CandidateGeometryIndex())
+            {
+                DoSomething();
+            }
+            if(q.CandidateInstanceID())
+            {
+                DoSomething();
+            }
+            if(q.CandidateInstanceIndex())
+            {
+                DoSomething();
+            }
+            if(q.CandidateObjectRayDirection().x)
+            {
+                DoSomething();
+            }
+            if(q.CandidateObjectRayOrigin().y)
+            {
+                DoSomething();
+            }
+            if(q.CandidatePrimitiveIndex())
+            {
+                DoSomething();
+            }
+            if(q.CandidateTriangleRayT())
+            {
+                DoSomething();
+            }
+            break;
+        case CANDIDATE_PROCEDURAL_PRIMITIVE:
+        {
+            mat3x4 = q.CandidateWorldToObject3x4();
+            mat4x3 = q.CandidateWorldToObject4x3();
+            if(q.CandidateProceduralPrimitiveNonOpaque())
+            {
+                DoSomething();
+            }
+            float t = 0.5;
+            q.CommitProceduralPrimitiveHit(t);
+            q.Abort();
+            break;
+        }
+        }
+    }
+    if(mat3x4[0][0] == mat4x3[0][0])
+    {
+        DoSomething();
+    }
+    switch(q.CommittedStatus())
+    {
+    case COMMITTED_NOTHING:
+        mat3x4 = q.CommittedObjectToWorld3x4();
+        mat4x3 = q.CommittedObjectToWorld4x3();
+        break;
+    case COMMITTED_TRIANGLE_HIT:
+        mat3x4 = q.CommittedWorldToObject3x4();
+        mat4x3 = q.CommittedWorldToObject4x3();
+        if(q.CommittedTriangleFrontFace())
+        {
+            DoSomething();
+        }
+        if(q.CommittedTriangleBarycentrics().y == 0)
+        {
+            DoSomething();
+        }
+        break;
+    case COMMITTED_PROCEDURAL_PRIMITIVE_HIT:
+        if(q.CommittedGeometryIndex())
+        {
+            DoSomething();
+        }
+        if(q.CommittedInstanceID())
+        {
+            DoSomething();
+        }
+        if(q.CommittedInstanceIndex())
+        {
+            DoSomething();
+        }
+        if(q.CommittedObjectRayDirection().z)
+        {
+            DoSomething();
+        }
+        if(q.CommittedObjectRayOrigin().x)
+        {
+            DoSomething();
+        }
+        if(q.CommittedPrimitiveIndex())
+        {
+            DoSomething();
+        }
+        if(q.CommittedRayT())
+        {
+            DoSomething();
+        }
+        break;
+    }
+    if(mat3x4[0][0] == mat4x3[0][0])
+    {
+        DoSomething();
+    }
+    if(q.RayFlags())
+    {
+        DoSomething();
+    }
+    if(q.RayTMin())
+    {
+        DoSomething();
+    }
+    float3 o = q.WorldRayDirection();
+    float3 d = q.WorldRayOrigin();
+    if(o.x == d.z)
+    {
+        DoSomething();
+    }
+}

+ 37 - 2
tools/clang/tools/dxcompiler/dxcdisassembler.cpp

@@ -325,7 +325,9 @@ PCSTR g_pFeatureInfoNames[] = {
     "View Instancing",
     "Barycentrics",
     "Use native low precision",
-    "Shading Rate"
+    "Shading Rate",
+    "Raytracing tier 1.1 features",
+    "Sampler feedback"
 };
 static_assert(_countof(g_pFeatureInfoNames) == ShaderFeatureInfoCount, "g_pFeatureInfoNames needs to be updated");
 
@@ -1184,7 +1186,40 @@ static const char *OpCodeSignatures[] = {
   "(value,mask0,mask1,mask2,mask3,op,sop)",  // WaveMultiPrefixOp
   "(value,mask0,mask1,mask2,mask3)",  // WaveMultiPrefixBitCount
   "(constRayFlags)",  // AllocateRayQuery
-  "(rayQueryHandle,accelerationStructure,rayFlags,instanceInclusionMask,origin_X,origin_Y,origin_Z,tMin,direction_X,direction_Y,direction_Z,tMax)"  // TraceRayInline
+  "(rayQueryHandle,accelerationStructure,rayFlags,instanceInclusionMask,origin_X,origin_Y,origin_Z,tMin,direction_X,direction_Y,direction_Z,tMax)",  // RayQuery_TraceRayInline
+  "(rayQueryHandle)",  // RayQuery_Proceed
+  "(rayQueryHandle)",  // RayQuery_Abort
+  "(rayQueryHandle)",  // RayQuery_CommitNonOpaqueTriangleHit
+  "(rayQueryHandle,t)",  // RayQuery_CommitProceduralPrimitiveHit
+  "(rayQueryHandle)",  // RayQuery_CommittedStatus
+  "(rayQueryHandle)",  // RayQuery_CandidateType
+  "(rayQueryHandle,row,col)",  // RayQuery_CandidateObjectToWorld3x4
+  "(rayQueryHandle,row,col)",  // RayQuery_CandidateWorldToObject3x4
+  "(rayQueryHandle,row,col)",  // RayQuery_CommittedObjectToWorld3x4
+  "(rayQueryHandle,row,col)",  // RayQuery_CommittedWorldToObject3x4
+  "(rayQueryHandle)",  // RayQuery_CandidateProceduralPrimitiveNonOpaque
+  "(rayQueryHandle)",  // RayQuery_CandidateTriangleFrontFace
+  "(rayQueryHandle)",  // RayQuery_CommittedTriangleFrontFace
+  "(rayQueryHandle,component)",  // RayQuery_CandidateTriangleBarycentrics
+  "(rayQueryHandle,component)",  // RayQuery_CommittedTriangleBarycentrics
+  "(rayQueryHandle)",  // RayQuery_RayFlags
+  "(rayQueryHandle,component)",  // RayQuery_WorldRayOrigin
+  "(rayQueryHandle,component)",  // RayQuery_WorldRayDirection
+  "(rayQueryHandle)",  // RayQuery_RayTMin
+  "(rayQueryHandle)",  // RayQuery_CandidateTriangleRayT
+  "(rayQueryHandle)",  // RayQuery_CommittedRayT
+  "(rayQueryHandle)",  // RayQuery_CandidateInstanceIndex
+  "(rayQueryHandle)",  // RayQuery_CandidateInstanceID
+  "(rayQueryHandle)",  // RayQuery_CandidateGeometryIndex
+  "(rayQueryHandle)",  // RayQuery_CandidatePrimitiveIndex
+  "(rayQueryHandle,component)",  // RayQuery_CandidateObjectRayOrigin
+  "(rayQueryHandle,component)",  // RayQuery_CandidateObjectRayDirection
+  "(rayQueryHandle)",  // RayQuery_CommittedInstanceIndex
+  "(rayQueryHandle)",  // RayQuery_CommittedInstanceID
+  "(rayQueryHandle)",  // RayQuery_CommittedGeometryIndex
+  "(rayQueryHandle)",  // RayQuery_CommittedPrimitiveIndex
+  "(rayQueryHandle,component)",  // RayQuery_CommittedObjectRayOrigin
+  "(rayQueryHandle,component)"  // RayQuery_CommittedObjectRayDirection
 };
 // OPCODE-SIGS:END
 

+ 38 - 1
utils/hct/gen_intrin_main.txt

@@ -836,7 +836,44 @@ $classT [[]] Consume() : structuredbuffer_consume;
 
 namespace RayQueryMethods {
 
-void [[]]  TraceRayInline(in acceleration_struct AccelerationStructure, in uint RayFlags, in uint InstanceInclusionMask, in ray_desc Ray);
+void [[]] TraceRayInline(in acceleration_struct AccelerationStructure, in uint RayFlags, in uint InstanceInclusionMask, in ray_desc Ray);
+bool [[]] Proceed();
+void [[]] Abort();
+void [[]] CommitNonOpaqueTriangleHit();
+void [[]] CommitProceduralPrimitiveHit(in float t);
+uint [[ro]] CommittedStatus();
+uint [[ro]] CandidateType();
+float<3,4> [[ro]] CandidateObjectToWorld3x4();
+float<4,3> [[ro]] CandidateObjectToWorld4x3();
+float<3,4> [[ro]] CandidateWorldToObject3x4();
+float<4,3> [[ro]] CandidateWorldToObject4x3();
+float<3,4> [[ro]] CommittedObjectToWorld3x4();
+float<4,3> [[ro]] CommittedObjectToWorld4x3();
+float<3,4> [[ro]] CommittedWorldToObject3x4();
+float<4,3> [[ro]] CommittedWorldToObject4x3();
+bool [[ro]] CandidateProceduralPrimitiveNonOpaque();
+bool [[ro]] CandidateTriangleFrontFace();
+bool [[ro]] CommittedTriangleFrontFace();
+float<2> [[ro]] CandidateTriangleBarycentrics();
+float<2> [[ro]] CommittedTriangleBarycentrics();
+uint [[ro]] RayFlags();
+float<3> [[ro]] WorldRayOrigin();
+float<3> [[ro]] WorldRayDirection();
+float [[ro]] RayTMin();
+float [[ro]] CandidateTriangleRayT();
+float [[ro]] CommittedRayT();
+uint [[ro]] CandidateInstanceIndex();
+uint [[ro]] CandidateInstanceID();
+uint [[ro]] CandidateGeometryIndex();
+uint [[ro]] CandidatePrimitiveIndex();
+float<3> [[ro]] CandidateObjectRayOrigin();
+float<3> [[ro]] CandidateObjectRayDirection();
+uint [[ro]] CommittedInstanceIndex();
+uint [[ro]] CommittedInstanceID();
+uint [[ro]] CommittedGeometryIndex();
+uint [[ro]] CommittedPrimitiveIndex();
+float<3> [[ro]] CommittedObjectRayOrigin();
+float<3> [[ro]] CommittedObjectRayDirection();
 
 } namespace
 

+ 191 - 4
utils/hct/hctdb.py

@@ -380,7 +380,12 @@ class db_dxil(object):
         for i in "WaveMatch,WaveMultiPrefixOp,WaveMultiPrefixBitCount".split(","):
             self.name_idx[i].category = "Wave"
             self.name_idx[i].shader_model = 6,5
-        for i in "AllocateRayQuery,TraceRayInline".split(","):
+        for i in ("AllocateRayQuery,RayQuery_TraceRayInline,RayQuery_Proceed,RayQuery_Abort,RayQuery_CommitNonOpaqueTriangleHit,RayQuery_CommitProceduralPrimitiveHit,RayQuery_RayFlags,RayQuery_WorldRayOrigin,RayQuery_WorldRayDirection,RayQuery_RayTMin,"+
+                 "RayQuery_CandidateTriangleRayT,RayQuery_CommittedRayT,RayQuery_CandidateInstanceIndex,RayQuery_CandidateInstanceID,RayQuery_CandidateGeometryIndex,RayQuery_CandidatePrimitiveIndex,"+
+                 "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(","):
             self.name_idx[i].category = "Inline Ray Query"
             self.name_idx[i].shader_model = 6,5
 
@@ -1376,12 +1381,12 @@ class db_dxil(object):
             db_dxil_param(6, "i32", "mask3", "mask 3")])
         next_op_idx += 1
 
-        self.add_dxil_op("AllocateRayQuery", next_op_idx, "AllocateRayQuery", "allocate space for RayQuery and return handle", "v", "", [
+        self.add_dxil_op("AllocateRayQuery", next_op_idx, "AllocateRayQuery", "allocates space for RayQuery and return handle", "v", "", [
             db_dxil_param(0, "i32", "", "handle to RayQuery state"),
             db_dxil_param(2, "u32", "constRayFlags", "Valid combination of RAY_FLAGS", is_const=True)])
         next_op_idx += 1
 
-        self.add_dxil_op("TraceRayInline", next_op_idx, "TraceRayInline", "initialize RayQuery for raytrace", "v", "", [
+        self.add_dxil_op("RayQuery_TraceRayInline", next_op_idx, "RayQuery_TraceRayInline", "initializes RayQuery for raytrace", "v", "", [
             db_dxil_param(0, "v", "", ""),
             db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
             db_dxil_param(3, "res", "accelerationStructure", "Top-level acceleration structure to use"),
@@ -1397,9 +1402,191 @@ class db_dxil(object):
             db_dxil_param(13, "f", "tMax", "Tmax of the ray")])
         next_op_idx += 1
 
+        self.add_dxil_op("RayQuery_Proceed", next_op_idx, "RayQuery_Proceed", "advances a ray query", "1", "", [
+            db_dxil_param(0, "i1", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_Abort", next_op_idx, "RayQuery_Abort", "aborts a ray query", "v", "", [
+            db_dxil_param(0, "v", "", ""),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommitNonOpaqueTriangleHit", next_op_idx, "RayQuery_CommitNonOpaqueTriangleHit", "commits a non opaque triangle hit", "v", "", [
+            db_dxil_param(0, "v", "", ""),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommitProceduralPrimitiveHit", next_op_idx, "RayQuery_CommitProceduralPrimitiveHit", "commits a procedural primitive hit", "v", "", [
+            db_dxil_param(0, "v", "", ""),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "f", "t", "Procedural primitive hit distance (t) to commit.")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedStatus", next_op_idx, "RayQuery_StateScalar", "returns uint status (COMMITTED_STATUS) of the committed hit in a ray query", "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_CandidateType", next_op_idx, "RayQuery_StateScalar", "returns uint candidate type (CANDIDATE_TYPE) of the current hit candidate in a ray query, after Proceed() has returned true", "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_CandidateObjectToWorld3x4", next_op_idx, "RayQuery_StateMatrix", "returns matrix for transforming from object-space to world-space for a candidate hit.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i32", "row", "row [0..2], relative to the element"),
+            db_dxil_param(4, "i8", "col", "column [0..3], relative to the element")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateWorldToObject3x4", next_op_idx, "RayQuery_StateMatrix", "returns matrix for transforming from world-space to object-space for a candidate hit.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i32", "row", "row [0..2], relative to the element"),
+            db_dxil_param(4, "i8", "col", "column [0..3], relative to the element")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedObjectToWorld3x4", next_op_idx, "RayQuery_StateMatrix", "returns matrix for transforming from object-space to world-space for a Committed hit.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i32", "row", "row [0..2], relative to the element"),
+            db_dxil_param(4, "i8", "col", "column [0..3], relative to the element")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedWorldToObject3x4", next_op_idx, "RayQuery_StateMatrix", "returns matrix for transforming from world-space to object-space for a Committed hit.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i32", "row", "row [0..2], relative to the element"),
+            db_dxil_param(4, "i8", "col", "column [0..3], relative to the element")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateProceduralPrimitiveNonOpaque", next_op_idx, "RayQuery_StateScalar", "returns if current candidate procedural primitive is non opaque", "1", "ro", [
+            db_dxil_param(0, "i1", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateTriangleFrontFace", next_op_idx, "RayQuery_StateScalar", "returns if current candidate triangle is front facing", "1", "ro", [
+            db_dxil_param(0, "i1", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedTriangleFrontFace", next_op_idx, "RayQuery_StateScalar", "returns if current committed triangle is front facing", "1", "ro", [
+            db_dxil_param(0, "i1", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateTriangleBarycentrics", next_op_idx, "RayQuery_StateVector", "returns candidate triangle hit barycentrics", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedTriangleBarycentrics", next_op_idx, "RayQuery_StateVector", "returns committed triangle hit barycentrics", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_RayFlags", next_op_idx, "RayQuery_StateScalar", "returns ray flags", "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_WorldRayOrigin", next_op_idx, "RayQuery_StateVector", "returns world ray origin", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_WorldRayDirection", next_op_idx, "RayQuery_StateVector", "returns world ray direction", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_RayTMin", next_op_idx, "RayQuery_StateScalar", "returns float representing the parametric starting point for the ray.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateTriangleRayT", next_op_idx, "RayQuery_StateScalar", "returns float representing the parametric point on the ray for the current candidate triangle hit.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedRayT", next_op_idx, "RayQuery_StateScalar", "returns float representing the parametric point on the ray for the current committed hit.", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle")])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateInstanceIndex", next_op_idx, "RayQuery_StateScalar", "returns candidate hit instance index", "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_CandidateInstanceID", next_op_idx, "RayQuery_StateScalar", "returns candidate hit instance ID", "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_CandidateGeometryIndex", next_op_idx, "RayQuery_StateScalar", "returns candidate hit geometry index", "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_CandidatePrimitiveIndex", next_op_idx, "RayQuery_StateScalar", "returns candidate hit geometry index", "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_CandidateObjectRayOrigin", next_op_idx, "RayQuery_StateVector", "returns candidate hit object ray origin", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CandidateObjectRayDirection", next_op_idx, "RayQuery_StateVector", "returns candidate object ray direction", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedInstanceIndex", next_op_idx, "RayQuery_StateScalar", "returns committed hit instance index", "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_CommittedInstanceID", next_op_idx, "RayQuery_StateScalar", "returns committed hit instance ID", "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_CommittedGeometryIndex", next_op_idx, "RayQuery_StateScalar", "returns committed hit geometry index", "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_CommittedPrimitiveIndex", next_op_idx, "RayQuery_StateScalar", "returns committed hit geometry index", "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_CommittedObjectRayOrigin", next_op_idx, "RayQuery_StateVector", "returns committed hit object ray origin", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        next_op_idx += 1
+
+        self.add_dxil_op("RayQuery_CommittedObjectRayDirection", next_op_idx, "RayQuery_StateVector", "returns committed object ray direction", "f", "ro", [
+            db_dxil_param(0, "f", "", "operation result"),
+            db_dxil_param(2, "i32", "rayQueryHandle", "RayQuery handle"),
+            db_dxil_param(3, "i8", "component", "component [0..2]",is_const=True)])
+        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 == 170, "next operation index is %d rather than 169 and thus opcodes are broken" % next_op_idx
+        assert next_op_idx == 203, "203 is expected next operation index but encountered %d and thus opcodes are broken" % next_op_idx
 
         # Set interesting properties.
         self.build_indices()