Skip to content

Commit

Permalink
Merge branch 'master' into parse-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 authored Dec 9, 2024
2 parents bfb29e5 + 2e7774a commit 1721492
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/slang/hlsl.meta.slang
Original file line number Diff line number Diff line change
Expand Up @@ -4052,6 +4052,20 @@ ${{{{
}
}}}}

// Declare Sampler*Shadow type aliases.
${{{{
for (int shape = 0; shape < 4; shape++)
for (int isArray = 0; isArray<=1; isArray++)
{
}}}}
/// Represents a handle to a $(shapeTypeNames[shape]) combined texture-sampler for shadow comparison.
/// @param format The storage format of the texture.
/// @see Please refer to `_Texture` for more information about texture types.
/// @category texture_types
typealias Sampler$(shapeTypeNames[shape])$(arrayPostFix[isArray])Shadow<int format=0> = _Texture<float, __Shape$(shapeTypeNames[shape]), $(isArray), 0, 0, 0, 1, 1, format>;
${{{{
}
}}}}

// Atomic intrinsic insts.

Expand Down
13 changes: 13 additions & 0 deletions tests/spirv/sampler-shadow.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//TEST:SIMPLE(filecheck=CHECK): -target spirv

// CHECK: OpImageSampleDrefExplicitLod

Sampler2DShadow ss;

RWStructuredBuffer<float> output;

[numthreads(1,1,1)]
void computeMain()
{
output[0] = ss.SampleCmpLevelZero(float2(0.0), 0.5);
}

0 comments on commit 1721492

Please sign in to comment.