Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/command-line-slangc-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ A capability describes an optional feature that a target may or may not support.
* `consumestructuredbuffer`
* `structuredbuffer`
* `structuredbuffer_rw`
* `implicit_derivatives_sampling`
* `fragmentprocessing`
* `fragmentprocessing_derivativecontrol`
* `getattributeatvertex`
Expand Down
14 changes: 14 additions & 0 deletions docs/user-guide/a3-02-reference-capability-atoms.md
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,20 @@ Compound Capabilities
`image_size`
> Capabilities required to query image (RWTexture) size info

`implicit_derivatives_sampling`
> Capabilities required for implicit derivatives sampling.
>
> This capability is required by texture sampling functions such as `_Texture.Sample()`
> where the level of detail is determined by implicit derivatives.
>
> @remark In GLSL, implicit level-of-detail `texture()` functions use the base texture when
> the implicit derivatives are unavailable. When this capability is not present, invocations of
> these functions are translated to invocations of `_Texture.SampleLevelZero()`.
>
> @remark Implicit derivatives for the compute stage can be enabled by declaring capability `GL_NV_compute_shader_derivatives` (GLSL),
> `SPV_KHR_compute_shader_derivatives` (SPIR-V), or profile `cs_6_6` (HLSL).
>

`memorybarrier`
> Capabilities required to use sm_5_0 style memory barriers

Expand Down
2 changes: 1 addition & 1 deletion source/slang/hlsl.meta.slang
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ struct _Texture<T:ITexelElement, Shape: __ITextureShape, let isArray:int, let is
//@hidden:

// Returns true when the stage supports implicit derivatives on the
// target. This must match with compound capability `fragmentprocessing`.
// target. This must match with capability `implicit_derivatives_sampling`.
//
[__readNone]
[ForceInline]
Expand Down
17 changes: 17 additions & 0 deletions source/slang/slang-capabilities.capdef
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,23 @@ alias structuredbuffer = sm_4_0_version;
/// [Compound]
alias structuredbuffer_rw = sm_4_0_version;

/// Capabilities required for implicit derivatives sampling.
///
/// This capability is required by texture sampling functions such as `_Texture.Sample()`
/// where the level of detail is determined by implicit derivatives.
///
/// @remark In GLSL, implicit level-of-detail `texture()` functions use the base texture when
/// the implicit derivatives are unavailable. When this capability is not present, invocations of
/// these functions are translated to invocations of `_Texture.SampleLevelZero()`.
///
/// @remark Implicit derivatives for the compute stage can be enabled by declaring capability `GL_NV_compute_shader_derivatives` (GLSL),
/// `SPV_KHR_compute_shader_derivatives` (SPIR-V), or profile `cs_6_6` (HLSL).
///
/// [compound]
alias implicit_derivatives_sampling = fragment
| raytracingstages_compute_amplification_mesh + GL_NV_compute_shader_derivatives
;

/// Capabilities required to use fragment derivative operations (without GLSL derivativecontrol)
/// [Compound]
alias fragmentprocessing = fragment + _sm_5_0
Expand Down