Implement the CheckAccessFullyMapped
HLSL Function
#99204
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
Implement the CheckAccessFullyMapped HLSL function in
hlsl_intrinsics.h
.To match DXC when targeting DirectX, this operation can essentially just be a cast from uint to bool - the backend already handles inserting the DXIL op where necessary when the status of a load, gather, or sample is used, as per https://llvm.org/docs/DirectX/DXILResources.html#loads-samples-and-gathers.
For SPIR-V DXC maps this to OpImageSparseTexelsResident (See https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst). In this case it does not appear to behave simply as a cast to bool and might need more work.
DirectX
SPIR-V
OpImageSparseTexelsResident:
Description:
Translates a Resident Code into a Boolean. Result is false if any
of the texels were in uncommitted texture memory, and true
otherwise.
Result Type must be a Boolean type scalar.
Resident Code is a value from an OpImageSparse… instruction that
results in a resident code.
Capability:
SparseResidency
4
316
<id>
Result Type
Result <id>
<id>
Resident Code
Test Case(s)
Example 1
HLSL:
Determines whether all values from a Sample, Gather, or Load operation accessed mapped tiles in a tiled resource.
Syntax
Parameters
status [in]
Type: uint_only
The status value that is returned from a Sample, Gather, or Load operation. Because you can't access this status value directly, you need to pass it to CheckAccessFullyMapped.
Return value
Type: bool
Returns a Boolean value that indicates whether all values from a Sample, Gather, or Load operation accessed mapped tiles in a tiled resource. Returns TRUE if all values from the operation accessed mapped tiles; otherwise, returns FALSE if any values were taken from an unmapped tile.
Remarks
Minimum Shader Model
This function is supported in the following shader models.
This function is supported in the following types of shaders:
See also
Intrinsic Functions
The text was updated successfully, but these errors were encountered: