summaryrefslogtreecommitdiff
path: root/tests/cppbasic/compute.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2013-11-26 15:38:31 -0800
committerStephen Hines <srhines@google.com>2013-11-26 16:56:30 -0800
commit8a588bd9d34088ed89ef2c192c32ea2301e601bc (patch)
tree8c55a31502d2edba474c7460c3db56cc37fff898 /tests/cppbasic/compute.cpp
parentb98626d1da831c5ced7d74d374a3242cbb82c3a5 (diff)
Fix problems with NDK Sampler implementation.
Creation methods should be static and we need to use the proper Context pointer for the dispatch methods. Change-Id: I43c25a7348c9a9aa9a2a82e184d4ac644625800b
Diffstat (limited to 'tests/cppbasic/compute.cpp')
-rw-r--r--tests/cppbasic/compute.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/cppbasic/compute.cpp b/tests/cppbasic/compute.cpp
index d9776677..96aa324a 100644
--- a/tests/cppbasic/compute.cpp
+++ b/tests/cppbasic/compute.cpp
@@ -6,9 +6,8 @@
using namespace android;
using namespace RSC;
-int main()
+int test_compute()
{
-
sp<RS> rs = new RS();
printf("New RS %p\n", rs.get());
@@ -32,9 +31,17 @@ int main()
sp<Allocation> aout = Allocation::createTyped(rs, t);
printf("Allocation %p %p\n", ain.get(), aout.get());
- ScriptC_mono* sc = new ScriptC_mono(rs);
+ sp<ScriptC_mono> sc = new ScriptC_mono(rs);
printf("new script\n");
+ sc->set_alloc(a1);
+ sc->set_elem(e);
+ sc->set_type(t);
+ sc->set_script(sc);
+ sc->set_script(NULL);
+ sp<const Sampler> samp = Sampler::CLAMP_NEAREST(rs);
+ sc->set_sampler(samp);
+
// We read back the status from the script-side via a "failed" allocation.
sp<const Element> failed_e = Element::BOOLEAN(rs);
Type::Builder failed_tb(rs, failed_e);
@@ -88,9 +95,11 @@ int main()
failed_alloc->copy1DTo(&failed);
}
- printf("Deleting stuff\n");
- delete sc;
- printf("Delete OK\n");
+ return failed;
+}
+
+int main() {
+ bool failed = test_compute();
if (failed) {
printf("TEST FAILED!\n");