Commit fddbc9c7 by Lubosz Sarnecki Committed by Commit Bot

capture: Implement capturing GLES1 vertex pointers.

Implement capturing glVertexPointer, glTexCoordPointer, glNormalPointer, glColorPointer and glPointSizePointerOES using a new CaptureVertexPointerGLES1 helper function. This is done by using fixed indices for gClientArrays that are retrieved from the GLES1Renderer. Bug: angleproject:5751 Change-Id: I6c774ff21942ea3422c4c77a615f88299901c0ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2773288Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
parent df72ea36
......@@ -25,6 +25,7 @@
#include "libANGLE/Display.h"
#include "libANGLE/Fence.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/GLES1Renderer.h"
#include "libANGLE/Query.h"
#include "libANGLE/ResourceMap.h"
#include "libANGLE/Shader.h"
......@@ -3926,9 +3927,22 @@ void FrameCapture::maybeCapturePreCallUpdates(const gl::Context *context, CallCa
switch (call.entryPoint)
{
case EntryPoint::GLVertexAttribPointer:
case EntryPoint::GLVertexPointer:
case EntryPoint::GLColorPointer:
case EntryPoint::GLTexCoordPointer:
case EntryPoint::GLNormalPointer:
case EntryPoint::GLPointSizePointerOES:
{
// Get array location
GLuint index = call.params.getParam("index", ParamType::TGLuint, 0).value.GLuintVal;
GLuint index = 0;
if (call.entryPoint == EntryPoint::GLVertexAttribPointer)
{
index = call.params.getParam("index", ParamType::TGLuint, 0).value.GLuintVal;
}
else
{
index = call.params.getClientArrayPointerParameter().arrayClientPointerIndex;
}
if (call.params.hasClientArrayData())
{
......@@ -4843,6 +4857,16 @@ void CaptureStringLimit(const GLchar *str, uint32_t limit, ParamCapture *paramCa
}
}
void CaptureVertexPointerGLES1(const gl::State &glState,
gl::ClientVertexArrayType type,
const void *pointer,
ParamCapture *paramCapture)
{
paramCapture->value.voidConstPointerVal = pointer;
paramCapture->arrayClientPointerIndex =
gl::GLES1Renderer::VertexArrayIndex(type, glState.gles1());
}
gl::Program *GetProgramForCapture(const gl::State &glState, gl::ShaderProgramID handle)
{
gl::Program *program = glState.getShaderProgramManagerForCapture().getProgram(handle);
......
......@@ -481,6 +481,10 @@ std::ostream &operator<<(std::ostream &os, const ParamCapture &capture);
void CaptureMemory(const void *source, size_t size, ParamCapture *paramCapture);
void CaptureString(const GLchar *str, ParamCapture *paramCapture);
void CaptureStringLimit(const GLchar *str, uint32_t limit, ParamCapture *paramCapture);
void CaptureVertexPointerGLES1(const gl::State &glState,
gl::ClientVertexArrayType type,
const void *pointer,
ParamCapture *paramCapture);
gl::Program *GetProgramForCapture(const gl::State &glState, gl::ShaderProgramID handle);
......
......@@ -39,7 +39,7 @@ void CaptureColorPointer_pointer(const State &glState,
const void *pointer,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
CaptureVertexPointerGLES1(glState, ClientVertexArrayType::Color, pointer, paramCapture);
}
void CaptureFogfv_params(const State &glState,
......@@ -264,7 +264,7 @@ void CaptureNormalPointer_pointer(const State &glState,
const void *pointer,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
CaptureVertexPointerGLES1(glState, ClientVertexArrayType::Normal, pointer, paramCapture);
}
void CapturePointParameterfv_params(const State &glState,
......@@ -293,7 +293,7 @@ void CaptureTexCoordPointer_pointer(const State &glState,
const void *pointer,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
CaptureVertexPointerGLES1(glState, ClientVertexArrayType::TextureCoord, pointer, paramCapture);
}
void CaptureTexEnvfv_params(const State &glState,
......@@ -344,7 +344,7 @@ void CaptureVertexPointer_pointer(const State &glState,
const void *pointer,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
CaptureVertexPointerGLES1(glState, ClientVertexArrayType::Vertex, pointer, paramCapture);
}
} // namespace gl
......@@ -3139,7 +3139,7 @@ void CapturePointSizePointerOES_pointer(const State &glState,
const void *pointer,
ParamCapture *paramCapture)
{
UNIMPLEMENTED();
CaptureVertexPointerGLES1(glState, ClientVertexArrayType::PointSize, pointer, paramCapture);
}
void CaptureQueryMatrixxOES_mantissa(const State &glState,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment