Skip to content

Commit ef9b27e

Browse files
committed
Implement SampleCmpBias and SampleCmpGrad
-these are new for HLSL shader model 6.8 -also change glsl.meta.slang to use existing sampler typealias in hlsl.meta.slang fixes #8929
1 parent a3afdc6 commit ef9b27e

File tree

6 files changed

+650
-77
lines changed

6 files changed

+650
-77
lines changed

docs/command-line-slangc-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ A capability describes an optional feature that a target may or may not support.
15411541
* `texture_querylod`
15421542
* `texture_querylevels`
15431543
* `texture_shadowlod`
1544+
* `texture_shadowgrad`
15441545
* `atomic_glsl_float1`
15451546
* `atomic_glsl_float2`
15461547
* `atomic_glsl_halfvec`

docs/user-guide/a3-02-reference-capability-atoms.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,10 @@ Compound Capabilities
13271327
`texture_querylod`
13281328
> Capabilities required to query texture LOD info
13291329
1330+
`texture_shadowgrad`
1331+
> Capabilities required for shadow texture sampling with bias and gradients.
1332+
> New in HLSL SM6.8 but existed in older GLSL and SPIRV targets.
1333+
13301334
`texture_shadowlod`
13311335
> Capabilities required to query shadow texture lod info
13321336

source/slang/glsl.meta.slang

Lines changed: 6 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,44 +1327,9 @@ public typealias usamplerCube = SamplerCube<uint4>;
13271327
public typealias isamplerCube = SamplerCube<int4>;
13281328
public typealias samplerCube = SamplerCube<float4>;
13291329

1330-
__generic<let sampleCount:int=0, let format:int=0>
1331-
public typealias sampler1DShadow = _Texture<
1332-
float,
1333-
__Shape1D,
1334-
0, // isArray
1335-
0, // isMS
1336-
sampleCount,
1337-
0, // access
1338-
1, // isShadow
1339-
1, // isCombined
1340-
format
1341-
>;
1342-
1343-
__generic<let sampleCount:int=0, let format:int=0>
1344-
public typealias sampler2DShadow = _Texture<
1345-
float,
1346-
__Shape2D,
1347-
0, // isArray
1348-
0, // isMS
1349-
sampleCount,
1350-
0, // access
1351-
1, // isShadow
1352-
1, // isCombined
1353-
format
1354-
>;
1355-
1356-
__generic<let sampleCount:int=0, let format:int=0>
1357-
public typealias samplerCubeShadow = _Texture<
1358-
float,
1359-
__ShapeCube,
1360-
0, // isArray
1361-
0, // isMS
1362-
sampleCount,
1363-
0, // access
1364-
1, // isShadow
1365-
1, // isCombined
1366-
format
1367-
>;
1330+
public typealias sampler1DShadow = Sampler1DShadow;
1331+
public typealias sampler2DShadow = Sampler2DShadow;
1332+
public typealias samplerCubeShadow = SamplerCubeShadow;
13681333

13691334
public typealias usampler1DArray = Sampler1DArray<uint4>;
13701335
public typealias isampler1DArray = Sampler1DArray<int4>;
@@ -1378,44 +1343,9 @@ public typealias usamplerCubeArray = SamplerCubeArray<uint4>;
13781343
public typealias isamplerCubeArray = SamplerCubeArray<int4>;
13791344
public typealias samplerCubeArray = SamplerCubeArray<float4>;
13801345

1381-
__generic<let sampleCount:int=0, let format:int=0>
1382-
public typealias sampler1DArrayShadow = _Texture<
1383-
float,
1384-
__Shape1D,
1385-
1, // isArray
1386-
0, // isMS
1387-
sampleCount,
1388-
0, // access
1389-
1, // isShadow
1390-
1, // isCombined
1391-
format
1392-
>;
1393-
1394-
__generic<let sampleCount:int=0, let format:int=0>
1395-
public typealias sampler2DArrayShadow = _Texture<
1396-
float,
1397-
__Shape2D,
1398-
1, // isArray
1399-
0, // isMS
1400-
sampleCount,
1401-
0, // access
1402-
1, // isShadow
1403-
1, // isCombined
1404-
format
1405-
>;
1406-
1407-
__generic<let sampleCount:int=0, let format:int=0>
1408-
public typealias samplerCubeArrayShadow = _Texture<
1409-
float,
1410-
__ShapeCube,
1411-
1, // isArray
1412-
0, // isMS
1413-
sampleCount,
1414-
0, // access
1415-
1, // isShadow
1416-
1, // isCombined
1417-
format
1418-
>;
1346+
public typealias sampler1DArrayShadow = Sampler1DArrayShadow;
1347+
public typealias sampler2DArrayShadow = Sampler2DArrayShadow;
1348+
public typealias samplerCubeArrayShadow = SamplerCubeArrayShadow;
14191349

14201350
public typealias sampler2DMS = Sampler2DMS<float4>;
14211351
public typealias isampler2DMS = Sampler2DMS<int4>;

0 commit comments

Comments
 (0)