aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda_rt/src/tests/texture_sampler.cu
diff options
context:
space:
mode:
Diffstat (limited to 'zluda_rt/src/tests/texture_sampler.cu')
-rw-r--r--zluda_rt/src/tests/texture_sampler.cu21
1 files changed, 21 insertions, 0 deletions
diff --git a/zluda_rt/src/tests/texture_sampler.cu b/zluda_rt/src/tests/texture_sampler.cu
new file mode 100644
index 0000000..a9ceae1
--- /dev/null
+++ b/zluda_rt/src/tests/texture_sampler.cu
@@ -0,0 +1,21 @@
+// nvcc texture_sampler.cu -I"C:\dev\OptiX SDK 6.5.0\include" -ptx -x cu -dc
+#include <optix.h>
+#include <optixu/optixu_math_namespace.h>
+#include <optix_world.h>
+
+using namespace optix;
+
+rtBuffer<float4, 2> output_buffer;
+rtTextureSampler<float4, 2> image1;
+rtDeclareVariable(unsigned int, image2, , );
+
+RT_PROGRAM void start() {
+ output_buffer[make_uint2(0,0)] = tex2D(image1, 0, 0);
+ output_buffer[make_uint2(1,0)] = tex2D(image1, 1, 0);
+ output_buffer[make_uint2(0,1)] = tex2D(image1, 0, 1);
+ output_buffer[make_uint2(1,1)] = tex2D(image1, 1, 1);
+ output_buffer[make_uint2(0,2)] = rtTex2D<float4>(image2, 0, 0);
+ output_buffer[make_uint2(1,2)] = rtTex2D<float4>(image2, 1, 0);
+ output_buffer[make_uint2(0,3)] = rtTex2D<float4>(image2, 0, 1);
+ output_buffer[make_uint2(1,3)] = rtTex2D<float4>(image2, 1, 1);
+}