Allow shader input indices from defined constants
このコミットが含まれているのは:
1 親
40b0c63909
コミット
2834eb67dd
3ファイル変更
+33
-33
検索条件に一致するファイルはありません
+28
-28
@@ -1443,6 +1443,34 @@ public class Test_D2DPixelShaderDescriptorGenerator_Analyzers
|
||||
await CSharpAnalyzerWithLanguageVersionTest<NonConstantD2DInputArgumentAnalyzer>.VerifyAnalyzerAsync(source);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task NonConstantSourceInputIndexForD2DIntrinsic_NonLiteralConstant_DoesNotWarn()
|
||||
{
|
||||
const string source = """
|
||||
using ComputeSharp.D2D1;
|
||||
using float4 = ComputeSharp.Float4;
|
||||
|
||||
[D2DInputCount(1)]
|
||||
internal readonly partial struct MyType(int x) : ID2D1PixelShader
|
||||
{
|
||||
public const int SourceIndex = 0;
|
||||
|
||||
public float4 Execute()
|
||||
{
|
||||
D2D.GetInput(SourceIndex);
|
||||
D2D.GetInputCoordinate(SourceIndex);
|
||||
D2D.SampleInput(SourceIndex, 0);
|
||||
D2D.SampleInputAtOffset(SourceIndex, 0);
|
||||
D2D.SampleInputAtPosition(SourceIndex, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await CSharpAnalyzerWithLanguageVersionTest<NonConstantD2DInputArgumentAnalyzer>.VerifyAnalyzerAsync(source);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task NonConstantSourceInputIndexForD2DIntrinsic_NonConstantExpression_Warns()
|
||||
{
|
||||
@@ -1468,32 +1496,4 @@ public class Test_D2DPixelShaderDescriptorGenerator_Analyzers
|
||||
|
||||
await CSharpAnalyzerWithLanguageVersionTest<NonConstantD2DInputArgumentAnalyzer>.VerifyAnalyzerAsync(source);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task NonConstantSourceInputIndexForD2DIntrinsic_NonLiteralConstant_Warns()
|
||||
{
|
||||
const string source = """
|
||||
using ComputeSharp.D2D1;
|
||||
using float4 = ComputeSharp.Float4;
|
||||
|
||||
[D2DInputCount(1)]
|
||||
internal readonly partial struct MyType(int x) : ID2D1PixelShader
|
||||
{
|
||||
public const int SourceIndex = 0;
|
||||
|
||||
public float4 Execute()
|
||||
{
|
||||
D2D.GetInput({|CMPSD2D0085:SourceIndex|});
|
||||
D2D.GetInputCoordinate({|CMPSD2D0085:SourceIndex|});
|
||||
D2D.SampleInput({|CMPSD2D0085:SourceIndex|}, 0);
|
||||
D2D.SampleInputAtOffset({|CMPSD2D0085:SourceIndex|}, 0);
|
||||
D2D.SampleInputAtPosition({|CMPSD2D0085:SourceIndex|}, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
await CSharpAnalyzerWithLanguageVersionTest<NonConstantD2DInputArgumentAnalyzer>.VerifyAnalyzerAsync(source);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする