From bfe75618be81566882be8570b8db82ad5a2f8fe4 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Sat, 15 May 2021 11:22:14 -0400 Subject: Surface access on CUDA is byte addressed in X (#1841) * #include an absolute path didn't work - because paths were taken to always be relative. * Fix for writing to RWTexture with half types on CUDA. * CUDA half functionality doc updates. * First pass support for sust.p RWTexture format conversion on write. * Tidy up implementation of $C. Made clamping mode #define able. * A simple test for RWTexture CUDA format conversion. * Use $E to fix byte addressing in X in CUDA. * Do not scale when accessing via _convert versions of surface functions. --- prelude/slang-cuda-prelude.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'prelude') diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h index a439d274a..a18da027b 100644 --- a/prelude/slang-cuda-prelude.h +++ b/prelude/slang-cuda-prelude.h @@ -385,6 +385,9 @@ SLANG_SURFACE_WRITE(surfCubemapLayeredwrite, (int x, int y, int layerFace), (x, // Support for doing format conversion when writing to a surface/RWTexture +// NOTE! For normal surface access x values are *byte* addressed. +// For the _convert versions they are *not*. They don't need to be because sust.p does not require it. + template SLANG_FORCE_INLINE SLANG_CUDA_CALL void surf1Dwrite_convert(T, cudaSurfaceObject_t surfObj, int x, cudaSurfaceBoundaryMode boundaryMode); template -- cgit v1.2.3