diff options
| -rw-r--r-- | source/slang/hlsl.meta.slang | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index e35dc1eee..90b2a17b9 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -444,8 +444,8 @@ interface __ITextureShape1D2D3D : __ITextureShape { } -/// @category misc_types Miscelaneous types /// When used as the `Shape` parameter of the `_Texture` type, specifies a 1D texture. +/// @category misc_types Miscelaneous types __magic_type(TextureShape1DType) __intrinsic_type($(kIROp_TextureShape1DType)) struct __Shape1D : __ITextureShape1D2D3D @@ -455,8 +455,8 @@ struct __Shape1D : __ITextureShape1D2D3D static const int planeDimensions = 1; } -/// @category misc_types /// When used as the `Shape` parameter of the `_Texture` type, specifies a 2D texture. +/// @category misc_types __magic_type(TextureShape2DType) __intrinsic_type($(kIROp_TextureShape2DType)) struct __Shape2D : __ITextureShape1D2D3D @@ -466,8 +466,8 @@ struct __Shape2D : __ITextureShape1D2D3D static const int planeDimensions = 2; } -/// @category misc_types /// When used as the `Shape` parameter of the `_Texture` type, specifies a 3D texture. +/// @category misc_types __magic_type(TextureShape3DType) __intrinsic_type($(kIROp_TextureShape3DType)) struct __Shape3D : __ITextureShape1D2D3D @@ -477,8 +477,8 @@ struct __Shape3D : __ITextureShape1D2D3D static const int planeDimensions = 3; } -/// @category misc_types /// When used as the `Shape` parameter of the `_Texture` type, specifies a Cube texture. +/// @category misc_types __magic_type(TextureShapeCubeType) __intrinsic_type($(kIROp_TextureShapeCubeType)) struct __ShapeCube : __ITextureShape @@ -488,8 +488,8 @@ struct __ShapeCube : __ITextureShape static const int planeDimensions = 2; } -/// @category misc_types /// When used as the `Shape` parameter of the `_Texture` type, specifies a buffer texture. +/// @category misc_types __magic_type(TextureShapeBufferType) __intrinsic_type($(kIROp_TextureShapeBufferType)) struct __ShapeBuffer : __ITextureShape @@ -4034,12 +4034,12 @@ ${{{{ continue; const char* textureTypeName = isCombined ? "Sampler" : "Texture"; }}}} -/// @category texture_types /// Represents a handle to a $(accessDocumentation[access])$(isMS?", multisampled": "") $(shapeTypeNames[shape]) $(isCombined?"combined texture-sampler": "texture")$(isArray?" array":""). /// @param T The texel type of the texture. /// @param sampleCount The number of samples in the texture, when the texture is multisampled. /// @param format The storage format of the texture. /// @see Please refer to `_Texture` for more information about texture types. +/// @category texture_types typealias $(accessPrefix[access])$(textureTypeName)$(shapeTypeNames[shape])$(msPostFix[isMS])$(arrayPostFix[isArray])<T=float4, let sampleCount:int=0, let format:int=0> = _Texture<T, __Shape$(shapeTypeNames[shape]), $(isArray), $(isMS), sampleCount, $(access), 0, $(isCombined), format>; ${{{{ } @@ -7662,8 +7662,8 @@ void DeviceMemoryBarrier() } } -/// @category barrier /// Barrier for device memory with group synchronization. +/// @category barrier __glsl_extension(GL_KHR_memory_scope_semantics) [require(cuda_glsl_hlsl_metal_spirv_wgsl, memorybarrier)] void DeviceMemoryBarrierWithGroupSync() @@ -7834,8 +7834,8 @@ T dot(vector<T, N> x, vector<T, N> y) } /// Helper for computing distance terms for lighting (obsolete) -/// @category math /// @deprecated +/// @category math __generic<T : __BuiltinFloatingPointType> vector<T,4> dst(vector<T,4> x, vector<T,4> y); // Given a RWByteAddressBuffer allow it to be interpreted as a RWStructuredBuffer @@ -9665,8 +9665,8 @@ matrix<T,N,M> lerp(matrix<T,N,M> x, matrix<T,N,M> y, matrix<T,N,M> s) } // Legacy lighting function (obsolete) -/// @category math /// @deprecated +/// @category math [__readNone] [require(cpp_cuda_glsl_hlsl_metal_spirv, sm_4_0_version)] float4 lit(float n_dot_l, float n_dot_h, float m) @@ -15115,57 +15115,57 @@ ${{{{ // 10.1.1 - Ray Flags -/// @category raytracing /// Flags that control ray traversal behavior and shader execution. +/// @category raytracing typedef uint RAY_FLAG; -/// @category raytracing /// No special ray flags. +/// @category raytracing static const RAY_FLAG RAY_FLAG_NONE = 0x00; -/// @category raytracing /// Forces all geometries to be treated as opaque, disabling any-hit shader execution. +/// @category raytracing static const RAY_FLAG RAY_FLAG_FORCE_OPAQUE = 0x01; -/// @category raytracing /// Forces all geometries to be treated as non-opaque, enabling any-hit shader execution. +/// @category raytracing static const RAY_FLAG RAY_FLAG_FORCE_NON_OPAQUE = 0x02; -/// @category raytracing /// Accepts the first intersection found and skips searching for closer hits. +/// @category raytracing static const RAY_FLAG RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH = 0x04; -/// @category raytracing /// Skips execution of closest hit shaders, useful for shadow rays. +/// @category raytracing static const RAY_FLAG RAY_FLAG_SKIP_CLOSEST_HIT_SHADER = 0x08; -/// @category raytracing /// Culls triangles facing away from the ray origin. +/// @category raytracing static const RAY_FLAG RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10; -/// @category raytracing /// Culls triangles facing toward the ray origin. +/// @category raytracing static const RAY_FLAG RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20; -/// @category raytracing /// Skips intersections with opaque geometry. +/// @category raytracing static const RAY_FLAG RAY_FLAG_CULL_OPAQUE = 0x40; -/// @category raytracing /// Skips intersections with non-opaque geometry. +/// @category raytracing static const RAY_FLAG RAY_FLAG_CULL_NON_OPAQUE = 0x80; -/// @category raytracing /// Skips all triangle intersections. +/// @category raytracing static const RAY_FLAG RAY_FLAG_SKIP_TRIANGLES = 0x100; -/// @category raytracing /// Skips all procedural primitive intersections. +/// @category raytracing static const RAY_FLAG RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200; // 10.1.2 - Ray Description Structure -/// @category raytracing /// Describes a ray for traversal through an acceleration structure. +/// @category raytracing __target_intrinsic(hlsl, RayDesc) __target_intrinsic(cuda, RayDesc) struct RayDesc @@ -15192,8 +15192,8 @@ struct RayDesc }; // 10.1.3 - Ray Acceleration Structure -/// @category raytracing /// Opaque type representing a ray-tracing acceleration structure. +/// @category raytracing __builtin __magic_type(RaytracingAccelerationStructureType) __intrinsic_type($(kIROp_RaytracingAccelerationStructureType)) @@ -15207,8 +15207,8 @@ struct RaytracingAccelerationStructure {}; // for this stuff comes across as a kludge rather than the best possible design. // 10.1.5 - Intersection Attributes Structure -/// @category raytracing /// Built-in structure containing intersection attributes for triangle primitives. +/// @category raytracing __target_intrinsic(hlsl, BuiltInTriangleIntersectionAttributes) [require(cpp_cuda_glsl_hlsl_spirv, raytracing)] struct BuiltInTriangleIntersectionAttributes @@ -15251,11 +15251,11 @@ int __callablePayloadLocation(__ref Payload payload); // targets, which maps the generic HLSL operation into the non-generic // GLSL equivalent. // -/// @category raytracing /// Executes a callable shader with the specified payload. /// @param shaderIndex Index of the callable shader to execute /// @param payload Data structure to pass to and receive from the callable shader /// @remarks Used to implement dynamic shader calls during ray tracing +/// @category raytracing __generic<Payload> [require(glsl_hlsl_spirv, raytracing_raygen_closesthit_miss_callable)] void CallShader(uint shaderIndex, inout Payload payload) @@ -15346,7 +15346,6 @@ __generic<Payload> __intrinsic_op($(kIROp_GetVulkanRayTracingPayloadLocation)) int __rayPayloadLocation(__ref Payload payload); -/// @category raytracing /// Traces a ray through the acceleration structure. /// @param AccelerationStructure The acceleration structure to traverse /// @param RayFlags Flags controlling ray behavior @@ -15357,6 +15356,7 @@ int __rayPayloadLocation(__ref Payload payload); /// @param Ray Description of the ray to trace /// @param Payload Structure for passing data between shaders /// @remarks Core ray tracing function for initiating traversal +/// @category raytracing [ForceInline] __generic<payload_t> [require(cuda_glsl_hlsl_spirv, raytracing_raygen_closesthit_miss)] @@ -15481,7 +15481,6 @@ void __traceMotionRay( } } -/// @category raytracing /// Traces a ray with motion blur support through the acceleration structure. /// @param AccelerationStructure The acceleration structure to traverse /// @param RayFlags Flags controlling ray behavior @@ -15493,6 +15492,7 @@ void __traceMotionRay( /// @param CurrentTime Time value for motion blur interpolation /// @param Payload Structure for passing data between shaders /// @remarks Extended version of TraceRay with motion blur support +/// @category raytracing [ForceInline] [require(glsl_hlsl_spirv, raytracing_motionblur_raygen_closesthit_miss)] __generic<payload_t> @@ -15593,13 +15593,13 @@ bool __reportIntersection(float tHit, uint hitKind) } } -/// @category raytracing /// Reports a hit from an intersection shader. /// @param tHit Distance along the ray where the intersection occurred /// @param hitKind User-defined value identifying the type of hit /// @param attributes Custom attributes for the intersection /// @return true if the hit was accepted, false if rejected /// @remarks Used in custom intersection shaders to report primitive intersections +/// @category raytracing __generic<A> [ForceInline] [require(glsl_hlsl_spirv, raytracing_intersection)] @@ -15618,13 +15618,13 @@ bool ReportHit(float tHit, uint hitKind, A attributes) } } -/// @category raytracing /// Reports a hit optimized for OptiX. /// @param tHit Distance along the ray where the intersection occurred /// @param hitKind User-defined value identifying the type of hit /// @param attribs Attribute values for the intersection /// @return true if the hit was accepted, false if rejected /// @remarks OptiX-specific version of ReportHit with optimized attribute handling +/// @category raytracing __generic<each T : __BuiltinIntegerType> [ForceInline] [require(cuda_glsl_hlsl_spirv, raytracing_intersection)] @@ -15640,9 +15640,9 @@ bool ReportHitOptix(float tHit, uint hitKind, expand each T attribs) } // 10.3.4 -/// @category raytracing /// Ignores the current intersection and continues traversal. /// @remarks Used in any-hit shaders to reject potential intersections +/// @category raytracing [require(cuda_glsl_hlsl_spirv, raytracing_anyhit)] void IgnoreHit() { @@ -15660,9 +15660,9 @@ void IgnoreHit() } // 10.3.5 -/// @category raytracing /// Accepts the current intersection and terminates further traversal. /// @remarks Used in any-hit shaders to immediately accept an intersection +/// @category raytracing [require(cuda_glsl_hlsl_spirv, raytracing_anyhit)] void AcceptHitAndEndSearch() { @@ -15686,10 +15686,10 @@ void AcceptHitAndEndSearch() // 10.4.1 - Ray Dispatch System Values -/// @category raytracing /// Returns the current ray dispatch coordinates. /// @return 3D index of the current ray being processed /// @remarks Available in all ray tracing shader stages +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_allstages)] uint3 DispatchRaysIndex() @@ -15707,10 +15707,10 @@ uint3 DispatchRaysIndex() } } -/// @category raytracing /// Returns the dimensions of the ray dispatch. /// @return 3D dimensions of the ray dispatch grid /// @remarks Available in all ray tracing shader stages +/// @category raytracing [require(cuda_glsl_hlsl_spirv, raytracing_allstages)] uint3 DispatchRaysDimensions() { @@ -15729,10 +15729,10 @@ uint3 DispatchRaysDimensions() // 10.4.2 - Ray System Values -/// @category raytracing /// Returns the origin of the current ray in world space. /// @return World-space position where the ray originated /// @remarks Available in any-hit, closest-hit, intersection, and miss shaders +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection_miss)] float3 WorldRayOrigin() @@ -15750,10 +15750,10 @@ float3 WorldRayOrigin() } } -/// @category raytracing /// Returns the direction of the current ray in world space. /// @return Normalized world-space direction vector of the ray /// @remarks Available in any-hit, closest-hit, intersection, and miss shaders +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection_miss)] float3 WorldRayDirection() @@ -15771,10 +15771,10 @@ float3 WorldRayDirection() } } -/// @category raytracing /// Returns the minimum valid intersection distance for the current ray. /// @return Minimum distance along the ray where intersections are considered /// @remarks Used to prevent self-intersections and near-plane clipping +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection_miss)] float RayTMin() @@ -15803,10 +15803,10 @@ float RayTMin() // to the appropriate Vulkan stages. // -/// @category raytracing /// Returns the current intersection distance or maximum ray distance. /// @return Current t-value for hit shaders or maximum distance for intersection shaders /// @remarks Interpretation depends on shader stage (hit vs. intersection) +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection_miss)] float RayTCurrent() @@ -15824,10 +15824,10 @@ float RayTCurrent() } } -/// @category raytracing /// Returns the flags used when tracing the current ray. /// @return Combination of RAY_FLAG values used for this ray /// @remarks Allows shaders to modify behavior based on ray trace flags +/// @category raytracing [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection_miss)] uint RayFlags() { @@ -15846,10 +15846,10 @@ uint RayFlags() // 10.4.3 - Primitive/Object Space System Values -/// @category raytracing /// Returns the index of the current instance in the acceleration structure. /// @return Zero-based index of the current instance /// @remarks Available in any-hit, closest-hit, and intersection shaders +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] uint InstanceIndex() @@ -15867,10 +15867,10 @@ uint InstanceIndex() } } -/// @category raytracing /// Returns the user-provided ID of the current instance. /// @return Custom instance identifier set during acceleration structure build /// @remarks Used for instance-specific shader behavior +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] uint InstanceID() @@ -15888,10 +15888,10 @@ uint InstanceID() } } -/// @category raytracing /// Returns the index of the current primitive within its geometry. /// @return Zero-based index of the intersected primitive /// @remarks Available in any-hit, closest-hit, and intersection shaders +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] uint PrimitiveIndex() @@ -15909,10 +15909,10 @@ uint PrimitiveIndex() } } -/// @category raytracing /// Returns the ray origin in object space of the current instance. /// @return Object-space position where the ray originated /// @remarks Transformed by the inverse of the instance transform +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] float3 ObjectRayOrigin() @@ -15930,10 +15930,10 @@ float3 ObjectRayOrigin() } } -/// @category raytracing /// Returns the ray direction in object space of the current instance. /// @return Object-space direction vector of the ray /// @remarks Transformed by the inverse of the instance transform +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] float3 ObjectRayDirection() @@ -15953,10 +15953,10 @@ float3 ObjectRayDirection() // TODO: optix has an optixGetObjectToWorldTransformMatrix function that returns 12 // floats by reference. -/// @category raytracing /// Returns the object-to-world transformation matrix (3x4). /// @return 3x4 matrix transforming from object to world space /// @remarks Includes position and orientation of the current instance +/// @category raytracing [NonUniformReturn] [require(glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] float3x4 ObjectToWorld3x4() @@ -15974,10 +15974,10 @@ float3x4 ObjectToWorld3x4() } } -/// @category raytracing /// Returns the world-to-object transformation matrix (3x4). /// @return 3x4 matrix transforming from world to object space /// @remarks Inverse of the object-to-world transform +/// @category raytracing [NonUniformReturn] [require(glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] float3x4 WorldToObject3x4() @@ -15995,10 +15995,10 @@ float3x4 WorldToObject3x4() } } -/// @category raytracing /// Returns the object-to-world transformation matrix (4x3). /// @return 4x3 matrix transforming from object to world space /// @remarks Transposed version of ObjectToWorld3x4 +/// @category raytracing [NonUniformReturn] [require(glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] float4x3 ObjectToWorld4x3() @@ -16015,10 +16015,10 @@ float4x3 ObjectToWorld4x3() } } -/// @category raytracing /// Returns the world-to-object transformation matrix (4x3). /// @return 4x3 matrix transforming from world to object space /// @remarks Transposed version of WorldToObject3x4 +/// @category raytracing [NonUniformReturn] [require(glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] float4x3 WorldToObject4x3() @@ -16039,10 +16039,10 @@ float4x3 WorldToObject4x3() // The name of the following functions may change when DXR supports // a feature similar to the `GL_NV_ray_tracing_motion_blur` extension -/// @category raytracing /// Returns the current time value for motion blur. /// @return Time value between 0 and 1 for motion blur interpolation /// @remarks Available when motion blur extension is enabled +/// @category raytracing __glsl_extension(GL_NV_ray_tracing_motion_blur) __glsl_extension(GL_EXT_ray_tracing) [NonUniformReturn] @@ -16070,18 +16070,18 @@ float RayCurrentTime() // declarations, so that users can know they aren't coding // against the final spec? // -/// @category raytracing /// Alias for ObjectToWorld3x4. -[NonUniformReturn] float3x4 ObjectToWorld() { return ObjectToWorld3x4(); } /// @category raytracing +[NonUniformReturn] float3x4 ObjectToWorld() { return ObjectToWorld3x4(); } /// Alias for WorldToObject3x4. +/// @category raytracing [NonUniformReturn] float3x4 WorldToObject() { return WorldToObject3x4(); } // 10.4.4 - Hit Specific System values -/// @category raytracing /// Returns the type of intersection that was found. /// @return Hit kind value (HIT_KIND_TRIANGLE_FRONT_FACE, HIT_KIND_TRIANGLE_BACK_FACE, or custom value) /// @remarks Available in any-hit and closest-hit shaders +/// @category raytracing [NonUniformReturn] [require(cuda_glsl_hlsl_spirv, raytracing_anyhit_closesthit)] uint HitKind() @@ -16100,12 +16100,12 @@ uint HitKind() } // Pre-defined hit kinds (not documented explicitly) -/// @category raytracing /// Predefined hit kind value for front-facing triangle intersections. +/// @category raytracing static const uint HIT_KIND_TRIANGLE_FRONT_FACE = 254; -/// @category raytracing /// Predefined hit kind value for back-facing triangle intersections. +/// @category raytracing static const uint HIT_KIND_TRIANGLE_BACK_FACE = 255; // @@ -16384,10 +16384,10 @@ extension _Texture<T,__Shape2D, 1, 0, 0, $(kCoreModule_ResourceAccessFeedback), // DXR 1.1 and `TraceRayInline` support // -/// @category raytracing /// Returns the index of the geometry that was hit in an intersection, any-hit, or closest-hit shader. /// @return Zero-based index of the geometry in the current instance /// @remarks Available in intersection, any-hit, and closest-hit shaders +/// @category raytracing __glsl_extension(GL_EXT_ray_tracing) [NonUniformReturn] [require(glsl_hlsl_spirv, raytracing_anyhit_closesthit_intersection)] @@ -16433,12 +16433,12 @@ float3 HitTriangleVertexPosition(uint index) } } -/// @category raytracing /// Status indicating whether and what type of hit has been committed in a RayQuery. +/// @category raytracing typedef uint COMMITTED_STATUS; -/// @category raytracing /// Indicates no hit has been committed yet. +/// @category raytracing static const COMMITTED_STATUS COMMITTED_NOTHING = 0; /// Closest hit is a triangle. |
