diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-06-08 08:48:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-08 08:48:47 -0400 |
| commit | fb50fab76a723f46026474ea5bb0226c297d1fd5 (patch) | |
| tree | f489f30ccb94a130c942d907b9f009e7cc6aabd4 /source | |
| parent | 5974f3e543b56cd11f28093c5a9d7410b2b3f979 (diff) | |
Fix RWTexture issues on CUDA (#1876)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Re-enable CUDA RWTexture tests.
Re-enable RWTexture1D test
Make sure tests have only single mip for RWTexture (required for CUDA)
* Fix issue with reading CUDA surface.
Re-enable working CUDA RWTextureTest.
Enable 1D case.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/core.meta.slang | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index 6b73630a3..afdd96029 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -934,6 +934,12 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt) { sb << '.' << char(i + 'x'); } + + // Surface access is *byte* addressed in x in CUDA + if (i == 0) + { + sb << " * $E"; + } } if (isArray) { @@ -949,7 +955,9 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt) sb << "Layered"; } sb << "read"; - sb << "<$T0>($0, ($1).x, ($1).y, ($1).z"; + + // Surface access is *byte* addressed in x in CUDA + sb << "<$T0>($0, ($1).x * $E, ($1).y, ($1).z"; if (isArray) { sb << ", int(($1).w)"; @@ -1090,12 +1098,12 @@ for (int tt = 0; tt < kBaseTextureTypeCount; ++tt) sb << ", ($1)"; if (vecCount > 1) { - sb << '.' << char(i + 'x'); - // Surface access is *byte* addressed in x in CUDA - if (i == 0) - { - sb << " * $E"; - } + sb << '.' << char(i + 'x'); + } + // Surface access is *byte* addressed in x in CUDA + if (i == 0) + { + sb << " * $E"; } } |
