[spirv] report error for invalid tex2d multiplication (#3175)
Calling tex2D must report an error but the multiplication using it crashes instead of an error report.
This commit is contained in:
Родитель
4ee59f6c2d
Коммит
7b5d547ea3
|
@ -5556,6 +5556,8 @@ SpirvInstruction *SpirvEmitter::processBinaryOp(
|
|||
} else {
|
||||
// Evalute lhs before rhs
|
||||
lhsPtr = doExpr(lhs);
|
||||
if (!lhsPtr)
|
||||
return nullptr;
|
||||
lhsVal = loadIfGLValue(lhs, lhsPtr);
|
||||
rhsVal = loadIfGLValue(rhs);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// Run: %dxc -T ps_6_0 -E main
|
||||
|
||||
// CHECK: deprecated tex2D intrinsic function will not be supported
|
||||
sampler Sampler;
|
||||
|
||||
float4 main(float2 texCoord : TEXCOORD0) : SV_TARGET0
|
||||
{
|
||||
return tex2D(Sampler, texCoord) * 1;
|
||||
}
|
|
@ -921,6 +921,9 @@ TEST_F(FileTest, TextureArraySampleCmpLevelZero) {
|
|||
TEST_F(FileTest, TextureSampleInvalidImplicitLod) {
|
||||
runFileTest("texture.sample-invalid-implicit-lod.hlsl", Expect::Failure);
|
||||
}
|
||||
TEST_F(FileTest, TextureInvalidTex2D) {
|
||||
runFileTest("texture.sample.invalid.tex2d.hlsl", Expect::Failure);
|
||||
}
|
||||
|
||||
// For structured buffer methods
|
||||
TEST_F(FileTest, StructuredBufferLoad) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче