Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#--- source.hlsl

StructuredBuffer<int4> X : register(t0);
StructuredBuffer<int4> Y : register(t1);
StructuredBuffer<int4> X : register(t0); // partially mapped
StructuredBuffer<int4> Y : register(t1); // unmapped

RWStructuredBuffer<int> Out : register(u2);
RWStructuredBuffer<bool> CAFM : register(u3);
Expand Down Expand Up @@ -54,6 +54,17 @@ void main() {
Out[idx] = 9003;

idx += 1;

// Test that if CheckAccessFullyMapped is called on
// something other than an operation status,
// the LSB will be cast to a bool

unsigned int Nums[4] = {1, 2, 2147483647, 0};
for (unsigned int I = 0; I < 4; I++){
unsigned int Num_I = Nums[I];
CAFM[idx] = CheckAccessFullyMapped(Num_I);
idx++;
}
Comment on lines +58 to +67
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually think we should test this usage - this feels like undefined behaviour territory. You aren't really allowed to call CheckAccessFullyMapped with anything other than the status value returned from a Sample, Gather, or Load: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/checkaccessfullymapped - whatever it returns is kind of nonsense by definition.

Copy link
Collaborator

@bogner bogner Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there is a INSTR.CHECKACCESSFULLYMAPPED error code listed in https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst, so I would have hoped that doing this would fail validation. I guess it doesn't though based on the test results?

}

//--- pipeline.yaml
Expand Down Expand Up @@ -86,13 +97,19 @@ Buffers:
- Name: CAFM
Format: Bool
Stride: 4
FillSize: 16
FillSize: 32
FillValue: 0
- Name: ExpectedCAFM
Format: Bool
Stride: 4
# Only the first data access should be accessing fully mapped memory
Data: [1, 0, 0, 0]
# There are 2 tests being run, each with 4 values
# The first test results in the first 4 values
# The first data access in this test is the only
# data access to a mapped tile, so we expect 1.
# The second test tests bool casting, and only
# the 2nd and 4th input has an LSB of 0, so we
# expect only the 2nd and 4th results to be 0.
Data: [1, 0, 0, 0, 1, 0, 1, 0]

Results:
- Result: Test
Expand Down Expand Up @@ -139,6 +156,7 @@ DescriptorSets:

# Unimplemented https://github.com/llvm/offload-test-suite/issues/514
# XFAIL: Vulkan

# Unimplemented https://github.com/llvm/llvm-project/issues/166954
# XFAIL: Clang-Vulkan

Expand Down
Loading