@@ -94,17 +94,20 @@ typealias usamplerCube = SamplerCube<uint4>;
94
94
typealias isamplerCube = SamplerCube< int4 > ;
95
95
typealias samplerCube = SamplerCube< float4 > ;
96
96
97
- typealias usampler1DShadow = Sampler1DShadow< uint4 > ;
98
- typealias isampler1DShadow = Sampler1DShadow< int4 > ;
99
- typealias sampler1DShadow = Sampler1DShadow< float4 > ;
97
+ typealias Sampler1DShadow< T= float > = __TextureImpl< T, __Shape1D, /* isArray:*/ 0 , /* isMS:*/ 0 , /* sampleCount:*/ 0 , /* access:*/ 0 , /* isShadow: */ 1 , /* isCombined: */ 1 , /* format*/ 0 > ;
98
+ typealias usampler1DShadow = Sampler1DShadow< uint > ;
99
+ typealias isampler1DShadow = Sampler1DShadow< int > ;
100
+ typealias sampler1DShadow = Sampler1DShadow< float > ;
100
101
101
- typealias usampler2DShadow = Sampler2DShadow< uint4 > ;
102
- typealias isampler2DShadow = Sampler2DShadow< int4 > ;
103
- typealias sampler2DShadow = Sampler2DShadow< float4 > ;
102
+ typealias Sampler2DShadow< T= float > = __TextureImpl< T, __Shape2D, /* isArray:*/ 0 , /* isMS:*/ 0 , /* sampleCount:*/ 0 , /* access:*/ 0 , /* isShadow: */ 1 , /* isCombined: */ 1 , /* format*/ 0 > ;
103
+ typealias usampler2DShadow = Sampler2DShadow< uint > ;
104
+ typealias isampler2DShadow = Sampler2DShadow< int > ;
105
+ typealias sampler2DShadow = Sampler2DShadow< float > ;
104
106
105
- typealias usamplerCubeShadow = SamplerCubeShadow< uint4 > ;
106
- typealias isamplerCubeShadow = SamplerCubeShadow< int4 > ;
107
- typealias samplerCubeShadow = SamplerCubeShadow< float4 > ;
107
+ typealias SamplerCubeShadow< T= float > = __TextureImpl< T, __ShapeCube, /* isArray:*/ 0 , /* isMS:*/ 0 , /* sampleCount:*/ 0 , /* access:*/ 0 , /* isShadow: */ 1 , /* isCombined: */ 1 , /* format*/ 0 > ;
108
+ typealias usamplerCubeShadow = SamplerCubeShadow< uint > ;
109
+ typealias isamplerCubeShadow = SamplerCubeShadow< int > ;
110
+ typealias samplerCubeShadow = SamplerCubeShadow< float > ;
108
111
109
112
typealias usampler1DArray = Sampler1DArray< uint4 > ;
110
113
typealias isampler1DArray = Sampler1DArray< int4 > ;
@@ -118,20 +121,20 @@ typealias usamplerCubeArray = SamplerCubeArray<uint4>;
118
121
typealias isamplerCubeArray = SamplerCubeArray< int4 > ;
119
122
typealias samplerCubeArray = SamplerCubeArray< float4 > ;
120
123
121
- typealias usampler1DArrayShadow = Sampler1DArrayShadow< uint4 > ;
122
- typealias isampler1DArrayShadow = Sampler1DArrayShadow< int4 > ;
123
- typealias sampler1DArrayShadow = Sampler1DArrayShadow< float4 > ;
124
+ typealias Sampler1DArrayShadow< T= float > = __TextureImpl< T, __Shape1D, /* isArray:*/ 1 , /* isMS:*/ 0 , /* sampleCount:*/ 0 , /* access:*/ 0 , /* isShadow: */ 1 , /* isCombined: */ 1 , /* format*/ 0 > ;
125
+ typealias usampler1DArrayShadow = Sampler1DArrayShadow< uint > ;
126
+ typealias isampler1DArrayShadow = Sampler1DArrayShadow< int > ;
127
+ typealias sampler1DArrayShadow = Sampler1DArrayShadow< float > ;
124
128
125
- typealias usampler2DArrayShadow = Sampler2DArrayShadow< uint4 > ;
126
- typealias isampler2DArrayShadow = Sampler2DArrayShadow< int4 > ;
127
- typealias sampler2DArrayShadow = Sampler2DArrayShadow< float4 > ;
129
+ typealias Sampler2DArrayShadow< T= float > = __TextureImpl< T, __Shape2D, /* isArray:*/ 1 , /* isMS:*/ 0 , /* sampleCount:*/ 0 , /* access:*/ 0 , /* isShadow: */ 1 , /* isCombined: */ 1 , /* format*/ 0 > ;
130
+ typealias usampler2DArrayShadow = Sampler2DArrayShadow< uint > ;
131
+ typealias isampler2DArrayShadow = Sampler2DArrayShadow< int > ;
132
+ typealias sampler2DArrayShadow = Sampler2DArrayShadow< float > ;
128
133
129
- typealias usamplerCubeArrayShadow = SamplerCubeArrayShadow< uint4 > ;
130
- typealias isamplerCubeArrayShadow = SamplerCubeArrayShadow< int4 > ;
131
- typealias samplerCubeArrayShadow = SamplerCubeArrayShadow< float4 > ;
132
-
133
- __intrinsic_op(vectorReshape)
134
- vector< T,N> __vectorReshape< let N : int , T, let M : int > (vector< T,M> vin);
134
+ typealias SamplerCubeArrayShadow< T= float > = __TextureImpl< T, __ShapeCube, /* isArray:*/ 1 , /* isMS:*/ 0 , /* sampleCount:*/ 0 , /* access:*/ 0 , /* isShadow: */ 1 , /* isCombined: */ 1 , /* format*/ 0 > ;
135
+ typealias usamplerCubeArrayShadow = SamplerCubeArrayShadow< uint > ;
136
+ typealias isamplerCubeArrayShadow = SamplerCubeArrayShadow< int > ;
137
+ typealias samplerCubeArrayShadow = SamplerCubeArrayShadow< float > ;
135
138
136
139
[ForceInline]
137
140
vector< T,4 > texelFetch< T:__BuiltinArithmeticType, let N : int > (Sampler1D< vector< T,N>> sampler, int p, int lod)
@@ -235,45 +238,12 @@ float texture<T:__BuiltinArithmeticType, let N : int> (Sampler2DArrayShadow<vect
235
238
return sampler .SampleCmp (p .xyz , p .w );
236
239
}
237
240
238
- // TODO: define `texture` for SamplerCubeArrayShadow.
239
-
240
-
241
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (Sampler1D< vector< T,N>> sampler, float P, float dPdx, float dPdy)
242
- {
243
- return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
244
- }
245
-
246
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (Sampler2D< vector< T,N>> sampler, vec2 P, vec2 dPdx, vec2 dPdy)
247
- {
248
- return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
249
- }
250
-
251
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (Sampler3D< vector< T,N>> sampler, vec3 P, vec3 dPdx, vec3 dPdy)
252
- {
253
- return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
254
- }
255
-
256
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (SamplerCube< vector< T,N>> sampler, vec3 P, vec3 dPdx, vec3 dPdy)
257
- {
258
- return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
259
- }
260
-
261
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (Sampler1DArray< vector< T,N>> sampler, vec2 P, float dPdx, float dPdy)
262
- {
263
- return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
264
- }
265
-
266
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (Sampler2DArray< vector< T,N>> sampler, vec3 P, vec2 dPdx, vec2 dPdy)
241
+ __generic < T:__BuiltinArithmeticType, let N : int , shape:__ITextureShape, let sampleCount: int , let isArray:int , let format:int >
242
+ vector< T,4 > textureGrad(__TextureImpl< vector< T,N> , shape, isArray, 0 , sampleCount, 0 , 1 , 1 , format> sampler, vector< float , shape.dimensions+ isArray> P, vector< float ,shape.planeDimensions> dPdx, vector< float ,shape.planeDimensions> dPdy)
267
243
{
268
244
return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
269
245
}
270
246
271
- vector< T,4 > textureGrad< T:__BuiltinArithmeticType, let N : int > (SamplerCubeArray< vector< T,N>> sampler, vec4 P, vec3 dPdx, vec3 dPdy)
272
- {
273
- return __vectorReshape< 4 > (sampler .SampleGrad (P, dPdx, dPdy));
274
- }
275
-
276
-
277
247
out float4 gl_Position : SV_Position;
278
248
out float gl_PointSize : SV_PointSize;
279
249
in vec4 gl_FragCoord : SV_Position;
0 commit comments