summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramVertexFixedFunction.java
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-06-17 17:25:04 -0700
committerStephen Hines <srhines@google.com>2014-06-18 00:24:44 -0700
commitfa1275a6e743c4661cc3d5e05bb89559a8e59727 (patch)
tree4c86df54c9a64caeccd458d68969bd67c65c808d /rs/java/android/renderscript/ProgramVertexFixedFunction.java
parent88b37edaeab7b31cab0f5115e5c9f63a49991408 (diff)
Create FieldPacker.getPos() to get the actual amount of data used for FP.
We need larger buffers to handle 64-bit RS object types, but 32-bit code will never fill all of the getData().length bytes. This allows us to retain our verification code. We have to modify an existing use of FieldPacker that was doing partial updates of the underlying buffer. This was really relying on the old data to be implicitly selected and written back, but that is not guaranteed by the original API. This also required a fix to the FieldPacker.reset() API, which was not allowing the FieldPacker to ever point to the final entry in its buffer. Change-Id: Idcd52790ac2b0ab1eff3f043e7eec2832953f04b
Diffstat (limited to 'rs/java/android/renderscript/ProgramVertexFixedFunction.java')
-rw-r--r--rs/java/android/renderscript/ProgramVertexFixedFunction.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/ProgramVertexFixedFunction.java b/rs/java/android/renderscript/ProgramVertexFixedFunction.java
index a350154c456c..702659780dbb 100644
--- a/rs/java/android/renderscript/ProgramVertexFixedFunction.java
+++ b/rs/java/android/renderscript/ProgramVertexFixedFunction.java
@@ -249,6 +249,9 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
for(int i = 0; i < 16; i ++) {
mIOBuffer.addF32(m.mMat[i]);
}
+ // Reset the buffer back to the end, since we want to flush all of
+ // the contents back (and not just what we wrote now).
+ mIOBuffer.reset(mIOBuffer.getData().length);
mAlloc.setFromFieldPacker(0, mIOBuffer);
}