aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-12-11 16:16:25 -0800
committerSiva Velusamy <vsiva@google.com>2011-12-15 11:36:33 -0800
commite367c160d2f58e8f55bff52e56cf08c343ccbe4c (patch)
tree95e8d83eba9d1e08004e1998e60afc18f27bd895 /eclipse/plugins
parentbc32af8dc9e20135c29ba7444ae162761774cdb5 (diff)
downloadsdk-e367c160d2f58e8f55bff52e56cf08c343ccbe4c.zip
sdk-e367c160d2f58e8f55bff52e56cf08c343ccbe4c.tar.gz
sdk-e367c160d2f58e8f55bff52e56cf08c343ccbe4c.tar.bz2
gltrace: Add current FB binding to GL state
Add the currently bound framebuffer setting to the GL state. Set it appropriately based on the glBindFramebuffer() call. Change-Id: I9dfc5154cd7801c2aa06920f67e31de45c63e6f7
Diffstat (limited to 'eclipse/plugins')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateType.java10
3 files changed, 32 insertions, 4 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java
index dbe36a1..0724e69 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java
@@ -75,12 +75,20 @@ public class GLState {
return vertexArrayData;
}
+ private IGLProperty createFramebufferState() {
+ IGLProperty binding = new GLIntegerProperty(GLStateType.FRAMEBUFFER_BINDING, 0);
+ GLCompositeProperty framebufferState = new GLCompositeProperty(
+ GLStateType.FRAMEBUFFER_STATE,
+ binding);
+ return framebufferState;
+ }
+
/** Construct the default OpenGL State hierarchy. */
public static IGLProperty createDefaultState() {
- // TODO: Currently, this only models a tiny subset of the OpenGL state: the properties for
- // vertex array data.
+ // TODO: Currently, this only models a tiny subset of the OpenGL state.
GLCompositeProperty glState = new GLCompositeProperty(GLStateType.GL_STATE,
- sGLState.createVertexArrayData());
+ sGLState.createVertexArrayData(),
+ sGLState.createFramebufferState());
return glState;
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java
index bda6dd7..4300018 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateTransform.java
@@ -20,6 +20,7 @@ import com.android.ide.eclipse.gldebugger.GLEnum;
import com.android.ide.eclipse.gltrace.model.GLCall;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -76,6 +77,8 @@ public class GLStateTransform {
switch (call.getFunction()) {
case glVertexAttribPointer:
return transformsForGlVertexAttribPointer(call);
+ case glBindFramebuffer:
+ return transformsForGlBindFramebuffer(call);
default:
return new ArrayList<GLStateTransform>();
}
@@ -123,4 +126,13 @@ public class GLStateTransform {
Integer.valueOf(pointer)));
return transforms;
}
+
+ private static List<GLStateTransform> transformsForGlBindFramebuffer(GLCall call) {
+ // void glBindFramebuffer(GLenum target, GLuint framebuffer);
+ int fb = call.getArg(1).getIntValue(0);
+ return Collections.singletonList(new GLStateTransform(
+ GLPropertyAccessor.makeAccessor(GLStateType.FRAMEBUFFER_STATE,
+ GLStateType.FRAMEBUFFER_BINDING),
+ fb));
+ }
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateType.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateType.java
index 16af545..a4eb59d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateType.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLStateType.java
@@ -36,7 +36,15 @@ public enum GLStateType {
ARRAY_BUFFER_BINDING("Current Buffer Binding"),
ELEMENT_ARRAY_BUFFER_BINDING("Element Array Buffer Binding"),
VERTEX_ATTRIB_ARRAY_BUFFER_BINDINGS("Attribute Array Buffer Bindings"),
- VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_PER_INDEX("Attribute Array Buffer Binding");
+ VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_PER_INDEX("Attribute Array Buffer Binding"),
+
+ FRAMEBUFFER_STATE("Framebuffer State"),
+ FRAMEBUFFER_BINDING("Framebuffer Binding"),
+ FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE("Framebuffer object type"),
+ FRAMEBUFFER_ATTACHMENT_OBJECT_NAME("Framebuffer object name"),
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL("Framebuffer texture level"),
+ FRAMEBUFFER_ATTACHEMENT_TEXTURE_CUBE_MAP_FACE("Framebuffer texture cubemap face");
+
private final String mDescription;