summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2012-01-31 14:48:20 -0800
committerAlex Sakhartchouk <alexst@google.com>2012-01-31 14:48:20 -0800
commit452889a29671e63114dc2ab873597bdc5701f97b (patch)
treee20f0fa5e4b90bc1970d99850dc5f6e7d26f5b02 /tests
parente92c78ccd095ae1cb47198afb664f98571ce2148 (diff)
downloadframeworks_base-452889a29671e63114dc2ab873597bdc5701f97b.zip
frameworks_base-452889a29671e63114dc2ab873597bdc5701f97b.tar.gz
frameworks_base-452889a29671e63114dc2ab873597bdc5701f97b.tar.bz2
Better debugging for shader params.
Change-Id: Ib083e456e53226539d16599b4a2b4d89e5082439
Diffstat (limited to 'tests')
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/ShaderParam.java7
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh3
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh1
3 files changed, 11 insertions, 0 deletions
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/ShaderParam.java b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/ShaderParam.java
index 39aa1ee..05e36a7 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/ShaderParam.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/ShaderParam.java
@@ -105,6 +105,13 @@ public abstract class ShaderParam extends SceneGraphBase {
mRsFieldItem = new ScriptField_ShaderParam_s.Item();
mRsFieldItem.transformTimestamp = 0;
+ if (mParamName != null) {
+ mRsFieldItem.paramName = SceneManager.getCachedAlloc(mParamName);
+ if (mRsFieldItem.paramName == null) {
+ mRsFieldItem.paramName = SceneManager.getStringAsAllocation(rs, mParamName);
+ SceneManager.cacheAlloc(mParamName, mRsFieldItem.paramName);
+ }
+ }
initLocalData(rs);
return mRsFieldItem;
}
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh
index 3e61971..d1ef120 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh
@@ -23,6 +23,9 @@
static void debugParam(SgShaderParam *p, uint8_t *constantBuffer, const SgCamera *currentCam) {
rsDebug("____________ Param bufferOffset", p->bufferOffset);
rsDebug("Param Type ", p->type);
+ if (rsIsObject(p->paramName)) {
+ printName(p->paramName);
+ }
uint8_t *dataPtr = constantBuffer + p->bufferOffset;
const SgTransform *pTransform = NULL;
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh
index 9a5224b..393ae36 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh
@@ -179,6 +179,7 @@ typedef struct ShaderParam_s {
float4 float_value;
// Use one param type to handle all vector types for now
uint32_t float_vecSize;
+ rs_allocation paramName;
rs_allocation camera;
rs_allocation light;
rs_allocation transform;