blob: 486e3b80917240c7335ae675d3b731d998c485a1 [file] [log] [blame]
/*
* Copyright 2015, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* THIS FILE WAS GENERATED BY apic. DO NOT EDIT.
*/
#ifndef GAPII_GLES_SPY_H
#define GAPII_GLES_SPY_H
#include "gles_imports.h"
#include "gles_types.h"
#include "spy_base.h"
#include <gapic/log.h>
#include <memory>
#include <string>
namespace gapii {
class GlesSpy : public SpyBase {
public:
inline void init(std::shared_ptr<gapic::Encoder> encoder);
inline void replayCreateRenderer(uint32_t id);
inline void replayBindRenderer(uint32_t id);
inline void backbufferInfo(int32_t width, int32_t height, uint32_t color_fmt,
uint32_t depth_fmt, uint32_t stencil_fmt, bool resetViewportScissor);
inline void startTimer(uint8_t index);
inline uint64_t stopTimer(uint8_t index);
inline void flushPostBuffer();
inline int eglInitialize(void* dpy, int* major, int* minor);
inline void* eglCreateContext(void* display, void* config, void* share_context,
int* attrib_list);
inline int eglMakeCurrent(void* display, void* draw, void* read, void* context);
inline int eglSwapBuffers(void* display, void* surface);
inline int eglQuerySurface(void* display, void* surface, int attribute, int* value);
inline void* glXCreateContext(void* dpy, void* vis, void* shareList, bool direct);
inline void* glXCreateNewContext(void* display, void* fbconfig, uint32_t type, void* shared,
bool direct);
inline void glXMakeContextCurrent(void* display, void* draw, void* read, void* ctx);
inline void glXSwapBuffers(void* display, void* drawable);
inline void* wglCreateContext(void* hdc);
inline void* wglCreateContextAttribsARB(void* hdc, void* hShareContext, int* attribList);
inline int wglMakeCurrent(void* hdc, void* hglrc);
inline void wglSwapBuffers(void* hdc);
inline int CGLCreateContext(void* pix, void* share, void** ctx);
inline int CGLSetCurrentContext(void* ctx);
inline void glEnableClientState(uint32_t type);
inline void glDisableClientState(uint32_t type);
inline void glGetProgramBinaryOES(uint32_t program, int32_t buffer_size, int32_t* bytes_written,
uint32_t* binary_format, void* binary);
inline void glProgramBinaryOES(uint32_t program, uint32_t binary_format, void* binary,
int32_t binary_size);
inline void glStartTilingQCOM(int32_t x, int32_t y, int32_t width, int32_t height,
uint32_t preserveMask);
inline void glEndTilingQCOM(uint32_t preserve_mask);
inline void glDiscardFramebufferEXT(uint32_t target, int32_t numAttachments,
uint32_t* attachments);
inline void glInsertEventMarkerEXT(int32_t length, char* marker);
inline void glPushGroupMarkerEXT(int32_t length, char* marker);
inline void glPopGroupMarkerEXT();
inline void glTexStorage1DEXT(uint32_t target, int32_t levels, uint32_t format, int32_t width);
inline void glTexStorage2DEXT(uint32_t target, int32_t levels, uint32_t format, int32_t width,
int32_t height);
inline void glTexStorage3DEXT(uint32_t target, int32_t levels, uint32_t format, int32_t width,
int32_t height, int32_t depth);
inline void glTextureStorage1DEXT(uint32_t texture, uint32_t target, int32_t levels,
uint32_t format, int32_t width);
inline void glTextureStorage2DEXT(uint32_t texture, uint32_t target, int32_t levels,
uint32_t format, int32_t width, int32_t height);
inline void glTextureStorage3DEXT(uint32_t texture, uint32_t target, int32_t levels,
uint32_t format, int32_t width, int32_t height,
int32_t depth);
inline void glGenVertexArraysOES(int32_t count, uint32_t* arrays);
inline void glBindVertexArrayOES(uint32_t array);
inline void glDeleteVertexArraysOES(int32_t count, uint32_t* arrays);
inline bool glIsVertexArrayOES(uint32_t array);
inline void glEGLImageTargetTexture2DOES(uint32_t target, void* image);
inline void glEGLImageTargetRenderbufferStorageOES(uint32_t target, void* image);
inline uint32_t glGetGraphicsResetStatusEXT();
inline void glBindAttribLocation(uint32_t program, uint32_t location, char* name);
inline void glBlendFunc(uint32_t src_factor, uint32_t dst_factor);
inline void glBlendFuncSeparate(uint32_t src_factor_rgb, uint32_t dst_factor_rgb,
uint32_t src_factor_alpha, uint32_t dst_factor_alpha);
inline void glBlendEquation(uint32_t equation);
inline void glBlendEquationSeparate(uint32_t rgb, uint32_t alpha);
inline void glBlendColor(float red, float green, float blue, float alpha);
inline void glEnableVertexAttribArray(uint32_t location);
inline void glDisableVertexAttribArray(uint32_t location);
inline void glVertexAttribPointer(uint32_t location, int32_t size, uint32_t type,
bool normalized, int32_t stride, void* data);
inline void glGetActiveAttrib(uint32_t program, uint32_t location, int32_t buffer_size,
int32_t* buffer_bytes_written, int32_t* vector_count,
uint32_t* type, char* name);
inline void glGetActiveUniform(uint32_t program, int32_t location, int32_t buffer_size,
int32_t* buffer_bytes_written, int32_t* size, uint32_t* type,
char* name);
inline uint32_t glGetError();
inline void glGetProgramiv(uint32_t program, uint32_t parameter, int32_t* value);
inline void glGetShaderiv(uint32_t shader, uint32_t parameter, int32_t* value);
inline int32_t glGetUniformLocation(uint32_t program, char* name);
inline uint32_t glGetAttribLocation(uint32_t program, char* name);
inline void glPixelStorei(uint32_t parameter, int32_t value);
inline void glTexParameteri(uint32_t target, uint32_t parameter, int32_t value);
inline void glTexParameterf(uint32_t target, uint32_t parameter, float value);
inline void glGetTexParameteriv(uint32_t target, uint32_t parameter, int32_t* values);
inline void glGetTexParameterfv(uint32_t target, uint32_t parameter, float* values);
inline void glUniform1i(int32_t location, int32_t value);
inline void glUniform2i(int32_t location, int32_t value0, int32_t value1);
inline void glUniform3i(int32_t location, int32_t value0, int32_t value1, int32_t value2);
inline void glUniform4i(int32_t location, int32_t value0, int32_t value1, int32_t value2,
int32_t value3);
inline void glUniform1iv(int32_t location, int32_t count, int32_t* value);
inline void glUniform2iv(int32_t location, int32_t count, int32_t* value);
inline void glUniform3iv(int32_t location, int32_t count, int32_t* value);
inline void glUniform4iv(int32_t location, int32_t count, int32_t* value);
inline void glUniform1f(int32_t location, float value);
inline void glUniform2f(int32_t location, float value0, float value1);
inline void glUniform3f(int32_t location, float value0, float value1, float value2);
inline void glUniform4f(int32_t location, float value0, float value1, float value2,
float value3);
inline void glUniform1fv(int32_t location, int32_t count, float* value);
inline void glUniform2fv(int32_t location, int32_t count, float* value);
inline void glUniform3fv(int32_t location, int32_t count, float* value);
inline void glUniform4fv(int32_t location, int32_t count, float* value);
inline void glUniformMatrix2fv(int32_t location, int32_t count, bool transpose, float* values);
inline void glUniformMatrix3fv(int32_t location, int32_t count, bool transpose, float* values);
inline void glUniformMatrix4fv(int32_t location, int32_t count, bool transpose, float* values);
inline void glGetUniformfv(uint32_t program, int32_t location, float* values);
inline void glGetUniformiv(uint32_t program, int32_t location, int32_t* values);
inline void glVertexAttrib1f(uint32_t location, float value0);
inline void glVertexAttrib2f(uint32_t location, float value0, float value1);
inline void glVertexAttrib3f(uint32_t location, float value0, float value1, float value2);
inline void glVertexAttrib4f(uint32_t location, float value0, float value1, float value2,
float value3);
inline void glVertexAttrib1fv(uint32_t location, float* value);
inline void glVertexAttrib2fv(uint32_t location, float* value);
inline void glVertexAttrib3fv(uint32_t location, float* value);
inline void glVertexAttrib4fv(uint32_t location, float* value);
inline void glGetShaderPrecisionFormat(uint32_t shader_type, uint32_t precision_type,
int32_t* range, int32_t* precision);
inline void glDepthMask(bool enabled);
inline void glDepthFunc(uint32_t function);
inline void glDepthRangef(float near, float far);
inline void glColorMask(bool red, bool green, bool blue, bool alpha);
inline void glStencilMask(uint32_t mask);
inline void glStencilMaskSeparate(uint32_t face, uint32_t mask);
inline void glStencilFuncSeparate(uint32_t face, uint32_t function, int32_t reference_value,
int32_t mask);
inline void glStencilOpSeparate(uint32_t face, uint32_t stencil_fail,
uint32_t stencil_pass_depth_fail,
uint32_t stencil_pass_depth_pass);
inline void glFrontFace(uint32_t orientation);
inline void glViewport(int32_t x, int32_t y, int32_t width, int32_t height);
inline void glScissor(int32_t x, int32_t y, int32_t width, int32_t height);
inline void glActiveTexture(uint32_t unit);
inline void glGenTextures(int32_t count, uint32_t* textures);
inline void glDeleteTextures(int32_t count, uint32_t* textures);
inline bool glIsTexture(uint32_t texture);
inline void glBindTexture(uint32_t target, uint32_t texture);
inline void glTexImage2D(uint32_t target, int32_t level, uint32_t internal_format,
int32_t width, int32_t height, int32_t border, uint32_t format,
uint32_t type, void* data);
inline void glTexSubImage2D(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset,
int32_t width, int32_t height, uint32_t format, uint32_t type,
void* data);
inline void glCopyTexImage2D(uint32_t target, int32_t level, uint32_t format, int32_t x,
int32_t y, int32_t width, int32_t height, int32_t border);
inline void glCopyTexSubImage2D(uint32_t target, int32_t level, int32_t xoffset,
int32_t yoffset, int32_t x, int32_t y, int32_t width,
int32_t height);
inline void glCompressedTexImage2D(uint32_t target, int32_t level, uint32_t format,
int32_t width, int32_t height, int32_t border,
int32_t image_size, void* data);
inline void glCompressedTexSubImage2D(uint32_t target, int32_t level, int32_t xoffset,
int32_t yoffset, int32_t width, int32_t height,
uint32_t format, int32_t image_size, void* data);
inline void glGenerateMipmap(uint32_t target);
inline void glReadPixels(int32_t x, int32_t y, int32_t width, int32_t height, uint32_t format,
uint32_t type, void* data);
inline void glGenFramebuffers(int32_t count, uint32_t* framebuffers);
inline void glBindFramebuffer(uint32_t target, uint32_t framebuffer);
inline uint32_t glCheckFramebufferStatus(uint32_t target);
inline void glDeleteFramebuffers(int32_t count, uint32_t* framebuffers);
inline bool glIsFramebuffer(uint32_t framebuffer);
inline void glGenRenderbuffers(int32_t count, uint32_t* renderbuffers);
inline void glBindRenderbuffer(uint32_t target, uint32_t renderbuffer);
inline void glRenderbufferStorage(uint32_t target, uint32_t format, int32_t width,
int32_t height);
inline void glDeleteRenderbuffers(int32_t count, uint32_t* renderbuffers);
inline bool glIsRenderbuffer(uint32_t renderbuffer);
inline void glGetRenderbufferParameteriv(uint32_t target, uint32_t parameter, int32_t* values);
inline void glGenBuffers(int32_t count, uint32_t* buffers);
inline void glBindBuffer(uint32_t target, uint32_t buffer);
inline void glBufferData(uint32_t target, int32_t size, void* data, uint32_t usage);
inline void glBufferSubData(uint32_t target, int32_t offset, int32_t size, void* data);
inline void glDeleteBuffers(int32_t count, uint32_t* buffers);
inline bool glIsBuffer(uint32_t buffer);
inline void glGetBufferParameteriv(uint32_t target, uint32_t parameter, int32_t* value);
inline uint32_t glCreateShader(uint32_t type);
inline void glDeleteShader(uint32_t shader);
inline void glShaderSource(uint32_t shader, int32_t count, char** source, int32_t* length);
inline void glShaderBinary(int32_t count, uint32_t* shaders, uint32_t binary_format,
void* binary, int32_t binary_size);
inline void glGetShaderInfoLog(uint32_t shader, int32_t buffer_length,
int32_t* string_length_written, char* info);
inline void glGetShaderSource(uint32_t shader, int32_t buffer_length,
int32_t* string_length_written, char* source);
inline void glReleaseShaderCompiler();
inline void glCompileShader(uint32_t shader);
inline bool glIsShader(uint32_t shader);
inline uint32_t glCreateProgram();
inline void glDeleteProgram(uint32_t program);
inline void glAttachShader(uint32_t program, uint32_t shader);
inline void glDetachShader(uint32_t program, uint32_t shader);
inline void glGetAttachedShaders(uint32_t program, int32_t buffer_length,
int32_t* shaders_length_written, uint32_t* shaders);
inline void glLinkProgram(uint32_t program);
inline void glGetProgramInfoLog(uint32_t program, int32_t buffer_length,
int32_t* string_length_written, char* info);
inline void glUseProgram(uint32_t program);
inline bool glIsProgram(uint32_t program);
inline void glValidateProgram(uint32_t program);
inline void glClearColor(float r, float g, float b, float a);
inline void glClearDepthf(float depth);
inline void glClearStencil(int32_t stencil);
inline void glClear(uint32_t mask);
inline void glCullFace(uint32_t mode);
inline void glPolygonOffset(float scale_factor, float units);
inline void glLineWidth(float width);
inline void glSampleCoverage(float value, bool invert);
inline void glHint(uint32_t target, uint32_t mode);
inline void glFramebufferRenderbuffer(uint32_t framebuffer_target,
uint32_t framebuffer_attachment,
uint32_t renderbuffer_target, uint32_t renderbuffer);
inline void glFramebufferTexture2D(uint32_t framebuffer_target, uint32_t framebuffer_attachment,
uint32_t texture_target, uint32_t texture, int32_t level);
inline void glGetFramebufferAttachmentParameteriv(uint32_t framebuffer_target,
uint32_t attachment, uint32_t parameter,
int32_t* value);
inline void glDrawElements(uint32_t draw_mode, int32_t element_count, uint32_t indices_type,
void* indices);
inline void glDrawArrays(uint32_t draw_mode, int32_t first_index, int32_t index_count);
inline void glFlush();
inline void glFinish();
inline void glGetBooleanv(uint32_t param, bool* values);
inline void glGetFloatv(uint32_t param, float* values);
inline void glGetIntegerv(uint32_t param, int32_t* values);
inline char* glGetString(uint32_t param);
inline void glEnable(uint32_t capability);
inline void glDisable(uint32_t capability);
inline bool glIsEnabled(uint32_t capability);
inline void* glMapBufferRange(uint32_t target, int32_t offset, int32_t length, uint32_t access);
inline void glUnmapBuffer(uint32_t target);
inline void glInvalidateFramebuffer(uint32_t target, int32_t count, uint32_t* attachments);
inline void glRenderbufferStorageMultisample(uint32_t target, int32_t samples, uint32_t format,
int32_t width, int32_t height);
inline void glBlitFramebuffer(int32_t srcX0, int32_t srcY0, int32_t srcX1, int32_t srcY1,
int32_t dstX0, int32_t dstY0, int32_t dstX1, int32_t dstY1,
uint32_t mask, uint32_t filter);
inline void glGenQueries(int32_t count, uint32_t* queries);
inline void glBeginQuery(uint32_t target, uint32_t query);
inline void glEndQuery(uint32_t target);
inline void glDeleteQueries(int32_t count, uint32_t* queries);
inline bool glIsQuery(uint32_t query);
inline void glGetQueryiv(uint32_t target, uint32_t parameter, int32_t* value);
inline void glGetQueryObjectuiv(uint32_t query, uint32_t parameter, uint32_t* value);
inline void glGenQueriesEXT(int32_t count, uint32_t* queries);
inline void glBeginQueryEXT(uint32_t target, uint32_t query);
inline void glEndQueryEXT(uint32_t target);
inline void glDeleteQueriesEXT(int32_t count, uint32_t* queries);
inline bool glIsQueryEXT(uint32_t query);
inline void glQueryCounterEXT(uint32_t query, uint32_t target);
inline void glGetQueryivEXT(uint32_t target, uint32_t parameter, int32_t* value);
inline void glGetQueryObjectivEXT(uint32_t query, uint32_t parameter, int32_t* value);
inline void glGetQueryObjectuivEXT(uint32_t query, uint32_t parameter, uint32_t* value);
inline void glGetQueryObjecti64vEXT(uint32_t query, uint32_t parameter, int64_t* value);
inline void glGetQueryObjectui64vEXT(uint32_t query, uint32_t parameter, uint64_t* value);
protected:
GlesImports mImports;
// Globals
ContextID NextContextID;
ThreadID CurrentThread;
ThreadIDToContextRef Contexts;
EGLContextToContextRef EGLContexts;
GLXContextToContextRef GLXContexts;
HGLRCToContextRef WGLContexts;
CGLContextObjToContextRef CGLContexts;
#include "gles_state_externs.inl"
};
// Inline methods
inline void GlesSpy::init(std::shared_ptr<gapic::Encoder> encoder) {
SpyBase::init(encoder);
mImports.Resolve();
}
inline void GlesSpy::replayCreateRenderer(uint32_t id) {
GAPID_INFO("replayCreateRenderer()\n");
do {
} while (false);
mEncoder->Uint16(0); // Type ID -- TODO: mEncoder->Id(REPLAY_CREATE_RENDERER_ID);
encodeObservations();
mEncoder->Uint32(id);
}
inline void GlesSpy::replayBindRenderer(uint32_t id) {
GAPID_INFO("replayBindRenderer()\n");
do {
} while (false);
mEncoder->Uint16(1); // Type ID -- TODO: mEncoder->Id(REPLAY_BIND_RENDERER_ID);
encodeObservations();
mEncoder->Uint32(id);
}
inline void GlesSpy::backbufferInfo(int32_t width, int32_t height, uint32_t color_fmt,
uint32_t depth_fmt, uint32_t stencil_fmt,
bool resetViewportScissor) {
GAPID_INFO("backbufferInfo()\n");
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_0_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_0_result;
std::shared_ptr<Framebuffer> l_backbuffer =
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)];
RenderbufferId l_color_id = (RenderbufferId)(
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0].mObject);
std::shared_ptr<Renderbuffer> l_color_buffer = l_ctx->mInstances.mRenderbuffers[l_color_id];
RenderbufferId l_depth_id = (RenderbufferId)(
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT].mObject);
std::shared_ptr<Renderbuffer> l_depth_buffer = l_ctx->mInstances.mRenderbuffers[l_depth_id];
RenderbufferId l_stencil_id = (RenderbufferId)(
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT].mObject);
std::shared_ptr<Renderbuffer> l_stencil_buffer =
l_ctx->mInstances.mRenderbuffers[l_stencil_id];
l_color_buffer->mWidth = width;
l_color_buffer->mHeight = height;
l_color_buffer->mFormat = color_fmt;
l_depth_buffer->mWidth = width;
l_depth_buffer->mHeight = height;
l_depth_buffer->mFormat = depth_fmt;
l_stencil_buffer->mWidth = width;
l_stencil_buffer->mHeight = height;
l_stencil_buffer->mFormat = stencil_fmt;
if (resetViewportScissor) {
l_ctx->mRasterizing.mScissor.mWidth = width;
l_ctx->mRasterizing.mScissor.mHeight = height;
l_ctx->mRasterizing.mViewport.mWidth = width;
l_ctx->mRasterizing.mViewport.mHeight = height;
}
} while (false);
mEncoder->Uint16(2); // Type ID -- TODO: mEncoder->Id(BACKBUFFER_INFO_ID);
encodeObservations();
mEncoder->Int32(width);
mEncoder->Int32(height);
mEncoder->Uint32(static_cast<uint32_t>(color_fmt));
mEncoder->Uint32(static_cast<uint32_t>(depth_fmt));
mEncoder->Uint32(static_cast<uint32_t>(stencil_fmt));
mEncoder->Bool(resetViewportScissor);
}
inline void GlesSpy::startTimer(uint8_t index) {
GAPID_INFO("startTimer()\n");
do {
} while (false);
mEncoder->Uint16(3); // Type ID -- TODO: mEncoder->Id(START_TIMER_ID);
encodeObservations();
mEncoder->Uint8(index);
}
inline uint64_t GlesSpy::stopTimer(uint8_t index) {
GAPID_INFO("stopTimer()\n");
uint64_t result = 0;
do {
break;
} while (false);
mEncoder->Uint16(4); // Type ID -- TODO: mEncoder->Id(STOP_TIMER_ID);
encodeObservations();
mEncoder->Uint8(index);
mEncoder->Uint64(result);
return result;
}
inline void GlesSpy::flushPostBuffer() {
GAPID_INFO("flushPostBuffer()\n");
do {
} while (false);
mEncoder->Uint16(5); // Type ID -- TODO: mEncoder->Id(FLUSH_POST_BUFFER_ID);
encodeObservations();
}
inline int GlesSpy::eglInitialize(void* dpy, int* major, int* minor) {
GAPID_INFO("eglInitialize()\n");
int result = mImports.eglInitialize(dpy, major, minor);
do {
write(slice(major, 0, 1), 0, read(slice(major, 0, 1), 0));
write(slice(minor, 0, 1), 0, read(slice(minor, 0, 1), 0));
break;
} while (false);
mEncoder->Uint16(6); // Type ID -- TODO: mEncoder->Id(EGL_INITIALIZE_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(dpy));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(major));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(minor));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline void* GlesSpy::eglCreateContext(void* display, void* config, void* share_context,
int* attrib_list) {
GAPID_INFO("eglCreateContext()\n");
void* result = mImports.eglCreateContext(display, config, share_context, attrib_list);
do {
EGLContext l_context = (EGLContext)(result);
ContextID l_identifier = this->NextContextID;
this->NextContextID = this->NextContextID + (ContextID)(1);
std::shared_ptr<Context> l_ctx = std::shared_ptr<Context>((new Context()));
l_ctx->mIdentifier = l_identifier;
l_ctx->mInstances.mBuffers[(BufferId)(0)] = std::shared_ptr<Buffer>((new Buffer()));
l_ctx->mInstances.mTextures[(TextureId)(0)] = std::shared_ptr<Texture>((new Texture()));
l_ctx->mInstances.mRenderbuffers[(RenderbufferId)(0)] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
RenderbufferId l_color_id = (RenderbufferId)(4294967295);
RenderbufferId l_depth_id = (RenderbufferId)(4294967294);
RenderbufferId l_stencil_id = (RenderbufferId)(4294967293);
l_ctx->mInstances.mRenderbuffers[l_color_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_depth_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_stencil_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
std::shared_ptr<Framebuffer> l_backbuffer =
std::shared_ptr<Framebuffer>((new Framebuffer()));
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_color_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_depth_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_stencil_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)] = l_backbuffer;
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_READ_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_FRONT] = 4294967295;
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_BACK] = 4294967295;
l_ctx->mPixelStorage[PixelStoreParameter::GL_PACK_ALIGNMENT] = 4;
l_ctx->mPixelStorage[PixelStoreParameter::GL_UNPACK_ALIGNMENT] = 4;
for (int32_t l_i = 0; l_i < 64; ++l_i) {
l_ctx->mVertexAttributeArrays[(AttributeLocation)(l_i)] =
std::shared_ptr<VertexAttributeArray>((new VertexAttributeArray()));
}
std::shared_ptr<Context> l_CreateContext_1_result = l_ctx;
this->EGLContexts[l_context] = l_CreateContext_1_result;
break;
} while (false);
mEncoder->Uint16(7); // Type ID -- TODO: mEncoder->Id(EGL_CREATE_CONTEXT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(config));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(share_context));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(attrib_list));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(result));
mEncoder->Uint32(0); // PoolID
return result;
}
inline int GlesSpy::eglMakeCurrent(void* display, void* draw, void* read, void* context) {
GAPID_INFO("eglMakeCurrent()\n");
int result = mImports.eglMakeCurrent(display, draw, read, context);
do {
std::shared_ptr<Context> l_SetContext_2_context = this->EGLContexts[context];
this->Contexts[this->CurrentThread] = l_SetContext_2_context;
break;
} while (false);
mEncoder->Uint16(8); // Type ID -- TODO: mEncoder->Id(EGL_MAKE_CURRENT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(draw));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(read));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(context));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline int GlesSpy::eglSwapBuffers(void* display, void* surface) {
GAPID_INFO("eglSwapBuffers()\n");
int result = mImports.eglSwapBuffers(display, surface);
do {
break;
} while (false);
mEncoder->Uint16(9); // Type ID -- TODO: mEncoder->Id(EGL_SWAP_BUFFERS_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(surface));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline int GlesSpy::eglQuerySurface(void* display, void* surface, int attribute, int* value) {
GAPID_INFO("eglQuerySurface()\n");
int result = mImports.eglQuerySurface(display, surface, attribute, value);
do {
write(slice(value, 0, 1), 0, read(slice(value, 0, 1), 0));
break;
} while (false);
mEncoder->Uint16(10); // Type ID -- TODO: mEncoder->Id(EGL_QUERY_SURFACE_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(surface));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(attribute);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline void* GlesSpy::glXCreateContext(void* dpy, void* vis, void* shareList, bool direct) {
GAPID_INFO("glXCreateContext()\n");
void* result = mImports.glXCreateContext(dpy, vis, shareList, direct);
do {
GLXContext l_context = (GLXContext)(result);
ContextID l_identifier = this->NextContextID;
this->NextContextID = this->NextContextID + (ContextID)(1);
std::shared_ptr<Context> l_ctx = std::shared_ptr<Context>((new Context()));
l_ctx->mIdentifier = l_identifier;
l_ctx->mInstances.mBuffers[(BufferId)(0)] = std::shared_ptr<Buffer>((new Buffer()));
l_ctx->mInstances.mTextures[(TextureId)(0)] = std::shared_ptr<Texture>((new Texture()));
l_ctx->mInstances.mRenderbuffers[(RenderbufferId)(0)] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
RenderbufferId l_color_id = (RenderbufferId)(4294967295);
RenderbufferId l_depth_id = (RenderbufferId)(4294967294);
RenderbufferId l_stencil_id = (RenderbufferId)(4294967293);
l_ctx->mInstances.mRenderbuffers[l_color_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_depth_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_stencil_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
std::shared_ptr<Framebuffer> l_backbuffer =
std::shared_ptr<Framebuffer>((new Framebuffer()));
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_color_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_depth_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_stencil_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)] = l_backbuffer;
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_READ_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_FRONT] = 4294967295;
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_BACK] = 4294967295;
l_ctx->mPixelStorage[PixelStoreParameter::GL_PACK_ALIGNMENT] = 4;
l_ctx->mPixelStorage[PixelStoreParameter::GL_UNPACK_ALIGNMENT] = 4;
for (int32_t l_i = 0; l_i < 64; ++l_i) {
l_ctx->mVertexAttributeArrays[(AttributeLocation)(l_i)] =
std::shared_ptr<VertexAttributeArray>((new VertexAttributeArray()));
}
std::shared_ptr<Context> l_CreateContext_3_result = l_ctx;
this->GLXContexts[l_context] = l_CreateContext_3_result;
break;
} while (false);
mEncoder->Uint16(11); // Type ID -- TODO: mEncoder->Id(GL_X_CREATE_CONTEXT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(dpy));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(vis));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(shareList));
mEncoder->Uint32(0); // PoolID
mEncoder->Bool(direct);
mEncoder->Uint64(reinterpret_cast<uint64_t>(result));
mEncoder->Uint32(0); // PoolID
return result;
}
inline void* GlesSpy::glXCreateNewContext(void* display, void* fbconfig, uint32_t type,
void* shared, bool direct) {
GAPID_INFO("glXCreateNewContext()\n");
void* result = mImports.glXCreateNewContext(display, fbconfig, type, shared, direct);
do {
GLXContext l_context = (GLXContext)(result);
ContextID l_identifier = this->NextContextID;
this->NextContextID = this->NextContextID + (ContextID)(1);
std::shared_ptr<Context> l_ctx = std::shared_ptr<Context>((new Context()));
l_ctx->mIdentifier = l_identifier;
l_ctx->mInstances.mBuffers[(BufferId)(0)] = std::shared_ptr<Buffer>((new Buffer()));
l_ctx->mInstances.mTextures[(TextureId)(0)] = std::shared_ptr<Texture>((new Texture()));
l_ctx->mInstances.mRenderbuffers[(RenderbufferId)(0)] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
RenderbufferId l_color_id = (RenderbufferId)(4294967295);
RenderbufferId l_depth_id = (RenderbufferId)(4294967294);
RenderbufferId l_stencil_id = (RenderbufferId)(4294967293);
l_ctx->mInstances.mRenderbuffers[l_color_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_depth_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_stencil_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
std::shared_ptr<Framebuffer> l_backbuffer =
std::shared_ptr<Framebuffer>((new Framebuffer()));
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_color_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_depth_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_stencil_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)] = l_backbuffer;
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_READ_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_FRONT] = 4294967295;
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_BACK] = 4294967295;
l_ctx->mPixelStorage[PixelStoreParameter::GL_PACK_ALIGNMENT] = 4;
l_ctx->mPixelStorage[PixelStoreParameter::GL_UNPACK_ALIGNMENT] = 4;
for (int32_t l_i = 0; l_i < 64; ++l_i) {
l_ctx->mVertexAttributeArrays[(AttributeLocation)(l_i)] =
std::shared_ptr<VertexAttributeArray>((new VertexAttributeArray()));
}
std::shared_ptr<Context> l_CreateContext_4_result = l_ctx;
this->GLXContexts[l_context] = l_CreateContext_4_result;
break;
} while (false);
mEncoder->Uint16(12); // Type ID -- TODO: mEncoder->Id(GL_X_CREATE_NEW_CONTEXT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(fbconfig));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint32(type);
mEncoder->Uint64(reinterpret_cast<uint64_t>(shared));
mEncoder->Uint32(0); // PoolID
mEncoder->Bool(direct);
mEncoder->Uint64(reinterpret_cast<uint64_t>(result));
mEncoder->Uint32(0); // PoolID
return result;
}
inline void GlesSpy::glXMakeContextCurrent(void* display, void* draw, void* read, void* ctx) {
GAPID_INFO("glXMakeContextCurrent()\n");
mImports.glXMakeContextCurrent(display, draw, read, ctx);
do {
std::shared_ptr<Context> l_SetContext_5_context = this->GLXContexts[ctx];
this->Contexts[this->CurrentThread] = l_SetContext_5_context;
} while (false);
mEncoder->Uint16(13); // Type ID -- TODO: mEncoder->Id(GL_X_MAKE_CONTEXT_CURRENT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(draw));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(read));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(ctx));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glXSwapBuffers(void* display, void* drawable) {
GAPID_INFO("glXSwapBuffers()\n");
mImports.glXSwapBuffers(display, drawable);
do {
} while (false);
mEncoder->Uint16(14); // Type ID -- TODO: mEncoder->Id(GL_X_SWAP_BUFFERS_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(display));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(drawable));
mEncoder->Uint32(0); // PoolID
}
inline void* GlesSpy::wglCreateContext(void* hdc) {
GAPID_INFO("wglCreateContext()\n");
void* result = mImports.wglCreateContext(hdc);
do {
HGLRC l_context = (HGLRC)(result);
ContextID l_identifier = this->NextContextID;
this->NextContextID = this->NextContextID + (ContextID)(1);
std::shared_ptr<Context> l_ctx = std::shared_ptr<Context>((new Context()));
l_ctx->mIdentifier = l_identifier;
l_ctx->mInstances.mBuffers[(BufferId)(0)] = std::shared_ptr<Buffer>((new Buffer()));
l_ctx->mInstances.mTextures[(TextureId)(0)] = std::shared_ptr<Texture>((new Texture()));
l_ctx->mInstances.mRenderbuffers[(RenderbufferId)(0)] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
RenderbufferId l_color_id = (RenderbufferId)(4294967295);
RenderbufferId l_depth_id = (RenderbufferId)(4294967294);
RenderbufferId l_stencil_id = (RenderbufferId)(4294967293);
l_ctx->mInstances.mRenderbuffers[l_color_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_depth_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_stencil_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
std::shared_ptr<Framebuffer> l_backbuffer =
std::shared_ptr<Framebuffer>((new Framebuffer()));
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_color_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_depth_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_stencil_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)] = l_backbuffer;
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_READ_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_FRONT] = 4294967295;
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_BACK] = 4294967295;
l_ctx->mPixelStorage[PixelStoreParameter::GL_PACK_ALIGNMENT] = 4;
l_ctx->mPixelStorage[PixelStoreParameter::GL_UNPACK_ALIGNMENT] = 4;
for (int32_t l_i = 0; l_i < 64; ++l_i) {
l_ctx->mVertexAttributeArrays[(AttributeLocation)(l_i)] =
std::shared_ptr<VertexAttributeArray>((new VertexAttributeArray()));
}
std::shared_ptr<Context> l_CreateContext_6_result = l_ctx;
this->WGLContexts[l_context] = l_CreateContext_6_result;
break;
} while (false);
mEncoder->Uint16(15); // Type ID -- TODO: mEncoder->Id(WGL_CREATE_CONTEXT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(hdc));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(result));
mEncoder->Uint32(0); // PoolID
return result;
}
inline void* GlesSpy::wglCreateContextAttribsARB(void* hdc, void* hShareContext, int* attribList) {
GAPID_INFO("wglCreateContextAttribsARB()\n");
void* result = mImports.wglCreateContextAttribsARB(hdc, hShareContext, attribList);
do {
HGLRC l_context = (HGLRC)(result);
ContextID l_identifier = this->NextContextID;
this->NextContextID = this->NextContextID + (ContextID)(1);
std::shared_ptr<Context> l_ctx = std::shared_ptr<Context>((new Context()));
l_ctx->mIdentifier = l_identifier;
l_ctx->mInstances.mBuffers[(BufferId)(0)] = std::shared_ptr<Buffer>((new Buffer()));
l_ctx->mInstances.mTextures[(TextureId)(0)] = std::shared_ptr<Texture>((new Texture()));
l_ctx->mInstances.mRenderbuffers[(RenderbufferId)(0)] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
RenderbufferId l_color_id = (RenderbufferId)(4294967295);
RenderbufferId l_depth_id = (RenderbufferId)(4294967294);
RenderbufferId l_stencil_id = (RenderbufferId)(4294967293);
l_ctx->mInstances.mRenderbuffers[l_color_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_depth_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_stencil_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
std::shared_ptr<Framebuffer> l_backbuffer =
std::shared_ptr<Framebuffer>((new Framebuffer()));
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_color_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_depth_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_stencil_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)] = l_backbuffer;
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_READ_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_FRONT] = 4294967295;
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_BACK] = 4294967295;
l_ctx->mPixelStorage[PixelStoreParameter::GL_PACK_ALIGNMENT] = 4;
l_ctx->mPixelStorage[PixelStoreParameter::GL_UNPACK_ALIGNMENT] = 4;
for (int32_t l_i = 0; l_i < 64; ++l_i) {
l_ctx->mVertexAttributeArrays[(AttributeLocation)(l_i)] =
std::shared_ptr<VertexAttributeArray>((new VertexAttributeArray()));
}
std::shared_ptr<Context> l_CreateContext_7_result = l_ctx;
this->WGLContexts[l_context] = l_CreateContext_7_result;
break;
} while (false);
mEncoder->Uint16(16); // Type ID -- TODO: mEncoder->Id(WGL_CREATE_CONTEXT_ATTRIBS_A_R_B_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(hdc));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(hShareContext));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(attribList));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(result));
mEncoder->Uint32(0); // PoolID
return result;
}
inline int GlesSpy::wglMakeCurrent(void* hdc, void* hglrc) {
GAPID_INFO("wglMakeCurrent()\n");
int result = mImports.wglMakeCurrent(hdc, hglrc);
do {
std::shared_ptr<Context> l_SetContext_8_context = this->WGLContexts[hglrc];
this->Contexts[this->CurrentThread] = l_SetContext_8_context;
break;
} while (false);
mEncoder->Uint16(17); // Type ID -- TODO: mEncoder->Id(WGL_MAKE_CURRENT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(hdc));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(hglrc));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline void GlesSpy::wglSwapBuffers(void* hdc) {
GAPID_INFO("wglSwapBuffers()\n");
mImports.wglSwapBuffers(hdc);
do {
} while (false);
mEncoder->Uint16(18); // Type ID -- TODO: mEncoder->Id(WGL_SWAP_BUFFERS_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(hdc));
mEncoder->Uint32(0); // PoolID
}
inline int GlesSpy::CGLCreateContext(void* pix, void* share, void** ctx) {
GAPID_INFO("CGLCreateContext()\n");
int result = mImports.CGLCreateContext(pix, share, ctx);
do {
CGLContextObj l_context = (CGLContextObj)(read(slice(ctx, 0, 1), 0));
ContextID l_identifier = this->NextContextID;
this->NextContextID = this->NextContextID + (ContextID)(1);
std::shared_ptr<Context> l_ctx = std::shared_ptr<Context>((new Context()));
l_ctx->mIdentifier = l_identifier;
l_ctx->mInstances.mBuffers[(BufferId)(0)] = std::shared_ptr<Buffer>((new Buffer()));
l_ctx->mInstances.mTextures[(TextureId)(0)] = std::shared_ptr<Texture>((new Texture()));
l_ctx->mInstances.mRenderbuffers[(RenderbufferId)(0)] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
RenderbufferId l_color_id = (RenderbufferId)(4294967295);
RenderbufferId l_depth_id = (RenderbufferId)(4294967294);
RenderbufferId l_stencil_id = (RenderbufferId)(4294967293);
l_ctx->mInstances.mRenderbuffers[l_color_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_depth_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
l_ctx->mInstances.mRenderbuffers[l_stencil_id] =
std::shared_ptr<Renderbuffer>((new Renderbuffer()));
std::shared_ptr<Framebuffer> l_backbuffer =
std::shared_ptr<Framebuffer>((new Framebuffer()));
l_backbuffer->mAttachments[FramebufferAttachment::GL_COLOR_ATTACHMENT0] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_color_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_DEPTH_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_depth_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_backbuffer->mAttachments[FramebufferAttachment::GL_STENCIL_ATTACHMENT] =
FramebufferAttachmentInfo()
.SetObject((uint32_t)(l_stencil_id))
.SetType(FramebufferAttachmentType::GL_RENDERBUFFER)
.SetCubeMapFace(CubeMapImageTarget::GL_TEXTURE_CUBE_MAP_POSITIVE_X);
l_ctx->mInstances.mFramebuffers[(FramebufferId)(0)] = l_backbuffer;
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mBoundFramebuffers[FramebufferTarget::GL_READ_FRAMEBUFFER] = (FramebufferId)(0);
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_FRONT] = 4294967295;
l_ctx->mRasterizing.mStencilMask[FaceMode::GL_BACK] = 4294967295;
l_ctx->mPixelStorage[PixelStoreParameter::GL_PACK_ALIGNMENT] = 4;
l_ctx->mPixelStorage[PixelStoreParameter::GL_UNPACK_ALIGNMENT] = 4;
for (int32_t l_i = 0; l_i < 64; ++l_i) {
l_ctx->mVertexAttributeArrays[(AttributeLocation)(l_i)] =
std::shared_ptr<VertexAttributeArray>((new VertexAttributeArray()));
}
std::shared_ptr<Context> l_CreateContext_9_result = l_ctx;
this->CGLContexts[l_context] = l_CreateContext_9_result;
write(slice(ctx, 0, 1), 0, l_context);
break;
} while (false);
mEncoder->Uint16(19); // Type ID -- TODO: mEncoder->Id(C_G_L_CREATE_CONTEXT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(pix));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(share));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(ctx));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline int GlesSpy::CGLSetCurrentContext(void* ctx) {
GAPID_INFO("CGLSetCurrentContext()\n");
int result = mImports.CGLSetCurrentContext(ctx);
do {
std::shared_ptr<Context> l_SetContext_10_context = this->CGLContexts[ctx];
this->Contexts[this->CurrentThread] = l_SetContext_10_context;
break;
} while (false);
mEncoder->Uint16(20); // Type ID -- TODO: mEncoder->Id(C_G_L_SET_CURRENT_CONTEXT_ID);
encodeObservations();
mEncoder->Uint64(reinterpret_cast<uint64_t>(ctx));
mEncoder->Uint32(0); // PoolID
mEncoder->Int64(result);
return result;
}
inline void GlesSpy::glEnableClientState(uint32_t type) {
GAPID_INFO("glEnableClientState()\n");
mImports.glEnableClientState(type);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_11_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_11_result;
l_ctx->mCapabilities[(uint32_t)(type)] = true;
} while (false);
mEncoder->Uint16(21); // Type ID -- TODO: mEncoder->Id(GL_ENABLE_CLIENT_STATE_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(type));
}
inline void GlesSpy::glDisableClientState(uint32_t type) {
GAPID_INFO("glDisableClientState()\n");
mImports.glDisableClientState(type);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_12_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_12_result;
l_ctx->mCapabilities[(uint32_t)(type)] = false;
} while (false);
mEncoder->Uint16(22); // Type ID -- TODO: mEncoder->Id(GL_DISABLE_CLIENT_STATE_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(type));
}
inline void GlesSpy::glGetProgramBinaryOES(uint32_t program, int32_t buffer_size,
int32_t* bytes_written, uint32_t* binary_format,
void* binary) {
GAPID_INFO("glGetProgramBinaryOES()\n");
mImports.glGetProgramBinaryOES(program, buffer_size, bytes_written, binary_format, binary);
do {
int32_t l_l = (int32_t)(read(slice(bytes_written, 0, 1), 0));
write(slice(bytes_written, 0, 1), 0, l_l);
write(slice(binary_format, 0, 1), 0, read(slice(binary_format, 0, 1), 0));
write(slice(binary, (uint64_t)(0), (uint64_t)(l_l)));
} while (false);
mEncoder->Uint16(23); // Type ID -- TODO: mEncoder->Id(GL_GET_PROGRAM_BINARY_O_E_S_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->Int32(buffer_size);
mEncoder->Uint64(reinterpret_cast<uint64_t>(bytes_written));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(binary_format));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(binary));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glProgramBinaryOES(uint32_t program, uint32_t binary_format, void* binary,
int32_t binary_size) {
GAPID_INFO("glProgramBinaryOES()\n");
mImports.glProgramBinaryOES(program, binary_format, binary, binary_size);
do {
} while (false);
mEncoder->Uint16(24); // Type ID -- TODO: mEncoder->Id(GL_PROGRAM_BINARY_O_E_S_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->Uint32(binary_format);
mEncoder->Uint64(reinterpret_cast<uint64_t>(binary));
mEncoder->Uint32(0); // PoolID
mEncoder->Int32(binary_size);
}
inline void GlesSpy::glStartTilingQCOM(int32_t x, int32_t y, int32_t width, int32_t height,
uint32_t preserveMask) {
GAPID_INFO("glStartTilingQCOM()\n");
mImports.glStartTilingQCOM(x, y, width, height, preserveMask);
do {
} while (false);
mEncoder->Uint16(25); // Type ID -- TODO: mEncoder->Id(GL_START_TILING_Q_C_O_M_ID);
encodeObservations();
mEncoder->Int32(x);
mEncoder->Int32(y);
mEncoder->Int32(width);
mEncoder->Int32(height);
mEncoder->Uint32(static_cast<uint32_t>(preserveMask));
}
inline void GlesSpy::glEndTilingQCOM(uint32_t preserve_mask) {
GAPID_INFO("glEndTilingQCOM()\n");
mImports.glEndTilingQCOM(preserve_mask);
do {
} while (false);
mEncoder->Uint16(26); // Type ID -- TODO: mEncoder->Id(GL_END_TILING_Q_C_O_M_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(preserve_mask));
}
inline void GlesSpy::glDiscardFramebufferEXT(uint32_t target, int32_t numAttachments,
uint32_t* attachments) {
GAPID_INFO("glDiscardFramebufferEXT()\n");
mImports.glDiscardFramebufferEXT(target, numAttachments, attachments);
do {
} while (false);
mEncoder->Uint16(27); // Type ID -- TODO: mEncoder->Id(GL_DISCARD_FRAMEBUFFER_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(numAttachments);
mEncoder->Uint64(reinterpret_cast<uint64_t>(attachments));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glInsertEventMarkerEXT(int32_t length, char* marker) {
GAPID_INFO("glInsertEventMarkerEXT()\n");
mImports.glInsertEventMarkerEXT(length, marker);
do {
} while (false);
mEncoder->Uint16(28); // Type ID -- TODO: mEncoder->Id(GL_INSERT_EVENT_MARKER_E_X_T_ID);
encodeObservations();
mEncoder->Int32(length);
mEncoder->String(marker);
}
inline void GlesSpy::glPushGroupMarkerEXT(int32_t length, char* marker) {
GAPID_INFO("glPushGroupMarkerEXT()\n");
mImports.glPushGroupMarkerEXT(length, marker);
do {
} while (false);
mEncoder->Uint16(29); // Type ID -- TODO: mEncoder->Id(GL_PUSH_GROUP_MARKER_E_X_T_ID);
encodeObservations();
mEncoder->Int32(length);
mEncoder->String(marker);
}
inline void GlesSpy::glPopGroupMarkerEXT() {
GAPID_INFO("glPopGroupMarkerEXT()\n");
mImports.glPopGroupMarkerEXT();
do {
} while (false);
mEncoder->Uint16(30); // Type ID -- TODO: mEncoder->Id(GL_POP_GROUP_MARKER_E_X_T_ID);
encodeObservations();
}
inline void GlesSpy::glTexStorage1DEXT(uint32_t target, int32_t levels, uint32_t format,
int32_t width) {
GAPID_INFO("glTexStorage1DEXT()\n");
mImports.glTexStorage1DEXT(target, levels, format, width);
do {
} while (false);
mEncoder->Uint16(31); // Type ID -- TODO: mEncoder->Id(GL_TEX_STORAGE1D_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(levels);
mEncoder->Uint32(static_cast<uint32_t>(format));
mEncoder->Int32(width);
}
inline void GlesSpy::glTexStorage2DEXT(uint32_t target, int32_t levels, uint32_t format,
int32_t width, int32_t height) {
GAPID_INFO("glTexStorage2DEXT()\n");
mImports.glTexStorage2DEXT(target, levels, format, width, height);
do {
} while (false);
mEncoder->Uint16(32); // Type ID -- TODO: mEncoder->Id(GL_TEX_STORAGE2D_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(levels);
mEncoder->Uint32(static_cast<uint32_t>(format));
mEncoder->Int32(width);
mEncoder->Int32(height);
}
inline void GlesSpy::glTexStorage3DEXT(uint32_t target, int32_t levels, uint32_t format,
int32_t width, int32_t height, int32_t depth) {
GAPID_INFO("glTexStorage3DEXT()\n");
mImports.glTexStorage3DEXT(target, levels, format, width, height, depth);
do {
} while (false);
mEncoder->Uint16(33); // Type ID -- TODO: mEncoder->Id(GL_TEX_STORAGE3D_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(levels);
mEncoder->Uint32(static_cast<uint32_t>(format));
mEncoder->Int32(width);
mEncoder->Int32(height);
mEncoder->Int32(depth);
}
inline void GlesSpy::glTextureStorage1DEXT(uint32_t texture, uint32_t target, int32_t levels,
uint32_t format, int32_t width) {
GAPID_INFO("glTextureStorage1DEXT()\n");
mImports.glTextureStorage1DEXT(texture, target, levels, format, width);
do {
} while (false);
mEncoder->Uint16(34); // Type ID -- TODO: mEncoder->Id(GL_TEXTURE_STORAGE1D_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(texture);
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(levels);
mEncoder->Uint32(static_cast<uint32_t>(format));
mEncoder->Int32(width);
}
inline void GlesSpy::glTextureStorage2DEXT(uint32_t texture, uint32_t target, int32_t levels,
uint32_t format, int32_t width, int32_t height) {
GAPID_INFO("glTextureStorage2DEXT()\n");
mImports.glTextureStorage2DEXT(texture, target, levels, format, width, height);
do {
} while (false);
mEncoder->Uint16(35); // Type ID -- TODO: mEncoder->Id(GL_TEXTURE_STORAGE2D_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(texture);
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(levels);
mEncoder->Uint32(static_cast<uint32_t>(format));
mEncoder->Int32(width);
mEncoder->Int32(height);
}
inline void GlesSpy::glTextureStorage3DEXT(uint32_t texture, uint32_t target, int32_t levels,
uint32_t format, int32_t width, int32_t height,
int32_t depth) {
GAPID_INFO("glTextureStorage3DEXT()\n");
mImports.glTextureStorage3DEXT(texture, target, levels, format, width, height, depth);
do {
} while (false);
mEncoder->Uint16(36); // Type ID -- TODO: mEncoder->Id(GL_TEXTURE_STORAGE3D_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(texture);
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Int32(levels);
mEncoder->Uint32(static_cast<uint32_t>(format));
mEncoder->Int32(width);
mEncoder->Int32(height);
mEncoder->Int32(depth);
}
inline void GlesSpy::glGenVertexArraysOES(int32_t count, uint32_t* arrays) {
GAPID_INFO("glGenVertexArraysOES()\n");
mImports.glGenVertexArraysOES(count, arrays);
do {
Slice<VertexArrayId> l_a = slice(arrays, (uint64_t)(0), (uint64_t)(count));
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_13_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_13_result;
for (int32_t l_i = 0; l_i < count; ++l_i) {
VertexArrayId l_id = (VertexArrayId)(
read(slice(arrays, (uint64_t)(0), (uint64_t)(count)), (uint64_t)(l_i)));
l_ctx->mInstances.mVertexArrays[l_id] =
std::shared_ptr<VertexArray>((new VertexArray()));
write(l_a, (uint64_t)(l_i), l_id);
}
} while (false);
mEncoder->Uint16(37); // Type ID -- TODO: mEncoder->Id(GL_GEN_VERTEX_ARRAYS_O_E_S_ID);
encodeObservations();
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(arrays));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glBindVertexArrayOES(uint32_t array) {
GAPID_INFO("glBindVertexArrayOES()\n");
mImports.glBindVertexArrayOES(array);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_14_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_14_result;
if (!(l_ctx->mInstances.mVertexArrays.count(array) > 0)) {
l_ctx->mInstances.mVertexArrays[array] =
std::shared_ptr<VertexArray>((new VertexArray()));
}
l_ctx->mBoundVertexArray = array;
} while (false);
mEncoder->Uint16(38); // Type ID -- TODO: mEncoder->Id(GL_BIND_VERTEX_ARRAY_O_E_S_ID);
encodeObservations();
mEncoder->Uint32(array);
}
inline void GlesSpy::glDeleteVertexArraysOES(int32_t count, uint32_t* arrays) {
GAPID_INFO("glDeleteVertexArraysOES()\n");
mImports.glDeleteVertexArraysOES(count, arrays);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_15_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_15_result;
Slice<VertexArrayId> l_a = slice(arrays, (uint64_t)(0), (uint64_t)(count));
for (int32_t l_i = 0; l_i < count; ++l_i) {
l_ctx->mInstances.mVertexArrays[read(l_a, (uint64_t)(l_i))] =
std::shared_ptr<VertexArray>();
}
} while (false);
mEncoder->Uint16(39); // Type ID -- TODO: mEncoder->Id(GL_DELETE_VERTEX_ARRAYS_O_E_S_ID);
encodeObservations();
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(arrays));
mEncoder->Uint32(0); // PoolID
}
inline bool GlesSpy::glIsVertexArrayOES(uint32_t array) {
GAPID_INFO("glIsVertexArrayOES()\n");
bool result = mImports.glIsVertexArrayOES(array);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_16_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_16_result;
break;
} while (false);
mEncoder->Uint16(40); // Type ID -- TODO: mEncoder->Id(GL_IS_VERTEX_ARRAY_O_E_S_ID);
encodeObservations();
mEncoder->Uint32(array);
mEncoder->Bool(result);
return result;
}
inline void GlesSpy::glEGLImageTargetTexture2DOES(uint32_t target, void* image) {
GAPID_INFO("glEGLImageTargetTexture2DOES()\n");
mImports.glEGLImageTargetTexture2DOES(target, image);
do {
} while (false);
mEncoder->Uint16(
41); // Type ID -- TODO: mEncoder->Id(GL_E_G_L_IMAGE_TARGET_TEXTURE2D_O_E_S_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Uint64(reinterpret_cast<uint64_t>(image));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glEGLImageTargetRenderbufferStorageOES(uint32_t target, void* image) {
GAPID_INFO("glEGLImageTargetRenderbufferStorageOES()\n");
mImports.glEGLImageTargetRenderbufferStorageOES(target, image);
do {
} while (false);
mEncoder->Uint16(42); // Type ID -- TODO:
// mEncoder->Id(GL_E_G_L_IMAGE_TARGET_RENDERBUFFER_STORAGE_O_E_S_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Uint64(reinterpret_cast<uint64_t>(image));
mEncoder->Uint32(0); // PoolID
}
inline uint32_t GlesSpy::glGetGraphicsResetStatusEXT() {
GAPID_INFO("glGetGraphicsResetStatusEXT()\n");
uint32_t result = mImports.glGetGraphicsResetStatusEXT();
do {
break;
} while (false);
mEncoder->Uint16(43); // Type ID -- TODO: mEncoder->Id(GL_GET_GRAPHICS_RESET_STATUS_E_X_T_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(result));
return result;
}
inline void GlesSpy::glBindAttribLocation(uint32_t program, uint32_t location, char* name) {
GAPID_INFO("glBindAttribLocation()\n");
mImports.glBindAttribLocation(program, location, name);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_17_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_17_result;
std::shared_ptr<Program> l_p = l_ctx->mInstances.mPrograms[program];
l_p->mAttributeBindings[name] = location;
} while (false);
mEncoder->Uint16(44); // Type ID -- TODO: mEncoder->Id(GL_BIND_ATTRIB_LOCATION_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->Uint32(location);
mEncoder->String(name);
}
inline void GlesSpy::glBlendFunc(uint32_t src_factor, uint32_t dst_factor) {
GAPID_INFO("glBlendFunc()\n");
mImports.glBlendFunc(src_factor, dst_factor);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_18_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_18_result;
l_ctx->mBlending.mSrcRgbBlendFactor = src_factor;
l_ctx->mBlending.mSrcAlphaBlendFactor = src_factor;
l_ctx->mBlending.mDstRgbBlendFactor = dst_factor;
l_ctx->mBlending.mDstAlphaBlendFactor = dst_factor;
} while (false);
mEncoder->Uint16(45); // Type ID -- TODO: mEncoder->Id(GL_BLEND_FUNC_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(src_factor));
mEncoder->Uint32(static_cast<uint32_t>(dst_factor));
}
inline void GlesSpy::glBlendFuncSeparate(uint32_t src_factor_rgb, uint32_t dst_factor_rgb,
uint32_t src_factor_alpha, uint32_t dst_factor_alpha) {
GAPID_INFO("glBlendFuncSeparate()\n");
mImports.glBlendFuncSeparate(src_factor_rgb, dst_factor_rgb, src_factor_alpha,
dst_factor_alpha);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_19_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_19_result;
l_ctx->mBlending.mSrcRgbBlendFactor = src_factor_rgb;
l_ctx->mBlending.mDstRgbBlendFactor = dst_factor_rgb;
l_ctx->mBlending.mSrcAlphaBlendFactor = src_factor_alpha;
l_ctx->mBlending.mDstAlphaBlendFactor = dst_factor_alpha;
} while (false);
mEncoder->Uint16(46); // Type ID -- TODO: mEncoder->Id(GL_BLEND_FUNC_SEPARATE_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(src_factor_rgb));
mEncoder->Uint32(static_cast<uint32_t>(dst_factor_rgb));
mEncoder->Uint32(static_cast<uint32_t>(src_factor_alpha));
mEncoder->Uint32(static_cast<uint32_t>(dst_factor_alpha));
}
inline void GlesSpy::glBlendEquation(uint32_t equation) {
GAPID_INFO("glBlendEquation()\n");
mImports.glBlendEquation(equation);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_20_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_20_result;
l_ctx->mBlending.mBlendEquationRgb = equation;
l_ctx->mBlending.mBlendEquationAlpha = equation;
} while (false);
mEncoder->Uint16(47); // Type ID -- TODO: mEncoder->Id(GL_BLEND_EQUATION_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(equation));
}
inline void GlesSpy::glBlendEquationSeparate(uint32_t rgb, uint32_t alpha) {
GAPID_INFO("glBlendEquationSeparate()\n");
mImports.glBlendEquationSeparate(rgb, alpha);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_21_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_21_result;
l_ctx->mBlending.mBlendEquationRgb = rgb;
l_ctx->mBlending.mBlendEquationAlpha = alpha;
} while (false);
mEncoder->Uint16(48); // Type ID -- TODO: mEncoder->Id(GL_BLEND_EQUATION_SEPARATE_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(rgb));
mEncoder->Uint32(static_cast<uint32_t>(alpha));
}
inline void GlesSpy::glBlendColor(float red, float green, float blue, float alpha) {
GAPID_INFO("glBlendColor()\n");
mImports.glBlendColor(red, green, blue, alpha);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_22_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_22_result;
l_ctx->mBlending.mBlendColor =
Color().SetRed(red).SetGreen(green).SetBlue(blue).SetAlpha(alpha);
} while (false);
mEncoder->Uint16(49); // Type ID -- TODO: mEncoder->Id(GL_BLEND_COLOR_ID);
encodeObservations();
mEncoder->Float32(red);
mEncoder->Float32(green);
mEncoder->Float32(blue);
mEncoder->Float32(alpha);
}
inline void GlesSpy::glEnableVertexAttribArray(uint32_t location) {
GAPID_INFO("glEnableVertexAttribArray()\n");
mImports.glEnableVertexAttribArray(location);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_23_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_23_result;
l_ctx->mVertexAttributeArrays[location]->mEnabled = true;
} while (false);
mEncoder->Uint16(50); // Type ID -- TODO: mEncoder->Id(GL_ENABLE_VERTEX_ATTRIB_ARRAY_ID);
encodeObservations();
mEncoder->Uint32(location);
}
inline void GlesSpy::glDisableVertexAttribArray(uint32_t location) {
GAPID_INFO("glDisableVertexAttribArray()\n");
mImports.glDisableVertexAttribArray(location);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_24_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_24_result;
l_ctx->mVertexAttributeArrays[location]->mEnabled = false;
} while (false);
mEncoder->Uint16(51); // Type ID -- TODO: mEncoder->Id(GL_DISABLE_VERTEX_ATTRIB_ARRAY_ID);
encodeObservations();
mEncoder->Uint32(location);
}
inline void GlesSpy::glVertexAttribPointer(uint32_t location, int32_t size, uint32_t type,
bool normalized, int32_t stride, void* data) {
GAPID_INFO("glVertexAttribPointer()\n");
mImports.glVertexAttribPointer(location, size, type, normalized, stride, data);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_25_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_25_result;
std::shared_ptr<VertexAttributeArray> l_a = l_ctx->mVertexAttributeArrays[location];
l_a->mSize = (uint32_t)(size);
l_a->mType = type;
l_a->mNormalized = normalized;
l_a->mStride = stride;
l_a->mPointer = data;
l_a->mBuffer = l_ctx->mBoundBuffers[BufferTarget::GL_ARRAY_BUFFER];
} while (false);
mEncoder->Uint16(52); // Type ID -- TODO: mEncoder->Id(GL_VERTEX_ATTRIB_POINTER_ID);
encodeObservations();
mEncoder->Uint32(location);
mEncoder->Int32(size);
mEncoder->Uint32(static_cast<uint32_t>(type));
mEncoder->Bool(normalized);
mEncoder->Int32(stride);
mEncoder->Uint64(reinterpret_cast<uint64_t>(data));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glGetActiveAttrib(uint32_t program, uint32_t location, int32_t buffer_size,
int32_t* buffer_bytes_written, int32_t* vector_count,
uint32_t* type, char* name) {
GAPID_INFO("glGetActiveAttrib()\n");
mImports.glGetActiveAttrib(program, location, buffer_size, buffer_bytes_written, vector_count,
type, name);
do {
} while (false);
mEncoder->Uint16(53); // Type ID -- TODO: mEncoder->Id(GL_GET_ACTIVE_ATTRIB_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->Uint32(location);
mEncoder->Int32(buffer_size);
mEncoder->Uint64(reinterpret_cast<uint64_t>(buffer_bytes_written));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(vector_count));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(type));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(name));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glGetActiveUniform(uint32_t program, int32_t location, int32_t buffer_size,
int32_t* buffer_bytes_written, int32_t* size,
uint32_t* type, char* name) {
GAPID_INFO("glGetActiveUniform()\n");
mImports.glGetActiveUniform(program, location, buffer_size, buffer_bytes_written, size, type,
name);
do {
} while (false);
mEncoder->Uint16(54); // Type ID -- TODO: mEncoder->Id(GL_GET_ACTIVE_UNIFORM_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->Int32(location);
mEncoder->Int32(buffer_size);
mEncoder->Uint64(reinterpret_cast<uint64_t>(buffer_bytes_written));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(size));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(type));
mEncoder->Uint32(0); // PoolID
mEncoder->Uint64(reinterpret_cast<uint64_t>(name));
mEncoder->Uint32(0); // PoolID
}
inline uint32_t GlesSpy::glGetError() {
GAPID_INFO("glGetError()\n");
uint32_t result = mImports.glGetError();
do {
break;
} while (false);
mEncoder->Uint16(55); // Type ID -- TODO: mEncoder->Id(GL_GET_ERROR_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(result));
return result;
}
inline void GlesSpy::glGetProgramiv(uint32_t program, uint32_t parameter, int32_t* value) {
GAPID_INFO("glGetProgramiv()\n");
mImports.glGetProgramiv(program, parameter, value);
do {
write(slice(value, 0, 1), 0, read(slice(value, 0, 1), 0));
} while (false);
mEncoder->Uint16(56); // Type ID -- TODO: mEncoder->Id(GL_GET_PROGRAMIV_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glGetShaderiv(uint32_t shader, uint32_t parameter, int32_t* value) {
GAPID_INFO("glGetShaderiv()\n");
mImports.glGetShaderiv(shader, parameter, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_26_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_26_result;
std::shared_ptr<Shader> l_s = l_ctx->mInstances.mShaders[shader];
write(slice(value, 0, 1), 0, /* clang-format off */
/* switch(parameter) */
/* case ShaderParameter::GL_SHADER_TYPE: */(((parameter) == (ShaderParameter::GL_SHADER_TYPE))) ? ((int32_t)(l_s->mType)) :
/* case ShaderParameter::GL_DELETE_STATUS: */(((parameter) == (ShaderParameter::GL_DELETE_STATUS))) ? (/* clang-format off */
/* switch(l_s->mDeletable) */
/* case true: */(((l_s->mDeletable) == (true))) ? (1) :
/* case false: */(((l_s->mDeletable) == (false))) ? (0) :
/* default: */ 0 /* clang-format on */)
:
/* case ShaderParameter::GL_COMPILE_STATUS: */ (
((parameter) == (ShaderParameter::GL_COMPILE_STATUS)))
? (/* clang-format off */
/* switch(l_s->mCompiled) */
/* case true: */(((l_s->mCompiled) == (true))) ? (1) :
/* case false: */(((l_s->mCompiled) == (false))) ? (0) :
/* default: */ 0 /* clang-format on */)
:
/* case ShaderParameter::GL_INFO_LOG_LENGTH: */ ((
(parameter) == (ShaderParameter::GL_INFO_LOG_LENGTH)))
? ((int32_t)(strlen(l_s->mInfoLog)))
:
/* case ShaderParameter::GL_SHADER_SOURCE_LENGTH: */ (
((parameter) ==
(ShaderParameter::GL_SHADER_SOURCE_LENGTH)))
? ((int32_t)(strlen(l_s->mSource)))
:
/* default: */ 0 /* clang-format on */);
} while (false);
mEncoder->Uint16(57); // Type ID -- TODO: mEncoder->Id(GL_GET_SHADERIV_ID);
encodeObservations();
mEncoder->Uint32(shader);
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline int32_t GlesSpy::glGetUniformLocation(uint32_t program, char* name) {
GAPID_INFO("glGetUniformLocation()\n");
int32_t result = mImports.glGetUniformLocation(program, name);
do {
break;
} while (false);
mEncoder->Uint16(58); // Type ID -- TODO: mEncoder->Id(GL_GET_UNIFORM_LOCATION_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->String(name);
mEncoder->Int32(result);
return result;
}
inline uint32_t GlesSpy::glGetAttribLocation(uint32_t program, char* name) {
GAPID_INFO("glGetAttribLocation()\n");
uint32_t result = mImports.glGetAttribLocation(program, name);
do {
break;
} while (false);
mEncoder->Uint16(59); // Type ID -- TODO: mEncoder->Id(GL_GET_ATTRIB_LOCATION_ID);
encodeObservations();
mEncoder->Uint32(program);
mEncoder->String(name);
mEncoder->Uint32(result);
return result;
}
inline void GlesSpy::glPixelStorei(uint32_t parameter, int32_t value) {
GAPID_INFO("glPixelStorei()\n");
mImports.glPixelStorei(parameter, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_27_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_27_result;
l_ctx->mPixelStorage[parameter] = value;
} while (false);
mEncoder->Uint16(60); // Type ID -- TODO: mEncoder->Id(GL_PIXEL_STOREI_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Int32(value);
}
inline void GlesSpy::glTexParameteri(uint32_t target, uint32_t parameter, int32_t value) {
GAPID_INFO("glTexParameteri()\n");
mImports.glTexParameteri(target, parameter, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_28_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_28_result;
TextureId l_id = l_ctx->mTextureUnits[l_ctx->mActiveTextureUnit][target];
std::shared_ptr<Texture> l_t = l_ctx->mInstances.mTextures[l_id];
switch (parameter) {
case TextureParameter::GL_TEXTURE_MAG_FILTER: {
l_t->mMagFilter = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_MIN_FILTER: {
l_t->mMinFilter = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_WRAP_S: {
l_t->mWrapS = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_WRAP_T: {
l_t->mWrapT = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_MAX_ANISOTROPY_EXT: {
l_t->mMaxAnisotropy = (float)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_R: {
l_t->mSwizzleR = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_G: {
l_t->mSwizzleG = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_B: {
l_t->mSwizzleB = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_A: {
l_t->mSwizzleA = (uint32_t)(value);
break;
}
}
} while (false);
mEncoder->Uint16(61); // Type ID -- TODO: mEncoder->Id(GL_TEX_PARAMETERI_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Int32(value);
}
inline void GlesSpy::glTexParameterf(uint32_t target, uint32_t parameter, float value) {
GAPID_INFO("glTexParameterf()\n");
mImports.glTexParameterf(target, parameter, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_29_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_29_result;
TextureId l_id = l_ctx->mTextureUnits[l_ctx->mActiveTextureUnit][target];
std::shared_ptr<Texture> l_t = l_ctx->mInstances.mTextures[l_id];
switch (parameter) {
case TextureParameter::GL_TEXTURE_MAG_FILTER: {
l_t->mMagFilter = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_MIN_FILTER: {
l_t->mMinFilter = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_WRAP_S: {
l_t->mWrapS = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_WRAP_T: {
l_t->mWrapT = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_MAX_ANISOTROPY_EXT: {
l_t->mMaxAnisotropy = value;
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_R: {
l_t->mSwizzleR = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_G: {
l_t->mSwizzleG = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_B: {
l_t->mSwizzleB = (uint32_t)(value);
break;
}
case TextureParameter::GL_TEXTURE_SWIZZLE_A: {
l_t->mSwizzleA = (uint32_t)(value);
break;
}
}
} while (false);
mEncoder->Uint16(62); // Type ID -- TODO: mEncoder->Id(GL_TEX_PARAMETERF_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Float32(value);
}
inline void GlesSpy::glGetTexParameteriv(uint32_t target, uint32_t parameter, int32_t* values) {
GAPID_INFO("glGetTexParameteriv()\n");
mImports.glGetTexParameteriv(target, parameter, values);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_30_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_30_result;
TextureId l_id = l_ctx->mTextureUnits[l_ctx->mActiveTextureUnit][target];
std::shared_ptr<Texture> l_t = l_ctx->mInstances.mTextures[l_id];
write(slice(values, 0, 1), 0, /* clang-format off */
/* switch(parameter) */
/* case TextureParameter::GL_TEXTURE_MAG_FILTER: */(((parameter) == (TextureParameter::GL_TEXTURE_MAG_FILTER))) ? ((int32_t)(l_t->mMagFilter)) :
/* case TextureParameter::GL_TEXTURE_MIN_FILTER: */(((parameter) == (TextureParameter::GL_TEXTURE_MIN_FILTER))) ? ((int32_t)(l_t->mMinFilter)) :
/* case TextureParameter::GL_TEXTURE_WRAP_S: */(((parameter) == (TextureParameter::GL_TEXTURE_WRAP_S))) ? ((int32_t)(l_t->mWrapS)) :
/* case TextureParameter::GL_TEXTURE_WRAP_T: */(((parameter) == (TextureParameter::GL_TEXTURE_WRAP_T))) ? ((int32_t)(l_t->mWrapT)) :
/* case TextureParameter::GL_TEXTURE_MAX_ANISOTROPY_EXT: */(((parameter) == (TextureParameter::GL_TEXTURE_MAX_ANISOTROPY_EXT))) ? ((int32_t)(l_t->mMaxAnisotropy)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_R: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_R))) ? ((int32_t)(l_t->mSwizzleR)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_G: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_G))) ? ((int32_t)(l_t->mSwizzleG)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_B: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_B))) ? ((int32_t)(l_t->mSwizzleB)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_A: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_A))) ? ((int32_t)(l_t->mSwizzleA)) :
/* default: */ 0 /* clang-format on */);
} while (false);
mEncoder->Uint16(63); // Type ID -- TODO: mEncoder->Id(GL_GET_TEX_PARAMETERIV_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Uint64(reinterpret_cast<uint64_t>(values));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glGetTexParameterfv(uint32_t target, uint32_t parameter, float* values) {
GAPID_INFO("glGetTexParameterfv()\n");
mImports.glGetTexParameterfv(target, parameter, values);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_31_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_31_result;
TextureId l_id = l_ctx->mTextureUnits[l_ctx->mActiveTextureUnit][target];
std::shared_ptr<Texture> l_t = l_ctx->mInstances.mTextures[l_id];
write(slice(values, 0, 1), 0, /* clang-format off */
/* switch(parameter) */
/* case TextureParameter::GL_TEXTURE_MAG_FILTER: */(((parameter) == (TextureParameter::GL_TEXTURE_MAG_FILTER))) ? ((float)(l_t->mMagFilter)) :
/* case TextureParameter::GL_TEXTURE_MIN_FILTER: */(((parameter) == (TextureParameter::GL_TEXTURE_MIN_FILTER))) ? ((float)(l_t->mMinFilter)) :
/* case TextureParameter::GL_TEXTURE_WRAP_S: */(((parameter) == (TextureParameter::GL_TEXTURE_WRAP_S))) ? ((float)(l_t->mWrapS)) :
/* case TextureParameter::GL_TEXTURE_WRAP_T: */(((parameter) == (TextureParameter::GL_TEXTURE_WRAP_T))) ? ((float)(l_t->mWrapT)) :
/* case TextureParameter::GL_TEXTURE_MAX_ANISOTROPY_EXT: */(((parameter) == (TextureParameter::GL_TEXTURE_MAX_ANISOTROPY_EXT))) ? (l_t->mMaxAnisotropy) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_R: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_R))) ? ((float)(l_t->mSwizzleR)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_G: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_G))) ? ((float)(l_t->mSwizzleG)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_B: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_B))) ? ((float)(l_t->mSwizzleB)) :
/* case TextureParameter::GL_TEXTURE_SWIZZLE_A: */(((parameter) == (TextureParameter::GL_TEXTURE_SWIZZLE_A))) ? ((float)(l_t->mSwizzleA)) :
/* default: */ 0 /* clang-format on */);
} while (false);
mEncoder->Uint16(64); // Type ID -- TODO: mEncoder->Id(GL_GET_TEX_PARAMETERFV_ID);
encodeObservations();
mEncoder->Uint32(static_cast<uint32_t>(target));
mEncoder->Uint32(static_cast<uint32_t>(parameter));
mEncoder->Uint64(reinterpret_cast<uint64_t>(values));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform1i(int32_t location, int32_t value) {
GAPID_INFO("glUniform1i()\n");
mImports.glUniform1i(location, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_32_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_32_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT;
l_uniform.mValue.mS32 = value;
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(65); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM1I_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(value);
}
inline void GlesSpy::glUniform2i(int32_t location, int32_t value0, int32_t value1) {
GAPID_INFO("glUniform2i()\n");
mImports.glUniform2i(location, value0, value1);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_33_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_33_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT_VEC2;
l_uniform.mValue.mVec2i = Vec2i().SetX(value0).SetY(value1);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(66); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM2I_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(value0);
mEncoder->Int32(value1);
}
inline void GlesSpy::glUniform3i(int32_t location, int32_t value0, int32_t value1, int32_t value2) {
GAPID_INFO("glUniform3i()\n");
mImports.glUniform3i(location, value0, value1, value2);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_34_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_34_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT_VEC3;
l_uniform.mValue.mVec3i = Vec3i().SetX(value0).SetY(value1).SetZ(value2);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(67); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM3I_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(value0);
mEncoder->Int32(value1);
mEncoder->Int32(value2);
}
inline void GlesSpy::glUniform4i(int32_t location, int32_t value0, int32_t value1, int32_t value2,
int32_t value3) {
GAPID_INFO("glUniform4i()\n");
mImports.glUniform4i(location, value0, value1, value2, value3);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_35_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_35_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT_VEC4;
l_uniform.mValue.mVec4i = Vec4i().SetX(value0).SetY(value1).SetZ(value2).SetW(value3);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(68); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM4I_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(value0);
mEncoder->Int32(value1);
mEncoder->Int32(value2);
mEncoder->Int32(value3);
}
inline void GlesSpy::glUniform1iv(int32_t location, int32_t count, int32_t* value) {
GAPID_INFO("glUniform1iv()\n");
mImports.glUniform1iv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_36_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_36_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT;
l_uniform.mValue.mS32 = read(slice(value, 0, 1), 0);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(69); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM1IV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform2iv(int32_t location, int32_t count, int32_t* value) {
GAPID_INFO("glUniform2iv()\n");
mImports.glUniform2iv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_37_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_37_result;
Slice<int32_t> l_v = slice(value, (uint64_t)(0), (uint64_t)(count * 2));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT_VEC2;
l_uniform.mValue.mVec2i = Vec2i().SetX(read(l_v, 0)).SetY(read(l_v, 1));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(70); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM2IV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform3iv(int32_t location, int32_t count, int32_t* value) {
GAPID_INFO("glUniform3iv()\n");
mImports.glUniform3iv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_38_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_38_result;
Slice<int32_t> l_v = slice(value, (uint64_t)(0), (uint64_t)(count * 3));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT_VEC3;
l_uniform.mValue.mVec3i = Vec3i().SetX(read(l_v, 0)).SetY(read(l_v, 1)).SetZ(read(l_v, 2));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(71); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM3IV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform4iv(int32_t location, int32_t count, int32_t* value) {
GAPID_INFO("glUniform4iv()\n");
mImports.glUniform4iv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_39_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_39_result;
Slice<int32_t> l_v = slice(value, (uint64_t)(0), (uint64_t)(count * 4));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_INT_VEC4;
l_uniform.mValue.mVec4i =
Vec4i().SetX(read(l_v, 0)).SetY(read(l_v, 1)).SetZ(read(l_v, 2)).SetW(read(l_v, 3));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(72); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM4IV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform1f(int32_t location, float value) {
GAPID_INFO("glUniform1f()\n");
mImports.glUniform1f(location, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_40_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_40_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT;
l_uniform.mValue.mF32 = value;
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(73); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM1F_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Float32(value);
}
inline void GlesSpy::glUniform2f(int32_t location, float value0, float value1) {
GAPID_INFO("glUniform2f()\n");
mImports.glUniform2f(location, value0, value1);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_41_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_41_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_VEC2;
l_uniform.mValue.mVec2f = Vec2f().SetX(value0).SetY(value1);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(74); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM2F_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Float32(value0);
mEncoder->Float32(value1);
}
inline void GlesSpy::glUniform3f(int32_t location, float value0, float value1, float value2) {
GAPID_INFO("glUniform3f()\n");
mImports.glUniform3f(location, value0, value1, value2);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_42_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_42_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_VEC3;
l_uniform.mValue.mVec3f = Vec3f().SetX(value0).SetY(value1).SetZ(value2);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(75); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM3F_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Float32(value0);
mEncoder->Float32(value1);
mEncoder->Float32(value2);
}
inline void GlesSpy::glUniform4f(int32_t location, float value0, float value1, float value2,
float value3) {
GAPID_INFO("glUniform4f()\n");
mImports.glUniform4f(location, value0, value1, value2, value3);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_43_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_43_result;
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_VEC4;
l_uniform.mValue.mVec4f = Vec4f().SetX(value0).SetY(value1).SetZ(value2).SetW(value3);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(76); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM4F_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Float32(value0);
mEncoder->Float32(value1);
mEncoder->Float32(value2);
mEncoder->Float32(value3);
}
inline void GlesSpy::glUniform1fv(int32_t location, int32_t count, float* value) {
GAPID_INFO("glUniform1fv()\n");
mImports.glUniform1fv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_44_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_44_result;
Slice<float> l_v = slice(value, (uint64_t)(0), (uint64_t)(count));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT;
l_uniform.mValue.mF32 = read(l_v, 0);
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(77); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM1FV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform2fv(int32_t location, int32_t count, float* value) {
GAPID_INFO("glUniform2fv()\n");
mImports.glUniform2fv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_45_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_45_result;
Slice<float> l_v = slice(value, (uint64_t)(0), (uint64_t)(count * 2));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_VEC2;
l_uniform.mValue.mVec2f = Vec2f().SetX(read(l_v, 0)).SetY(read(l_v, 1));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(78); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM2FV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform3fv(int32_t location, int32_t count, float* value) {
GAPID_INFO("glUniform3fv()\n");
mImports.glUniform3fv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_46_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_46_result;
Slice<float> l_v = slice(value, (uint64_t)(0), (uint64_t)(count * 3));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_VEC3;
l_uniform.mValue.mVec3f = Vec3f().SetX(read(l_v, 0)).SetY(read(l_v, 1)).SetZ(read(l_v, 2));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(79); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM3FV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniform4fv(int32_t location, int32_t count, float* value) {
GAPID_INFO("glUniform4fv()\n");
mImports.glUniform4fv(location, count, value);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_47_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_47_result;
Slice<float> l_v = slice(value, (uint64_t)(0), (uint64_t)(count * 4));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_VEC4;
l_uniform.mValue.mVec4f =
Vec4f().SetX(read(l_v, 0)).SetY(read(l_v, 1)).SetZ(read(l_v, 2)).SetW(read(l_v, 3));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(80); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM4FV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Uint64(reinterpret_cast<uint64_t>(value));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniformMatrix2fv(int32_t location, int32_t count, bool transpose,
float* values) {
GAPID_INFO("glUniformMatrix2fv()\n");
mImports.glUniformMatrix2fv(location, count, transpose, values);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_48_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_48_result;
Slice<float> l_v = slice(values, (uint64_t)(0), (uint64_t)(count * 4));
std::shared_ptr<Program> l_program = l_ctx->mInstances.mPrograms[l_ctx->mBoundProgram];
Uniform l_uniform = l_program->mUniforms[location];
l_uniform.mType = ShaderUniformType::GL_FLOAT_MAT2;
l_uniform.mValue.mMat2f = Mat2f()
.SetCol0(Vec2f().SetX(read(l_v, 0)).SetY(read(l_v, 1)))
.SetCol1(Vec2f().SetX(read(l_v, 3)).SetY(read(l_v, 4)));
l_program->mUniforms[location] = l_uniform;
} while (false);
mEncoder->Uint16(81); // Type ID -- TODO: mEncoder->Id(GL_UNIFORM_MATRIX2FV_ID);
encodeObservations();
mEncoder->Int32(location);
mEncoder->Int32(count);
mEncoder->Bool(transpose);
mEncoder->Uint64(reinterpret_cast<uint64_t>(values));
mEncoder->Uint32(0); // PoolID
}
inline void GlesSpy::glUniformMatrix3fv(int32_t location, int32_t count, bool transpose,
float* values) {
GAPID_INFO("glUniformMatrix3fv()\n");
mImports.glUniformMatrix3fv(location, count, transpose, values);
do {
std::shared_ptr<Context> l_context = this->Contexts[this->CurrentThread];
std::shared_ptr<Context> l_GetContext_49_result = l_context;
std::shared_ptr<Context> l_ctx = l_GetContext_49_result;
Slice<float> l_v = slice(