Skip to content
Merged
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
3 changes: 1 addition & 2 deletions test/Feature/Textures/Texture2D.Gather.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ Results:
#--- end

# Unimplemented: Clang + DX: https://github.com/llvm/llvm-project/issues/101558
# Unimplemented: Clang + VK: https://github.com/llvm/llvm-project/issues/175630
# XFAIL: DirectX || Metal
# XFAIL: DirectX || Metal

# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
Expand Down
17 changes: 3 additions & 14 deletions test/Feature/Textures/Texture2D.OperatorIndex.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ void main() {
Out[1] = Tex[int2(1, 0)]; // Green
Out[2] = Tex[int2(0, 1)]; // Blue
Out[3] = Tex[int2(1, 1)]; // White

// Texture2D::mips.operator[][]
Out[4] = Tex.mips[0][int2(0, 0)]; // Red
Out[5] = Tex.mips[0][int2(1, 1)]; // White

// Test mip 1 (1x1)
Out[6] = Tex.mips[1][int2(0, 0)]; // Yellow
}

//--- pipeline.yaml
Expand All @@ -39,18 +32,15 @@ Buffers:
- Name: Out
Format: Float32
Channels: 4
FillSize: 112 # 7 * sizeof(float4)
FillSize: 64 # 4 * sizeof(float4)

- Name: Expected
Format: Float32
Channels: 4
Data: [ 1.0, 0.0, 0.0, 1.0, # [0]
0.0, 1.0, 0.0, 1.0, # [1]
0.0, 0.0, 1.0, 1.0, # [2]
1.0, 1.0, 1.0, 1.0, # [3]
1.0, 0.0, 0.0, 1.0, # [4]
1.0, 1.0, 1.0, 1.0, # [5]
1.0, 1.0, 0.0, 1.0 ] # [6] Yellow (mip 1)
1.0, 1.0, 1.0, 1.0 ] # [3]

DescriptorSets:
- Resources:
Expand All @@ -72,8 +62,7 @@ Results:
#--- end

# Unimplemented: Clang + DX: https://github.com/llvm/llvm-project/issues/101558
# Unimplemented: Clang + VK: https://github.com/llvm/llvm-project/issues/175630
# XFAIL: DirectX || Metal || Clang
# XFAIL: DirectX || Metal

# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
Expand Down
74 changes: 74 additions & 0 deletions test/Feature/Textures/Texture2D.mips.OperatorIndex.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#--- source.hlsl
[[vk::binding(0, 0)]] Texture2D<float4> Tex : register(t0);
[[vk::binding(1, 0)]] RWBuffer<float4> Out : register(u0);

[numthreads(1, 1, 1)]
void main() {
// Texture2D::mips.operator[][]
Out[0] = Tex.mips[0][int2(0, 0)]; // Red
Out[1] = Tex.mips[0][int2(1, 1)]; // White

// Test mip 1 (1x1)
Out[2] = Tex.mips[1][int2(0, 0)]; // Yellow
}

//--- pipeline.yaml
---
Shaders:
- Stage: Compute
Entry: main
DispatchSize: [1, 1, 1]

Buffers:
- Name: Tex
Format: Float32
Channels: 4
OutputProps: { Width: 2, Height: 2, Depth: 1, MipLevels: 2 }
Data: [ 1.0, 0.0, 0.0, 1.0, # Mip 0 (2x2)
0.0, 1.0, 0.0, 1.0,
0.0, 0.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 0.0, 1.0 ] # Mip 1 (1x1) - Yellow

- Name: Out
Format: Float32
Channels: 4
FillSize: 48 # 3 * sizeof(float4)

- Name: Expected
Format: Float32
Channels: 4
Data: [ 1.0, 0.0, 0.0, 1.0, # [0] Red
1.0, 1.0, 1.0, 1.0, # [1] White
1.0, 1.0, 0.0, 1.0 ] # [2] Yellow (mip 1)

DescriptorSets:
- Resources:
- Name: Tex
Kind: Texture2D
DirectXBinding: { Register: 0, Space: 0 }
VulkanBinding: { Binding: 0 }
- Name: Out
Kind: RWBuffer
DirectXBinding: { Register: 0, Space: 0 }
VulkanBinding: { Binding: 1 }

Results:
- Result: MipsOperatorIndexTest
Rule: BufferExact
Actual: Out
Expected: Expected
...
#--- end

# Unimplemented: https://github.com/llvm/llvm-project/issues/101558
# XFAIL: Clang && DirectX

# Unimplemented: https://github.com/llvm/offload-test-suite/issues/1039
# XFAIL: DirectX

# XFAIL: Metal

# RUN: split-file %s %t
# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/source.hlsl
# RUN: %offloader %t/pipeline.yaml %t.o
Loading