From b8f294445b998eadb9b09e2b91eb462b881eaf2e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 24 Jan 2020 15:06:08 -0500 Subject: Texture Sample available in CUDA (#1176) * WIP: Trying to figure out how texturing will work with CUDA. * WIP: Fixes for CUDA layout. Initial CUDA texture test. * WIP: Outputs something compilable by CUDA for TextureND.Sample * 2d texture working with CUDA. * Fix how binding for SamplerState occurs in CUDA. * Small tidy up of comments. --- prelude/slang-cuda-prelude.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'prelude') diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h index f78814486..28e423b31 100644 --- a/prelude/slang-cuda-prelude.h +++ b/prelude/slang-cuda-prelude.h @@ -19,6 +19,17 @@ struct FixedArray T m_data[SIZE]; }; +// Typically defined in cuda.h, but we can't ship/rely on that, so just define here +typedef unsigned long long CUtexObject; +typedef unsigned long long CUsurfObject; + +// On CUDA sampler state is actually bound up with the texture object. We have a SamplerState type, +// backed as a pointer, to simplify code generation, with the downside that such a binding will take up +// uniform space, even though it will have no effect. +// TODO(JS): Consider ways to strip use of variables of this type so have no binding, +struct SamplerStateUnused; +typedef SamplerStateUnused* SamplerState; + // Code generator will generate the specific type template struct Matrix; -- cgit v1.2.3