summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-08-17 23:08:34 -0700
committerGitHub <noreply@github.com>2022-08-17 23:08:34 -0700
commitadaea0e993fd8db351b5dad92802e47ed6d0ec77 (patch)
treedfad5201677b0202b0b890cbae066b5b2f3f033b /tests/cross-compile
parentd65c6183c0d8b365aa182c3d9026ba85522531f2 (diff)
Warning on lossy implicit casts. (#2367)
* Warning on bool to float conversion. * Fix test cases. * Improve. * LanguageServer: don't show constant value for non constant variables. * Fix tests. * Fix warnings in tests. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/cross-compile')
-rw-r--r--tests/cross-compile/array-of-buffers.slang2
-rw-r--r--tests/cross-compile/get-dimensions.slang6
-rw-r--r--tests/cross-compile/image-load.slang2
-rw-r--r--tests/cross-compile/simple-cross-compile.slang2
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/cross-compile/array-of-buffers.slang b/tests/cross-compile/array-of-buffers.slang
index de87e6d9d..31738ccfc 100644
--- a/tests/cross-compile/array-of-buffers.slang
+++ b/tests/cross-compile/array-of-buffers.slang
@@ -27,6 +27,6 @@ float4 main() : SV_Target
return cb [index] .f
+ sb1[index][index].f
+ sb2[index][index]
- + float4(bb[index].Load(index*4));
+ + float4(bb[index].Load(int(index*4)));
}
diff --git a/tests/cross-compile/get-dimensions.slang b/tests/cross-compile/get-dimensions.slang
index 13874a6e2..65c2a1a70 100644
--- a/tests/cross-compile/get-dimensions.slang
+++ b/tests/cross-compile/get-dimensions.slang
@@ -35,7 +35,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
if (index == 0)
{
buffer0.GetDimensions(count, stride);
- last = buffer0.Load(count - 1);
+ last = buffer0.Load(int(count - 1));
}
else if (index == 1)
{
@@ -45,13 +45,13 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
else if (index == 2)
{
buffer2.GetDimensions(count, stride);
- last = int(buffer2.Load(count -1));
+ last = int(buffer2.Load(int(count - 1)));
}
else
{
buffer3.GetDimensions(count, stride);
- last = buffer3.Load(count - 1).a;
+ last = buffer3.Load(int(count - 1)).a;
}
outputBuffer[index * 2] = int(count);
diff --git a/tests/cross-compile/image-load.slang b/tests/cross-compile/image-load.slang
index 7f125bd5a..dc80288e6 100644
--- a/tests/cross-compile/image-load.slang
+++ b/tests/cross-compile/image-load.slang
@@ -15,5 +15,5 @@ ParameterBlock<Params> gParams;
void main(uint3 tid : SV_DispatchThreadID)
{
- float f = gParams.tex.Load(int3(tid.xy, tid.z));
+ float f = gParams.tex.Load(int3(int2(tid.xy), int(tid.z)));
}
diff --git a/tests/cross-compile/simple-cross-compile.slang b/tests/cross-compile/simple-cross-compile.slang
index e5fe9d3cc..b85d5cb53 100644
--- a/tests/cross-compile/simple-cross-compile.slang
+++ b/tests/cross-compile/simple-cross-compile.slang
@@ -19,7 +19,7 @@ int test(int val)
if(c == Color.Red)
{
- if(val & 1)
+ if((val & 1) != 0)
{
c = Color.Blue;
}