blob: 94a83f3b266fa85ebd090d46bb0750ada3ecfc6f [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.
*/
#include "abort_exception.h"
#include "gles_imports.h"
#include "gles_types.h"
#include "gles_spy.h"
#include <gapic/log.h>
#include <gapic/coder/memory.h>
#include <gapic/coder/atom.h>
#include <gapic/coder/gles.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdint.h>
#include <memory>
#include <string>
namespace gapii {
void GlesSpy::glBlendEquationSeparateiEXT(CallObserver* observer, DrawBufferIndex buf, uint32_t modeRGB, uint32_t modeAlpha) {
GAPID_DEBUG("glBlendEquationSeparateiEXT(%" PRIu32 ", %u, %u)", buf, modeRGB, modeAlpha);
if (mImports.glBlendEquationSeparateiEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendEquationSeparateiEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, buf, modeRGB, modeAlpha] {
called = true;
observer->observeReads();
mImports.glBlendEquationSeparateiEXT(buf, modeRGB, modeAlpha);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_buffers_indexed);
subBlendEquationSeparatei(observer, call, buf, modeRGB, modeAlpha);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlendEquationSeparateiEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buf, *observer->getScratch()), modeRGB, modeAlpha);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBlendFuncSeparateiEXT(CallObserver* observer, DrawBufferIndex buf, uint32_t srcRGB, uint32_t dstRGB, uint32_t srcAlpha, uint32_t dstAlpha) {
GAPID_DEBUG("glBlendFuncSeparateiEXT(%" PRIu32 ", %u, %u, %u, %u)", buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
if (mImports.glBlendFuncSeparateiEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendFuncSeparateiEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, buf, srcRGB, dstRGB, srcAlpha, dstAlpha] {
called = true;
observer->observeReads();
mImports.glBlendFuncSeparateiEXT(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_buffers_indexed);
subBlendFuncSeparatei(observer, call, buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlendFuncSeparateiEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buf, *observer->getScratch()), srcRGB, dstRGB, srcAlpha, dstAlpha);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glDebugMessageInsertKHR(CallObserver* observer, uint32_t source, uint32_t type, GLuint id, uint32_t severity, GLsizei length, GLchar* message) {
GAPID_DEBUG("glDebugMessageInsertKHR(%u, %u, %" PRIu32 ", %u, %" PRId32 ", %p)", source, type, id, severity, length, message);
if (mImports.glDebugMessageInsertKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glDebugMessageInsertKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, source, type, id, severity, length, message] {
called = true;
observer->observeReads();
mImports.glDebugMessageInsertKHR(source, type, id, severity, length, message);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
subDebugMessageInsert(observer, call, source, type, id, severity, length, message);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDebugMessageInsertKHR coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), source, type, toEncoder< uint32_t >(id, *observer->getScratch()), severity, toEncoder< int32_t >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__CP >(message, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glDisableiEXT(CallObserver* observer, uint32_t target, GLuint index) {
GAPID_DEBUG("glDisableiEXT(%u, %" PRIu32 ")", target, index);
if (mImports.glDisableiEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glDisableiEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, index] {
called = true;
observer->observeReads();
mImports.glDisableiEXT(target, index);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_buffers_indexed);
subDisablei(observer, call, target, index);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDisableiEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetObjectPtrLabelKHR(CallObserver* observer, void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label) {
GAPID_DEBUG("glGetObjectPtrLabelKHR(%p, %" PRId32 ", %p, %p)", ptr, bufSize, length, label);
if (mImports.glGetObjectPtrLabelKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glGetObjectPtrLabelKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, ptr, bufSize, length, label] {
called = true;
observer->observeReads();
mImports.glGetObjectPtrLabelKHR(ptr, bufSize, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
call();
subGetObjectPtrLabel(observer, call, ptr, bufSize, length, label);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetObjectPtrLabelKHR coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__CP >(ptr, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(label, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glObjectLabelKHR(CallObserver* observer, uint32_t identifier, GLuint name, GLsizei length, GLchar* label) {
GAPID_DEBUG("glObjectLabelKHR(%u, %" PRIu32 ", %" PRId32 ", %p)", identifier, name, length, label);
if (mImports.glObjectLabelKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glObjectLabelKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, identifier, name, length, label] {
called = true;
observer->observeReads();
mImports.glObjectLabelKHR(identifier, name, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
subObjectLabel(observer, call, identifier, name, length, label);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlObjectLabelKHR coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), identifier, toEncoder< uint32_t >(name, *observer->getScratch()), toEncoder< int32_t >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__CP >(label, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexBufferEXT(CallObserver* observer, uint32_t target, uint32_t internalformat, BufferId buffer) {
GAPID_DEBUG("glTexBufferEXT(%u, %u, %" PRIu32 ")", target, internalformat, buffer);
if (mImports.glTexBufferEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glTexBufferEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, internalformat, buffer] {
called = true;
observer->observeReads();
mImports.glTexBufferEXT(target, internalformat, buffer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_texture_buffer);
subTexBuffer(observer, call, target, internalformat, buffer);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexBufferEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, internalformat, toEncoder< uint32_t >(buffer, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBindBufferRange(CallObserver* observer, uint32_t target, GLuint index, BufferId buffer, GLintptr offset, GLsizeiptr size) {
GAPID_DEBUG("glBindBufferRange(%u, %" PRIu32 ", %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, index, buffer, offset, size);
if (mImports.glBindBufferRange == nullptr) {
GAPID_WARNING("Application called unsupported function glBindBufferRange");
return;
}
bool called = false;
auto call = [this, observer, &called, target, index, buffer, offset, size] {
called = true;
observer->observeReads();
mImports.glBindBufferRange(target, index, buffer, offset, size);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subBindBufferRange(observer, call, target, index, buffer, offset, size);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBindBufferRange coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< uint32_t >(buffer, *observer->getScratch()), toEncoder< int32_t >(offset, *observer->getScratch()), toEncoder< int32_t >(size, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBufferData(CallObserver* observer, uint32_t target, GLsizeiptr size, BufferDataPointer data, uint32_t usage) {
GAPID_DEBUG("glBufferData(%u, %" PRId32 ", %p, %u)", target, size, data, usage);
if (mImports.glBufferData == nullptr) {
GAPID_WARNING("Application called unsupported function glBufferData");
return;
}
bool called = false;
auto call = [this, observer, &called, target, size, data, usage] {
called = true;
observer->observeReads();
mImports.glBufferData(target, size, data, usage);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
std::shared_ptr<Buffer> l_b = subGetBoundBufferOrError(observer, call, target);
switch (usage) {
case GLenum::GL_DYNAMIC_DRAW: // fall-through...
case GLenum::GL_STATIC_DRAW: // fall-through...
case GLenum::GL_STREAM_DRAW: {
break;
}
case GLenum::GL_DYNAMIC_COPY: // fall-through...
case GLenum::GL_DYNAMIC_READ: // fall-through...
case GLenum::GL_STATIC_COPY: // fall-through...
case GLenum::GL_STATIC_READ: // fall-through...
case GLenum::GL_STREAM_COPY: // fall-through...
case GLenum::GL_STREAM_READ: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, usage);
}
}
if ((size) < ((GLsizeiptr)(0L))) {
subGlErrorInvalidValue(observer, call);
}
checkNotNull(l_b).mData = /* switch((data) != (nullptr)) */
/* case true: */((((data) != (nullptr)) == (true))) ? (observer->clone(slice((uint8_t*)(data), (uint64_t)((GLsizeiptr)(0L)), (uint64_t)(size)))) :
/* case false: */((((data) != (nullptr)) == (false))) ? (make<uint8_t>((uint64_t)(size))) :
/* default: */ Slice<uint8_t>();
checkNotNull(l_b).mSize = size;
checkNotNull(l_b).mUsage = usage;
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBufferData coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(size, *observer->getScratch()), toEncoder< gapic::coder::gles::BufferDataPointer >(data, *observer->getScratch()), usage);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetBufferParameteriv(CallObserver* observer, uint32_t target, uint32_t parameter, GLint* value) {
GAPID_DEBUG("glGetBufferParameteriv(%u, %u, %p)", target, parameter, value);
if (mImports.glGetBufferParameteriv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetBufferParameteriv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetBufferParameteriv(target, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
call();
subGetBufferParameter_GLint(observer, call, target, parameter, value);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetBufferParameteriv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, parameter, toEncoder< gapic::coder::gles::GLint__P >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLboolean GlesSpy::glIsBuffer(CallObserver* observer, BufferId buffer) {
GAPID_DEBUG("glIsBuffer(%" PRIu32 ")", buffer);
if (mImports.glIsBuffer == nullptr) {
GAPID_WARNING("Application called unsupported function glIsBuffer");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, buffer] {
called = true;
observer->observeReads();
result = mImports.glIsBuffer(buffer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
call();
if (UNLIKELY(shouldComputeExpectedReturn())) {
setExpectedReturn<GLboolean>((GLboolean)(checkNotNull(l_ctx).mInstances.mBuffers.count(buffer) > 0));
}
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlIsBuffer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buffer, *observer->getScratch()), toEncoder< uint8_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glPushDebugGroup(CallObserver* observer, uint32_t source, GLuint id, GLsizei length, GLchar* message) {
GAPID_DEBUG("glPushDebugGroup(%u, %" PRIu32 ", %" PRId32 ", %p)", source, id, length, message);
if (mImports.glPushDebugGroup == nullptr) {
GAPID_WARNING("Application called unsupported function glPushDebugGroup");
return;
}
bool called = false;
auto call = [this, observer, &called, source, id, length, message] {
called = true;
observer->observeReads();
mImports.glPushDebugGroup(source, id, length, message);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subPushDebugGroup(observer, call, source, id, length, message);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlPushDebugGroup coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), source, toEncoder< uint32_t >(id, *observer->getScratch()), toEncoder< int32_t >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__CP >(message, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
EGLBoolean GlesSpy::eglChooseConfig(CallObserver* observer, EGLDisplay display, EGLint* attrib_list, EGLConfig* configs, EGLint config_size, EGLint* num_config) {
GAPID_DEBUG("eglChooseConfig(%p, %p, %p, %d, %p)", display, attrib_list, configs, config_size, num_config);
if (mImports.eglChooseConfig == nullptr) {
GAPID_WARNING("Application called unsupported function eglChooseConfig");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, attrib_list, configs, config_size, num_config] {
called = true;
observer->observeReads();
result = mImports.eglChooseConfig(display, attrib_list, configs, config_size, num_config);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subObserveAttribList(observer, call, attrib_list);
call();
auto l_num = slice(num_config, 0ULL, 1ULL)[0ULL];
observer->write<EGLint>(slice(num_config, 0ULL, 1ULL), 0ULL, l_num);
if ((configs) != (nullptr)) {
observer->write(slice(configs, (uint64_t)(0L), (uint64_t)(l_num)));
}
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::EglChooseConfig coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLint__CP >(attrib_list, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLConfig__P >(configs, *observer->getScratch()), toEncoder< int >(config_size, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLint__P >(num_config, *observer->getScratch()), toEncoder< int >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
EGLDisplay GlesSpy::eglGetCurrentDisplay(CallObserver* observer) {
GAPID_DEBUG("eglGetCurrentDisplay()");
if (mImports.eglGetCurrentDisplay == nullptr) {
GAPID_WARNING("Application called unsupported function eglGetCurrentDisplay");
return nullptr;
}
EGLDisplay result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result] {
called = true;
observer->observeReads();
result = mImports.eglGetCurrentDisplay();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::EglGetCurrentDisplay coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
EGLBoolean GlesSpy::eglQuerySurface(CallObserver* observer, EGLDisplay display, EGLSurface surface, EGLint attribute, EGLint* value) {
GAPID_DEBUG("eglQuerySurface(%p, %p, %d, %p)", display, surface, attribute, value);
if (mImports.eglQuerySurface == nullptr) {
GAPID_WARNING("Application called unsupported function eglQuerySurface");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, surface, attribute, value] {
called = true;
observer->observeReads();
result = mImports.eglQuerySurface(display, surface, attribute, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
observer->write<EGLint>(slice(value, 0ULL, 1ULL), 0ULL, slice(value, 0ULL, 1ULL)[0ULL]);
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::EglQuerySurface coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLSurface >(surface, *observer->getScratch()), toEncoder< int >(attribute, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLint__P >(value, *observer->getScratch()), toEncoder< int >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
char* GlesSpy::eglQueryString(CallObserver* observer, EGLDisplay display, EGLint name) {
GAPID_DEBUG("eglQueryString(%p, %d)", display, name);
if (mImports.eglQueryString == nullptr) {
GAPID_WARNING("Application called unsupported function eglQueryString");
return nullptr;
}
char* result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, display, name] {
called = true;
observer->observeReads();
result = mImports.eglQueryString(display, name);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::EglQueryString coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, *observer->getScratch()), toEncoder< int >(name, *observer->getScratch()), toEncoder< gapic::coder::gles::Char__CP >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
EGLClientBuffer GlesSpy::eglCreateNativeClientBufferANDROID(CallObserver* observer, EGLint* attrib_list) {
GAPID_DEBUG("eglCreateNativeClientBufferANDROID(%p)", attrib_list);
if (mImports.eglCreateNativeClientBufferANDROID == nullptr) {
GAPID_WARNING("Application called unsupported function eglCreateNativeClientBufferANDROID");
return nullptr;
}
EGLClientBuffer result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, attrib_list] {
called = true;
observer->observeReads();
result = mImports.eglCreateNativeClientBufferANDROID(attrib_list);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::EGL_ANDROID_create_native_client_buffer);
subObserveAttribList(observer, call, attrib_list);
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::EglCreateNativeClientBufferANDROID coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLint__CP >(attrib_list, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLClientBuffer >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glAlphaFuncQCOM(CallObserver* observer, uint32_t func, GLclampf ref) {
GAPID_DEBUG("glAlphaFuncQCOM(%u, %f)", func, ref);
if (mImports.glAlphaFuncQCOM == nullptr) {
GAPID_WARNING("Application called unsupported function glAlphaFuncQCOM");
return;
}
bool called = false;
auto call = [this, observer, &called, func, ref] {
called = true;
observer->observeReads();
mImports.glAlphaFuncQCOM(func, ref);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_QCOM_alpha_test);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlAlphaFuncQCOM coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), func, toEncoder< float >(ref, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBeginPerfMonitorAMD(CallObserver* observer, GLuint monitor) {
GAPID_DEBUG("glBeginPerfMonitorAMD(%" PRIu32 ")", monitor);
if (mImports.glBeginPerfMonitorAMD == nullptr) {
GAPID_WARNING("Application called unsupported function glBeginPerfMonitorAMD");
return;
}
bool called = false;
auto call = [this, observer, &called, monitor] {
called = true;
observer->observeReads();
mImports.glBeginPerfMonitorAMD(monitor);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_AMD_performance_monitor);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBeginPerfMonitorAMD coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(monitor, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBeginPerfQueryINTEL(CallObserver* observer, GLuint queryHandle) {
GAPID_DEBUG("glBeginPerfQueryINTEL(%" PRIu32 ")", queryHandle);
if (mImports.glBeginPerfQueryINTEL == nullptr) {
GAPID_WARNING("Application called unsupported function glBeginPerfQueryINTEL");
return;
}
bool called = false;
auto call = [this, observer, &called, queryHandle] {
called = true;
observer->observeReads();
mImports.glBeginPerfQueryINTEL(queryHandle);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_INTEL_performance_query);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBeginPerfQueryINTEL coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(queryHandle, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBindProgramPipelineEXT(CallObserver* observer, PipelineId pipeline) {
GAPID_DEBUG("glBindProgramPipelineEXT(%" PRIu32 ")", pipeline);
if (mImports.glBindProgramPipelineEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBindProgramPipelineEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, pipeline] {
called = true;
observer->observeReads();
mImports.glBindProgramPipelineEXT(pipeline);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBindProgramPipelineEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBufferStorageEXT(CallObserver* observer, uint32_t target, GLsizeiptr size, void* data, uint32_t flag) {
GAPID_DEBUG("glBufferStorageEXT(%u, %" PRId32 ", %p, %u)", target, size, data, flag);
if (mImports.glBufferStorageEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBufferStorageEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, size, data, flag] {
called = true;
observer->observeReads();
mImports.glBufferStorageEXT(target, size, data, flag);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_buffer_storage);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBufferStorageEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(size, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__CP >(data, *observer->getScratch()), flag);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glCopyPathNV(CallObserver* observer, GLuint resultPath, GLuint srcPath) {
GAPID_DEBUG("glCopyPathNV(%" PRIu32 ", %" PRIu32 ")", resultPath, srcPath);
if (mImports.glCopyPathNV == nullptr) {
GAPID_WARNING("Application called unsupported function glCopyPathNV");
return;
}
bool called = false;
auto call = [this, observer, &called, resultPath, srcPath] {
called = true;
observer->observeReads();
mImports.glCopyPathNV(resultPath, srcPath);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlCopyPathNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(resultPath, *observer->getScratch()), toEncoder< uint32_t >(srcPath, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glCoverFillPathInstancedNV(CallObserver* observer, GLsizei numPaths, uint32_t pathNameType, void* paths, GLuint pathBase, uint32_t coverMode, uint32_t transformType, GLfloat* transformValues) {
GAPID_DEBUG("glCoverFillPathInstancedNV(%" PRId32 ", %u, %p, %" PRIu32 ", %u, %u, %p)", numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues);
if (mImports.glCoverFillPathInstancedNV == nullptr) {
GAPID_WARNING("Application called unsupported function glCoverFillPathInstancedNV");
return;
}
bool called = false;
auto call = [this, observer, &called, numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues] {
called = true;
observer->observeReads();
mImports.glCoverFillPathInstancedNV(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlCoverFillPathInstancedNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(numPaths, *observer->getScratch()), pathNameType, toEncoder< gapic::coder::gles::Void__CP >(paths, *observer->getScratch()), toEncoder< uint32_t >(pathBase, *observer->getScratch()), coverMode, transformType, toEncoder< gapic::coder::gles::GLfloat__CP >(transformValues, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLuint GlesSpy::glCreateShaderProgramvEXT(CallObserver* observer, uint32_t type, GLsizei count, GLchar** strings) {
GAPID_DEBUG("glCreateShaderProgramvEXT(%u, %" PRId32 ", %p)", type, count, strings);
if (mImports.glCreateShaderProgramvEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glCreateShaderProgramvEXT");
return 0;
}
GLuint result = 0;
bool called = false;
auto call = [this, observer, &called, &result, type, count, strings] {
called = true;
observer->observeReads();
result = mImports.glCreateShaderProgramvEXT(type, count, strings);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlCreateShaderProgramvEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), type, toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__CP__P >(strings, *observer->getScratch()), toEncoder< uint32_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glEGLImageTargetTexture2DOES(CallObserver* observer, uint32_t target, GLeglImageOES image) {
GAPID_DEBUG("glEGLImageTargetTexture2DOES(%u, %p)", target, image);
if (mImports.glEGLImageTargetTexture2DOES == nullptr) {
GAPID_WARNING("Application called unsupported function glEGLImageTargetTexture2DOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, image] {
called = true;
observer->observeReads();
mImports.glEGLImageTargetTexture2DOES(target, image);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_EGL_image);
if ((target) != (GLenum::GL_TEXTURE_2D)) {
subGlErrorInvalidEnum(observer, call, target);
}
if (this->EGLImages.count((EGLImageKHR)(image)) > 0) {
std::shared_ptr<AndroidNativeBufferExtra> l_info = findOrZero(this->EGLImages, (EGLImageKHR)(image));
std::shared_ptr<Texture> l_t = subGetBoundTextureOrErrorInvalidEnum(observer, call, target);
uint32_t l_fmt = GLenum::GL_RGB;
uint32_t l_ty = GLenum::GL_UNSIGNED_BYTE;
checkNotNull(l_t).mTexelFormat = l_fmt;
checkNotNull(l_t).mTexelType = l_ty;
uint32_t l__res_0 = subImageSize(observer, call, checkNotNull(l_info).mWidth, checkNotNull(l_info).mHeight, l_fmt, l_ty);
checkNotNull(l_t).mTexture2D[(GLint)(0L)] = Image((GLsizei)(checkNotNull(l_info).mWidth), (GLsizei)(checkNotNull(l_info).mHeight), Slice<uint8_t>(), l__res_0, l_fmt, l_ty);
checkNotNull(l_t).mEGLImage = image;
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlEGLImageTargetTexture2DOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< gapic::coder::gles::GLeglImageOES >(image, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glEndPerfMonitorAMD(CallObserver* observer, GLuint monitor) {
GAPID_DEBUG("glEndPerfMonitorAMD(%" PRIu32 ")", monitor);
if (mImports.glEndPerfMonitorAMD == nullptr) {
GAPID_WARNING("Application called unsupported function glEndPerfMonitorAMD");
return;
}
bool called = false;
auto call = [this, observer, &called, monitor] {
called = true;
observer->observeReads();
mImports.glEndPerfMonitorAMD(monitor);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_AMD_performance_monitor);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlEndPerfMonitorAMD coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(monitor, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glEndPerfQueryINTEL(CallObserver* observer, GLuint queryHandle) {
GAPID_DEBUG("glEndPerfQueryINTEL(%" PRIu32 ")", queryHandle);
if (mImports.glEndPerfQueryINTEL == nullptr) {
GAPID_WARNING("Application called unsupported function glEndPerfQueryINTEL");
return;
}
bool called = false;
auto call = [this, observer, &called, queryHandle] {
called = true;
observer->observeReads();
mImports.glEndPerfQueryINTEL(queryHandle);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_INTEL_performance_query);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlEndPerfQueryINTEL coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(queryHandle, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glEndTilingQCOM(CallObserver* observer, uint32_t preserve_mask) {
GAPID_DEBUG("glEndTilingQCOM(%u)", preserve_mask);
if (mImports.glEndTilingQCOM == nullptr) {
GAPID_WARNING("Application called unsupported function glEndTilingQCOM");
return;
}
bool called = false;
auto call = [this, observer, &called, preserve_mask] {
called = true;
observer->observeReads();
mImports.glEndTilingQCOM(preserve_mask);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_QCOM_tiled_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlEndTilingQCOM coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), preserve_mask);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glExtGetBufferPointervQCOM(CallObserver* observer, uint32_t target, void** params) {
GAPID_DEBUG("glExtGetBufferPointervQCOM(%u, %p)", target, params);
if (mImports.glExtGetBufferPointervQCOM == nullptr) {
GAPID_WARNING("Application called unsupported function glExtGetBufferPointervQCOM");
return;
}
bool called = false;
auto call = [this, observer, &called, target, params] {
called = true;
observer->observeReads();
mImports.glExtGetBufferPointervQCOM(target, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_QCOM_extended_get);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlExtGetBufferPointervQCOM coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< gapic::coder::gles::Void__P__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLsync GlesSpy::glFenceSyncAPPLE(CallObserver* observer, uint32_t condition, uint32_t flag) {
GAPID_DEBUG("glFenceSyncAPPLE(%u, %u)", condition, flag);
if (mImports.glFenceSyncAPPLE == nullptr) {
GAPID_WARNING("Application called unsupported function glFenceSyncAPPLE");
return nullptr;
}
GLsync result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, condition, flag] {
called = true;
observer->observeReads();
result = mImports.glFenceSyncAPPLE(condition, flag);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_APPLE_sync);
call();
auto l_sync = result;
subFenceSync(observer, call, condition, flag, l_sync);
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFenceSyncAPPLE coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), condition, flag, toEncoder< gapic::coder::gles::GLsync >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glFramebufferTexture2DMultisampleIMG(CallObserver* observer, uint32_t target, uint32_t attachment, uint32_t textarget, TextureId texture, GLint level, GLsizei samples) {
GAPID_DEBUG("glFramebufferTexture2DMultisampleIMG(%u, %u, %u, %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, attachment, textarget, texture, level, samples);
if (mImports.glFramebufferTexture2DMultisampleIMG == nullptr) {
GAPID_WARNING("Application called unsupported function glFramebufferTexture2DMultisampleIMG");
return;
}
bool called = false;
auto call = [this, observer, &called, target, attachment, textarget, texture, level, samples] {
called = true;
observer->observeReads();
mImports.glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_IMG_multisampled_render_to_texture);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFramebufferTexture2DMultisampleIMG coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, attachment, textarget, toEncoder< uint32_t >(texture, *observer->getScratch()), toEncoder< int32_t >(level, *observer->getScratch()), toEncoder< int32_t >(samples, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLuint GlesSpy::glGenPathsNV(CallObserver* observer, GLsizei range) {
GAPID_DEBUG("glGenPathsNV(%" PRId32 ")", range);
if (mImports.glGenPathsNV == nullptr) {
GAPID_WARNING("Application called unsupported function glGenPathsNV");
return 0;
}
GLuint result = 0;
bool called = false;
auto call = [this, observer, &called, &result, range] {
called = true;
observer->observeReads();
result = mImports.glGenPathsNV(range);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenPathsNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(range, *observer->getScratch()), toEncoder< uint32_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glGetDriverControlStringQCOM(CallObserver* observer, GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString) {
GAPID_DEBUG("glGetDriverControlStringQCOM(%" PRIu32 ", %" PRId32 ", %p, %p)", driverControl, bufSize, length, driverControlString);
if (mImports.glGetDriverControlStringQCOM == nullptr) {
GAPID_WARNING("Application called unsupported function glGetDriverControlStringQCOM");
return;
}
bool called = false;
auto call = [this, observer, &called, driverControl, bufSize, length, driverControlString] {
called = true;
observer->observeReads();
mImports.glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_QCOM_driver_control);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetDriverControlStringQCOM coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(driverControl, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(driverControlString, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetFenceivNV(CallObserver* observer, GLuint fence, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetFenceivNV(%" PRIu32 ", %u, %p)", fence, pname, params);
if (mImports.glGetFenceivNV == nullptr) {
GAPID_WARNING("Application called unsupported function glGetFenceivNV");
return;
}
bool called = false;
auto call = [this, observer, &called, fence, pname, params] {
called = true;
observer->observeReads();
mImports.glGetFenceivNV(fence, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_fence);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetFenceivNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(fence, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLint__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetInteger64vAPPLE(CallObserver* observer, uint32_t pname, GLint64* params) {
GAPID_DEBUG("glGetInteger64vAPPLE(%u, %p)", pname, params);
if (mImports.glGetInteger64vAPPLE == nullptr) {
GAPID_WARNING("Application called unsupported function glGetInteger64vAPPLE");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, params] {
called = true;
observer->observeReads();
mImports.glGetInteger64vAPPLE(pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_APPLE_sync);
call();
subGetInteger64v(observer, call, pname, params);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetInteger64vAPPLE coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< gapic::coder::gles::GLint64__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetPathParameterfvNV(CallObserver* observer, GLuint path, uint32_t pname, GLfloat* value) {
GAPID_DEBUG("glGetPathParameterfvNV(%" PRIu32 ", %u, %p)", path, pname, value);
if (mImports.glGetPathParameterfvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPathParameterfvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, path, pname, value] {
called = true;
observer->observeReads();
mImports.glGetPathParameterfvNV(path, pname, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetPathParameterfvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLfloat__P >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetQueryivEXT(CallObserver* observer, uint32_t target, uint32_t parameter, GLint* value) {
GAPID_DEBUG("glGetQueryivEXT(%u, %u, %p)", target, parameter, value);
if (mImports.glGetQueryivEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glGetQueryivEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetQueryivEXT(target, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension2(observer, call, ExtensionId::GL_EXT_disjoint_timer_query, ExtensionId::GL_EXT_occlusion_query_boolean);
call();
observer->write<GLint>(slice(value, 0ULL, 1ULL), 0ULL, slice(value, 0ULL, 1ULL)[0ULL]);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetQueryivEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, parameter, toEncoder< gapic::coder::gles::GLint__P >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetSamplerParameterIivOES(CallObserver* observer, SamplerId sampler, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetSamplerParameterIivOES(%" PRIu32 ", %u, %p)", sampler, pname, params);
if (mImports.glGetSamplerParameterIivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetSamplerParameterIivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, params] {
called = true;
observer->observeReads();
mImports.glGetSamplerParameterIivOES(sampler, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_border_clamp);
call();
subGetSamplerParameterIiv(observer, call, sampler, pname, params);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetSamplerParameterIivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLint__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glMakeTextureHandleNonResidentNV(CallObserver* observer, GLuint64 handle) {
GAPID_DEBUG("glMakeTextureHandleNonResidentNV(%" PRIu64 ")", handle);
if (mImports.glMakeTextureHandleNonResidentNV == nullptr) {
GAPID_WARNING("Application called unsupported function glMakeTextureHandleNonResidentNV");
return;
}
bool called = false;
auto call = [this, observer, &called, handle] {
called = true;
observer->observeReads();
mImports.glMakeTextureHandleNonResidentNV(handle);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_bindless_texture);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlMakeTextureHandleNonResidentNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint64_t >(handle, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glMatrixLoad3x2fNV(CallObserver* observer, uint32_t matrixMode, GLfloat* m) {
GAPID_DEBUG("glMatrixLoad3x2fNV(%u, %p)", matrixMode, m);
if (mImports.glMatrixLoad3x2fNV == nullptr) {
GAPID_WARNING("Application called unsupported function glMatrixLoad3x2fNV");
return;
}
bool called = false;
auto call = [this, observer, &called, matrixMode, m] {
called = true;
observer->observeReads();
mImports.glMatrixLoad3x2fNV(matrixMode, m);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlMatrixLoad3x2fNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), matrixMode, toEncoder< gapic::coder::gles::GLfloat__CP >(m, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glMultiDrawElementsBaseVertexOES(CallObserver* observer, uint32_t mode, GLsizei* count, uint32_t type, void** indices, GLsizei primcount, GLint* basevertex) {
GAPID_DEBUG("glMultiDrawElementsBaseVertexOES(%u, %p, %u, %p, %" PRId32 ", %p)", mode, count, type, indices, primcount, basevertex);
if (mImports.glMultiDrawElementsBaseVertexOES == nullptr) {
GAPID_WARNING("Application called unsupported function glMultiDrawElementsBaseVertexOES");
return;
}
bool called = false;
auto call = [this, observer, &called, mode, count, type, indices, primcount, basevertex] {
called = true;
observer->observeReads();
mImports.glMultiDrawElementsBaseVertexOES(mode, count, type, indices, primcount, basevertex);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_draw_elements_base_vertex);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlMultiDrawElementsBaseVertexOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< gapic::coder::gles::GLsizei__CP >(count, *observer->getScratch()), type, toEncoder< gapic::coder::gles::Void__CP__CP >(indices, *observer->getScratch()), toEncoder< int32_t >(primcount, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__CP >(basevertex, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
uint32_t GlesSpy::glPathGlyphIndexArrayNV(CallObserver* observer, GLuint firstPathName, uint32_t fontTarget, void* fontName, uint32_t fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale) {
GAPID_DEBUG("glPathGlyphIndexArrayNV(%" PRIu32 ", %u, %p, %u, %" PRIu32 ", %" PRId32 ", %" PRIu32 ", %f)", firstPathName, fontTarget, fontName, fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale);
if (mImports.glPathGlyphIndexArrayNV == nullptr) {
GAPID_WARNING("Application called unsupported function glPathGlyphIndexArrayNV");
return 0;
}
uint32_t result = 0;
bool called = false;
auto call = [this, observer, &called, &result, firstPathName, fontTarget, fontName, fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale] {
called = true;
observer->observeReads();
result = mImports.glPathGlyphIndexArrayNV(firstPathName, fontTarget, fontName, fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlPathGlyphIndexArrayNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(firstPathName, *observer->getScratch()), fontTarget, toEncoder< gapic::coder::gles::Void__CP >(fontName, *observer->getScratch()), fontStyle, toEncoder< uint32_t >(firstGlyphIndex, *observer->getScratch()), toEncoder< int32_t >(numGlyphs, *observer->getScratch()), toEncoder< uint32_t >(pathParameterTemplate, *observer->getScratch()), toEncoder< float >(emScale, *observer->getScratch()), result);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glProgramBinaryOES(CallObserver* observer, ProgramId program, uint32_t binary_format, void* binary, GLint binary_size) {
GAPID_DEBUG("glProgramBinaryOES(%" PRIu32 ", %u, %p, %" PRId32 ")", program, binary_format, binary, binary_size);
if (mImports.glProgramBinaryOES == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramBinaryOES");
return;
}
bool called = false;
auto call = [this, observer, &called, program, binary_format, binary, binary_size] {
called = true;
observer->observeReads();
mImports.glProgramBinaryOES(program, binary_format, binary, binary_size);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_get_program_binary);
call();
subProgramBinary(observer, call, program, binary_format, binary, (GLsizei)(binary_size));
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramBinaryOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), binary_format, toEncoder< gapic::coder::gles::Void__CP >(binary, *observer->getScratch()), toEncoder< int32_t >(binary_size, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform1fvEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLfloat* value) {
GAPID_DEBUG("glProgramUniform1fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value);
if (mImports.glProgramUniform1fvEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform1fvEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, value] {
called = true;
observer->observeReads();
mImports.glProgramUniform1fvEXT(program, location, count, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniform1fv(observer, call, program, location, count, value);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform1fvEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform3uivEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLuint* value) {
GAPID_DEBUG("glProgramUniform3uivEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value);
if (mImports.glProgramUniform3uivEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform3uivEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, value] {
called = true;
observer->observeReads();
mImports.glProgramUniform3uivEXT(program, location, count, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniform3uiv(observer, call, program, location, count, value);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform3uivEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform4ivEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLint* value) {
GAPID_DEBUG("glProgramUniform4ivEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value);
if (mImports.glProgramUniform4ivEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform4ivEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, value] {
called = true;
observer->observeReads();
mImports.glProgramUniform4ivEXT(program, location, count, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniform4iv(observer, call, program, location, count, value);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform4ivEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniformHandleui64NV(CallObserver* observer, ProgramId program, UniformLocation location, GLuint64 value) {
GAPID_DEBUG("glProgramUniformHandleui64NV(%" PRIu32 ", %" PRId32 ", %" PRIu64 ")", program, location, value);
if (mImports.glProgramUniformHandleui64NV == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformHandleui64NV");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value] {
called = true;
observer->observeReads();
mImports.glProgramUniformHandleui64NV(program, location, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_bindless_texture);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniformHandleui64NV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint64_t >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glReadBufferNV(CallObserver* observer, uint32_t mode) {
GAPID_DEBUG("glReadBufferNV(%u)", mode);
if (mImports.glReadBufferNV == nullptr) {
GAPID_WARNING("Application called unsupported function glReadBufferNV");
return;
}
bool called = false;
auto call = [this, observer, &called, mode] {
called = true;
observer->observeReads();
mImports.glReadBufferNV(mode);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_read_buffer);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlReadBufferNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glStencilFillPathNV(CallObserver* observer, GLuint path, uint32_t fillMode, GLuint mask) {
GAPID_DEBUG("glStencilFillPathNV(%" PRIu32 ", %u, %" PRIu32 ")", path, fillMode, mask);
if (mImports.glStencilFillPathNV == nullptr) {
GAPID_WARNING("Application called unsupported function glStencilFillPathNV");
return;
}
bool called = false;
auto call = [this, observer, &called, path, fillMode, mask] {
called = true;
observer->observeReads();
mImports.glStencilFillPathNV(path, fillMode, mask);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlStencilFillPathNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *observer->getScratch()), fillMode, toEncoder< uint32_t >(mask, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexImage3DOES(CallObserver* observer, uint32_t target, GLint level, uint32_t internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, uint32_t format, uint32_t type, TexturePointer pixels) {
GAPID_DEBUG("glTexImage3DOES(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %p)", target, level, internalformat, width, height, depth, border, format, type, pixels);
if (mImports.glTexImage3DOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTexImage3DOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, level, internalformat, width, height, depth, border, format, type, pixels] {
called = true;
observer->observeReads();
mImports.glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_3D);
subTexImage3D(observer, call, target, level, (GLint)(internalformat), width, height, depth, border, format, type, pixels);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexImage3DOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, *observer->getScratch()), internalformat, toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()), toEncoder< int32_t >(depth, *observer->getScratch()), toEncoder< int32_t >(border, *observer->getScratch()), format, type, toEncoder< gapic::coder::gles::TexturePointer >(pixels, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexParameterIuivOES(CallObserver* observer, uint32_t target, uint32_t pname, GLuint* params) {
GAPID_DEBUG("glTexParameterIuivOES(%u, %u, %p)", target, pname, params);
if (mImports.glTexParameterIuivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTexParameterIuivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glTexParameterIuivOES(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_border_clamp);
subTexParameterIuiv(observer, call, target, pname, params);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexParameterIuivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLuint__CP >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexStorage1DEXT(CallObserver* observer, uint32_t target, GLsizei levels, uint32_t internalformat, GLsizei width) {
GAPID_DEBUG("glTexStorage1DEXT(%u, %" PRId32 ", %u, %" PRId32 ")", target, levels, internalformat, width);
if (mImports.glTexStorage1DEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glTexStorage1DEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, levels, internalformat, width] {
called = true;
observer->observeReads();
mImports.glTexStorage1DEXT(target, levels, internalformat, width);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_texture_storage);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexStorage1DEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(levels, *observer->getScratch()), internalformat, toEncoder< int32_t >(width, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexSubImage3DOES(CallObserver* observer, uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, uint32_t format, uint32_t type, TexturePointer pixels) {
GAPID_DEBUG("glTexSubImage3DOES(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %p)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
if (mImports.glTexSubImage3DOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTexSubImage3DOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels] {
called = true;
observer->observeReads();
mImports.glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_3D);
subTexSubImage3D(observer, call, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexSubImage3DOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, *observer->getScratch()), toEncoder< int32_t >(xoffset, *observer->getScratch()), toEncoder< int32_t >(yoffset, *observer->getScratch()), toEncoder< int32_t >(zoffset, *observer->getScratch()), toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()), toEncoder< int32_t >(depth, *observer->getScratch()), format, type, toEncoder< gapic::coder::gles::TexturePointer >(pixels, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTextureStorage3DEXT(CallObserver* observer, TextureId texture, uint32_t target, GLsizei levels, uint32_t internalformat, GLsizei width, GLsizei height, GLsizei depth) {
GAPID_DEBUG("glTextureStorage3DEXT(%" PRIu32 ", %u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ")", texture, target, levels, internalformat, width, height, depth);
if (mImports.glTextureStorage3DEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glTextureStorage3DEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, texture, target, levels, internalformat, width, height, depth] {
called = true;
observer->observeReads();
mImports.glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_texture_storage);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTextureStorage3DEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, *observer->getScratch()), target, toEncoder< int32_t >(levels, *observer->getScratch()), internalformat, toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()), toEncoder< int32_t >(depth, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniformMatrix3x4fvNV(CallObserver* observer, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) {
GAPID_DEBUG("glUniformMatrix3x4fvNV(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, value);
if (mImports.glUniformMatrix3x4fvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformMatrix3x4fvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, transpose, value] {
called = true;
observer->observeReads();
mImports.glUniformMatrix3x4fvNV(location, count, transpose, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_non_square_matrices);
subUniformMatrix3x4fv(observer, call, location, count, transpose, value);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniformMatrix3x4fvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniformMatrix4x3fvNV(CallObserver* observer, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) {
GAPID_DEBUG("glUniformMatrix4x3fvNV(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, value);
if (mImports.glUniformMatrix4x3fvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformMatrix4x3fvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, transpose, value] {
called = true;
observer->observeReads();
mImports.glUniformMatrix4x3fvNV(location, count, transpose, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_non_square_matrices);
subUniformMatrix4x3fv(observer, call, location, count, transpose, value);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniformMatrix4x3fvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLboolean GlesSpy::glUnmapBufferOES(CallObserver* observer, uint32_t target) {
GAPID_DEBUG("glUnmapBufferOES(%u)", target);
if (mImports.glUnmapBufferOES == nullptr) {
GAPID_WARNING("Application called unsupported function glUnmapBufferOES");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, target] {
called = true;
observer->observeReads();
result = mImports.glUnmapBufferOES(target);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_mapbuffer);
subUnmapBuffer(observer, call, target);
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUnmapBufferOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint8_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glWaitSyncAPPLE(CallObserver* observer, GLsync sync, uint32_t flag, GLuint64 timeout) {
GAPID_DEBUG("glWaitSyncAPPLE(%p, %u, %" PRIu64 ")", sync, flag, timeout);
if (mImports.glWaitSyncAPPLE == nullptr) {
GAPID_WARNING("Application called unsupported function glWaitSyncAPPLE");
return;
}
bool called = false;
auto call = [this, observer, &called, sync, flag, timeout] {
called = true;
observer->observeReads();
mImports.glWaitSyncAPPLE(sync, flag, timeout);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_APPLE_sync);
subWaitSync(observer, call, sync, flag, timeout);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlWaitSyncAPPLE coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLsync >(sync, *observer->getScratch()), flag, toEncoder< uint64_t >(timeout, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glConservativeRasterParameteriNV(CallObserver* observer, uint32_t pname, GLint param) {
GAPID_DEBUG("glConservativeRasterParameteriNV(%u, %" PRId32 ")", pname, param);
if (mImports.glConservativeRasterParameteriNV == nullptr) {
GAPID_WARNING("Application called unsupported function glConservativeRasterParameteriNV");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, param] {
called = true;
observer->observeReads();
mImports.glConservativeRasterParameteriNV(pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_conservative_raster_pre_snap_triangles);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlConservativeRasterParameteriNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< int32_t >(param, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLuint64 GlesSpy::glGetTextureSamplerHandleIMG(CallObserver* observer, GLuint texture, GLuint sampler) {
GAPID_DEBUG("glGetTextureSamplerHandleIMG(%" PRIu32 ", %" PRIu32 ")", texture, sampler);
if (mImports.glGetTextureSamplerHandleIMG == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTextureSamplerHandleIMG");
return 0;
}
GLuint64 result = 0;
bool called = false;
auto call = [this, observer, &called, &result, texture, sampler] {
called = true;
observer->observeReads();
result = mImports.glGetTextureSamplerHandleIMG(texture, sampler);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_IMG_bindless_texture);
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetTextureSamplerHandleIMG coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, *observer->getScratch()), toEncoder< uint32_t >(sampler, *observer->getScratch()), toEncoder< uint64_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glProgramUniform2ui64NV(CallObserver* observer, GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y) {
GAPID_DEBUG("glProgramUniform2ui64NV(%" PRIu32 ", %" PRId32 ", %" PRIu64 ", %" PRIu64 ")", program, location, x, y);
if (mImports.glProgramUniform2ui64NV == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform2ui64NV");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, x, y] {
called = true;
observer->observeReads();
mImports.glProgramUniform2ui64NV(program, location, x, y);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_gpu_shader5);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform2ui64NV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint64_t >(x, *observer->getScratch()), toEncoder< uint64_t >(y, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform3i64NV(CallObserver* observer, GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) {
GAPID_DEBUG("glProgramUniform3i64NV(%" PRIu32 ", %" PRId32 ", %" PRId64 ", %" PRId64 ", %" PRId64 ")", program, location, x, y, z);
if (mImports.glProgramUniform3i64NV == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform3i64NV");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, x, y, z] {
called = true;
observer->observeReads();
mImports.glProgramUniform3i64NV(program, location, x, y, z);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_gpu_shader5);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform3i64NV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int64_t >(x, *observer->getScratch()), toEncoder< int64_t >(y, *observer->getScratch()), toEncoder< int64_t >(z, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniform1i64vNV(CallObserver* observer, GLint location, GLsizei count, GLint64EXT* value) {
GAPID_DEBUG("glUniform1i64vNV(%" PRId32 ", %" PRId32 ", %p)", location, count, value);
if (mImports.glUniform1i64vNV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform1i64vNV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, value] {
called = true;
observer->observeReads();
mImports.glUniform1i64vNV(location, count, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_gpu_shader5);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniform1i64vNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint64EXT__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniform4ui64vNV(CallObserver* observer, GLint location, GLsizei count, GLuint64EXT* value) {
GAPID_DEBUG("glUniform4ui64vNV(%" PRId32 ", %" PRId32 ", %p)", location, count, value);
if (mImports.glUniform4ui64vNV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform4ui64vNV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, value] {
called = true;
observer->observeReads();
mImports.glUniform4ui64vNV(location, count, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_gpu_shader5);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniform4ui64vNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint64EXT__CP >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBlendBarrier(CallObserver* observer) {
GAPID_DEBUG("glBlendBarrier()");
if (mImports.glBlendBarrier == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendBarrier");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glBlendBarrier();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subBlendBarrier(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlendBarrier coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBlendColor(CallObserver* observer, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
GAPID_DEBUG("glBlendColor(%f, %f, %f, %f)", red, green, blue, alpha);
if (mImports.glBlendColor == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendColor");
return;
}
bool called = false;
auto call = [this, observer, &called, red, green, blue, alpha] {
called = true;
observer->observeReads();
mImports.glBlendColor(red, green, blue, alpha);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mFragmentOperations.mBlendColor = Color(red, green, blue, alpha);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlendColor coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(red, *observer->getScratch()), toEncoder< float >(green, *observer->getScratch()), toEncoder< float >(blue, *observer->getScratch()), toEncoder< float >(alpha, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glScissor(CallObserver* observer, GLint x, GLint y, GLsizei width, GLsizei height) {
GAPID_DEBUG("glScissor(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, width, height);
if (mImports.glScissor == nullptr) {
GAPID_WARNING("Application called unsupported function glScissor");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, width, height] {
called = true;
observer->observeReads();
mImports.glScissor(x, y, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
if (((width) < ((GLsizei)(0L))) || ((height) < ((GLsizei)(0L)))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mFragmentOperations.mScissor.mBox = Rect(x, y, width, height);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlScissor coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, *observer->getScratch()), toEncoder< int32_t >(y, *observer->getScratch()), toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glStencilFunc(CallObserver* observer, uint32_t func, GLint ref, GLuint mask) {
GAPID_DEBUG("glStencilFunc(%u, %" PRId32 ", %" PRIu32 ")", func, ref, mask);
if (mImports.glStencilFunc == nullptr) {
GAPID_WARNING("Application called unsupported function glStencilFunc");
return;
}
bool called = false;
auto call = [this, observer, &called, func, ref, mask] {
called = true;
observer->observeReads();
mImports.glStencilFunc(func, ref, mask);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subStencilFuncSeparate(observer, call, GLenum::GL_FRONT_AND_BACK, func, ref, mask);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlStencilFunc coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), func, toEncoder< int32_t >(ref, *observer->getScratch()), toEncoder< uint32_t >(mask, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBlitFramebuffer(CallObserver* observer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, uint32_t mask, uint32_t filter) {
GAPID_DEBUG("glBlitFramebuffer(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u)", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
if (mImports.glBlitFramebuffer == nullptr) {
GAPID_WARNING("Application called unsupported function glBlitFramebuffer");
return;
}
bool called = false;
auto call = [this, observer, &called, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter] {
called = true;
observer->observeReads();
mImports.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subBlitFramebuffer(observer, call, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlitFramebuffer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(srcX0, *observer->getScratch()), toEncoder< int32_t >(srcY0, *observer->getScratch()), toEncoder< int32_t >(srcX1, *observer->getScratch()), toEncoder< int32_t >(srcY1, *observer->getScratch()), toEncoder< int32_t >(dstX0, *observer->getScratch()), toEncoder< int32_t >(dstY0, *observer->getScratch()), toEncoder< int32_t >(dstX1, *observer->getScratch()), toEncoder< int32_t >(dstY1, *observer->getScratch()), mask, filter);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glClearBufferfi(CallObserver* observer, uint32_t buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
GAPID_DEBUG("glClearBufferfi(%u, %" PRId32 ", %f, %" PRId32 ")", buffer, drawbuffer, depth, stencil);
if (mImports.glClearBufferfi == nullptr) {
GAPID_WARNING("Application called unsupported function glClearBufferfi");
return;
}
bool called = false;
auto call = [this, observer, &called, buffer, drawbuffer, depth, stencil] {
called = true;
observer->observeReads();
mImports.glClearBufferfi(buffer, drawbuffer, depth, stencil);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (buffer) {
case GLenum::GL_DEPTH_STENCIL: {
if ((drawbuffer) != ((GLint)(0L))) {
subGlErrorInvalidValue(observer, call);
}
break;
}
default: {
subGlErrorInvalidEnum(observer, call, buffer);
}
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlClearBufferfi coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), buffer, toEncoder< int32_t >(drawbuffer, *observer->getScratch()), toEncoder< float >(depth, *observer->getScratch()), toEncoder< int32_t >(stencil, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glDeleteRenderbuffers(CallObserver* observer, GLsizei count, RenderbufferId* renderbuffers) {
GAPID_DEBUG("glDeleteRenderbuffers(%" PRId32 ", %p)", count, renderbuffers);
if (mImports.glDeleteRenderbuffers == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteRenderbuffers");
return;
}
bool called = false;
auto call = [this, observer, &called, count, renderbuffers] {
called = true;
observer->observeReads();
mImports.glDeleteRenderbuffers(count, renderbuffers);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
if ((count) < ((GLsizei)(0L))) {
subGlErrorInvalidValue(observer, call);
}
Slice<RenderbufferId> l_r = slice(renderbuffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) {
RenderbufferId l_id = observer->read(l_r, (uint64_t)(l_i));
if ((l_id) != ((RenderbufferId)(0UL))) {
checkNotNull(l_ctx).mInstances.mRenderbuffers.erase(l_id);
}
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDeleteRenderbuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::RenderbufferId__CP >(renderbuffers, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glFramebufferTexture(CallObserver* observer, uint32_t target, uint32_t attachment, TextureId texture, GLint level) {
GAPID_DEBUG("glFramebufferTexture(%u, %u, %" PRIu32 ", %" PRId32 ")", target, attachment, texture, level);
if (mImports.glFramebufferTexture == nullptr) {
GAPID_WARNING("Application called unsupported function glFramebufferTexture");
return;
}
bool called = false;
auto call = [this, observer, &called, target, attachment, texture, level] {
called = true;
observer->observeReads();
mImports.glFramebufferTexture(target, attachment, texture, level);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subFramebufferTexture(observer, call, target, attachment, texture, level);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFramebufferTexture coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, attachment, toEncoder< uint32_t >(texture, *observer->getScratch()), toEncoder< int32_t >(level, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetRenderbufferParameteriv(CallObserver* observer, uint32_t target, uint32_t parameter, GLint* values) {
GAPID_DEBUG("glGetRenderbufferParameteriv(%u, %u, %p)", target, parameter, values);
if (mImports.glGetRenderbufferParameteriv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetRenderbufferParameteriv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, parameter, values] {
called = true;
observer->observeReads();
mImports.glGetRenderbufferParameteriv(target, parameter, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
switch (target) {
case GLenum::GL_RENDERBUFFER: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, target);
}
}
switch (parameter) {
case GLenum::GL_RENDERBUFFER_ALPHA_SIZE: // fall-through...
case GLenum::GL_RENDERBUFFER_BLUE_SIZE: // fall-through...
case GLenum::GL_RENDERBUFFER_DEPTH_SIZE: // fall-through...
case GLenum::GL_RENDERBUFFER_GREEN_SIZE: // fall-through...
case GLenum::GL_RENDERBUFFER_HEIGHT: // fall-through...
case GLenum::GL_RENDERBUFFER_INTERNAL_FORMAT: // fall-through...
case GLenum::GL_RENDERBUFFER_RED_SIZE: // fall-through...
case GLenum::GL_RENDERBUFFER_STENCIL_SIZE: // fall-through...
case GLenum::GL_RENDERBUFFER_WIDTH: {
break;
}
case GLenum::GL_RENDERBUFFER_SAMPLES: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, parameter);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
RenderbufferId l_id = findOrZero(checkNotNull(l_ctx).mBoundRenderbuffers, target);
if ((l_id) == ((RenderbufferId)(0UL))) {
subGlErrorInvalidOperation(observer, call);
}
std::shared_ptr<Renderbuffer> l_rb = findOrZero(checkNotNull(l_ctx).mInstances.mRenderbuffers, l_id);
call();
observer->write<GLint>(slice(values, 0ULL, 1ULL), 0ULL, /* switch(parameter) */
/* case GLenum::GL_RENDERBUFFER_WIDTH: */(((parameter) == (GLenum::GL_RENDERBUFFER_WIDTH))) ? ((GLint)(checkNotNull(l_rb).mWidth)) :
/* case GLenum::GL_RENDERBUFFER_HEIGHT: */(((parameter) == (GLenum::GL_RENDERBUFFER_HEIGHT))) ? ((GLint)(checkNotNull(l_rb).mHeight)) :
/* case GLenum::GL_RENDERBUFFER_INTERNAL_FORMAT: */(((parameter) == (GLenum::GL_RENDERBUFFER_INTERNAL_FORMAT))) ? ((GLint)(checkNotNull(l_rb).mInternalFormat)) :
/* default: */ 0);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetRenderbufferParameteriv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, parameter, toEncoder< gapic::coder::gles::GLint__P >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLboolean GlesSpy::glIsRenderbuffer(CallObserver* observer, RenderbufferId renderbuffer) {
GAPID_DEBUG("glIsRenderbuffer(%" PRIu32 ")", renderbuffer);
if (mImports.glIsRenderbuffer == nullptr) {
GAPID_WARNING("Application called unsupported function glIsRenderbuffer");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, renderbuffer] {
called = true;
observer->observeReads();
result = mImports.glIsRenderbuffer(renderbuffer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
call();
if (UNLIKELY(shouldComputeExpectedReturn())) {
setExpectedReturn<GLboolean>((GLboolean)(checkNotNull(l_ctx).mInstances.mRenderbuffers.count(renderbuffer) > 0));
}
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlIsRenderbuffer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(renderbuffer, *observer->getScratch()), toEncoder< uint8_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glRenderbufferStorageMultisample(CallObserver* observer, uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) {
GAPID_DEBUG("glRenderbufferStorageMultisample(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height);
if (mImports.glRenderbufferStorageMultisample == nullptr) {
GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisample");
return;
}
bool called = false;
auto call = [this, observer, &called, target, samples, internalformat, width, height] {
called = true;
observer->observeReads();
mImports.glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subRenderbufferStorageMultisample(observer, call, target, samples, internalformat, width, height);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlRenderbufferStorageMultisample coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, *observer->getScratch()), internalformat, toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glEnablei(CallObserver* observer, uint32_t capability, GLuint index) {
GAPID_DEBUG("glEnablei(%u, %" PRIu32 ")", capability, index);
if (mImports.glEnablei == nullptr) {
GAPID_WARNING("Application called unsupported function glEnablei");
return;
}
bool called = false;
auto call = [this, observer, &called, capability, index] {
called = true;
observer->observeReads();
mImports.glEnablei(capability, index);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subEnablei(observer, call, capability, index);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlEnablei coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), capability, toEncoder< uint32_t >(index, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
uint32_t GlesSpy::glGetError(CallObserver* observer) {
GAPID_DEBUG("glGetError()");
if (mImports.glGetError == nullptr) {
GAPID_WARNING("Application called unsupported function glGetError");
return 0;
}
uint32_t result = 0;
bool called = false;
auto call = [this, observer, &called, &result] {
called = true;
observer->observeReads();
result = mImports.glGetError();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetError coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), result);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glDetachShader(CallObserver* observer, ProgramId program, ShaderId shader) {
GAPID_DEBUG("glDetachShader(%" PRIu32 ", %" PRIu32 ")", program, shader);
if (mImports.glDetachShader == nullptr) {
GAPID_WARNING("Application called unsupported function glDetachShader");
return;
}
bool called = false;
auto call = [this, observer, &called, program, shader] {
called = true;
observer->observeReads();
mImports.glDetachShader(program, shader);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckShader(observer, call, l_ctx, shader);
subCheckProgram(observer, call, l_ctx, program);
std::shared_ptr<Shader> l_s = findOrZero(checkNotNull(l_ctx).mInstances.mShaders, shader);
std::shared_ptr<Program> l_p = findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, program);
if ((!(checkNotNull(l_p).mShaders.count(checkNotNull(l_s).mType) > 0)) || ((findOrZero(checkNotNull(l_p).mShaders, checkNotNull(l_s).mType)) != (shader))) {
subGlErrorInvalidOperation(observer, call);
}
checkNotNull(l_p).mShaders.erase(checkNotNull(l_s).mType);
checkNotNull(l_s).mRefCount -= (GLuint)(1UL);
subReapShader(observer, call, l_ctx, shader, l_s);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDetachShader coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< uint32_t >(shader, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetActiveAttrib(CallObserver* observer, ProgramId program, AttributeIndex index, GLsizei buffer_size, GLsizei* buffer_bytes_written, GLint* vector_count, uint32_t* type, GLchar* name) {
GAPID_DEBUG("glGetActiveAttrib(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p, %p, %p, %p)", program, index, buffer_size, buffer_bytes_written, vector_count, type, name);
if (mImports.glGetActiveAttrib == nullptr) {
GAPID_WARNING("Application called unsupported function glGetActiveAttrib");
return;
}
bool called = false;
auto call = [this, observer, &called, program, index, buffer_size, buffer_bytes_written, vector_count, type, name] {
called = true;
observer->observeReads();
mImports.glGetActiveAttrib(program, index, buffer_size, buffer_bytes_written, vector_count, type, name);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
if ((buffer_size) < ((GLsizei)(0L))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckProgram(observer, call, l_ctx, program);
std::shared_ptr<Program> l_p = findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, program);
if (!(checkNotNull(l_p).mActiveAttributes.count(index) > 0)) {
subGlErrorInvalidValue(observer, call);
}
call();
subWriteString(observer, call, buffer_size, buffer_bytes_written, name);
observer->write<GLint>(slice(vector_count, 0ULL, 1ULL), 0ULL, (GLint)(slice(vector_count, 0ULL, 1ULL)[0ULL]));
observer->write<uint32_t>(slice(type, 0ULL, 1ULL), 0ULL, (uint32_t)(slice(type, 0ULL, 1ULL)[0ULL]));
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetActiveAttrib coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< int32_t >(buffer_size, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(buffer_bytes_written, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__P >(vector_count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__P >(type, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(name, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetActiveUniform(CallObserver* observer, ProgramId program, UniformIndex index, GLsizei buffer_size, GLsizei* buffer_bytes_written, GLint* vector_count, uint32_t* type, GLchar* name) {
GAPID_DEBUG("glGetActiveUniform(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p, %p, %p, %p)", program, index, buffer_size, buffer_bytes_written, vector_count, type, name);
if (mImports.glGetActiveUniform == nullptr) {
GAPID_WARNING("Application called unsupported function glGetActiveUniform");
return;
}
bool called = false;
auto call = [this, observer, &called, program, index, buffer_size, buffer_bytes_written, vector_count, type, name] {
called = true;
observer->observeReads();
mImports.glGetActiveUniform(program, index, buffer_size, buffer_bytes_written, vector_count, type, name);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckProgram(observer, call, l_ctx, program);
if ((buffer_size) < ((GLsizei)(0L))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<Program> l_p = findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, program);
if (!(checkNotNull(l_p).mActiveUniforms.count(index) > 0)) {
subGlErrorInvalidValue(observer, call);
}
call();
subWriteString(observer, call, buffer_size, buffer_bytes_written, name);
observer->write<GLint>(slice(vector_count, 0ULL, 1ULL), 0ULL, (GLint)(slice(vector_count, 0ULL, 1ULL)[0ULL]));
observer->write<uint32_t>(slice(type, 0ULL, 1ULL), 0ULL, (uint32_t)(slice(type, 0ULL, 1ULL)[0ULL]));
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetActiveUniform coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< int32_t >(buffer_size, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(buffer_bytes_written, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__P >(vector_count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__P >(type, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(name, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLboolean GlesSpy::glIsProgramPipeline(CallObserver* observer, PipelineId pipeline) {
GAPID_DEBUG("glIsProgramPipeline(%" PRIu32 ")", pipeline);
if (mImports.glIsProgramPipeline == nullptr) {
GAPID_WARNING("Application called unsupported function glIsProgramPipeline");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, pipeline] {
called = true;
observer->observeReads();
result = mImports.glIsProgramPipeline(pipeline);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlIsProgramPipeline coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, *observer->getScratch()), toEncoder< uint8_t >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glMemoryBarrier(CallObserver* observer, uint32_t barriers) {
GAPID_DEBUG("glMemoryBarrier(%u)", barriers);
if (mImports.glMemoryBarrier == nullptr) {
GAPID_WARNING("Application called unsupported function glMemoryBarrier");
return;
}
bool called = false;
auto call = [this, observer, &called, barriers] {
called = true;
observer->observeReads();
mImports.glMemoryBarrier(barriers);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subSupportsBits(observer, call, barriers, (GLbitfield::GL_ALL_BARRIER_BITS) | ((GLbitfield::GL_ATOMIC_COUNTER_BARRIER_BIT) | ((GLbitfield::GL_BUFFER_UPDATE_BARRIER_BIT) | ((GLbitfield::GL_COMMAND_BARRIER_BIT) | ((GLbitfield::GL_ELEMENT_ARRAY_BARRIER_BIT) | ((GLbitfield::GL_FRAMEBUFFER_BARRIER_BIT) | ((GLbitfield::GL_PIXEL_BUFFER_BARRIER_BIT) | ((GLbitfield::GL_SHADER_IMAGE_ACCESS_BARRIER_BIT) | ((GLbitfield::GL_SHADER_STORAGE_BARRIER_BIT) | ((GLbitfield::GL_TEXTURE_FETCH_BARRIER_BIT) | ((GLbitfield::GL_TEXTURE_UPDATE_BARRIER_BIT) | ((GLbitfield::GL_TRANSFORM_FEEDBACK_BARRIER_BIT) | ((GLbitfield::GL_UNIFORM_BARRIER_BIT) | (GLbitfield::GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT))))))))))))));
if ((barriers & GLbitfield::GL_ALL_BARRIER_BITS) != 0) {
}
if ((barriers & GLbitfield::GL_ATOMIC_COUNTER_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_BUFFER_UPDATE_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_COMMAND_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_ELEMENT_ARRAY_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_FRAMEBUFFER_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_PIXEL_BUFFER_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_SHADER_IMAGE_ACCESS_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_SHADER_STORAGE_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_TEXTURE_FETCH_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_TEXTURE_UPDATE_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_TRANSFORM_FEEDBACK_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_UNIFORM_BARRIER_BIT) != 0) {
}
if ((barriers & GLbitfield::GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT) != 0) {
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlMemoryBarrier coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), barriers);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform1i(CallObserver* observer, ProgramId program, UniformLocation location, GLint value0) {
GAPID_DEBUG("glProgramUniform1i(%" PRIu32 ", %" PRId32 ", %" PRId32 ")", program, location, value0);
if (mImports.glProgramUniform1i == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform1i");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value0] {
called = true;
observer->observeReads();
mImports.glProgramUniform1i(program, location, value0);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform1i(observer, call, program, location, value0);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform1i coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(value0, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform4f(CallObserver* observer, ProgramId program, UniformLocation location, GLfloat value0, GLfloat value1, GLfloat value2, GLfloat value3) {
GAPID_DEBUG("glProgramUniform4f(%" PRIu32 ", %" PRId32 ", %f, %f, %f, %f)", program, location, value0, value1, value2, value3);
if (mImports.glProgramUniform4f == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform4f");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value0, value1, value2, value3] {
called = true;
observer->observeReads();
mImports.glProgramUniform4f(program, location, value0, value1, value2, value3);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform4f(observer, call, program, location, value0, value1, value2, value3);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform4f coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< float >(value0, *observer->getScratch()), toEncoder< float >(value1, *observer->getScratch()), toEncoder< float >(value2, *observer->getScratch()), toEncoder< float >(value3, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniform4ui(CallObserver* observer, ProgramId program, UniformLocation location, GLuint value0, GLuint value1, GLuint value2, GLuint value3) {
GAPID_DEBUG("glProgramUniform4ui(%" PRIu32 ", %" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, location, value0, value1, value2, value3);
if (mImports.glProgramUniform4ui == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform4ui");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value0, value1, value2, value3] {
called = true;
observer->observeReads();
mImports.glProgramUniform4ui(program, location, value0, value1, value2, value3);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform4ui(observer, call, program, location, value0, value1, value2, value3);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniform4ui coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint32_t >(value0, *observer->getScratch()), toEncoder< uint32_t >(value1, *observer->getScratch()), toEncoder< uint32_t >(value2, *observer->getScratch()), toEncoder< uint32_t >(value3, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniformMatrix3x4fv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glProgramUniformMatrix3x4fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values);
if (mImports.glProgramUniformMatrix3x4fv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix3x4fv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix3x4fv(program, location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniformMatrix3x4fv(observer, call, program, location, count, transpose, values);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniformMatrix3x4fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glProgramUniformMatrix4x3fv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glProgramUniformMatrix4x3fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values);
if (mImports.glProgramUniformMatrix4x3fv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix4x3fv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix4x3fv(program, location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniformMatrix4x3fv(observer, call, program, location, count, transpose, values);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlProgramUniformMatrix4x3fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniform2fv(CallObserver* observer, UniformLocation location, GLsizei count, GLfloat* values) {
GAPID_DEBUG("glUniform2fv(%" PRId32 ", %" PRId32 ", %p)", location, count, values);
if (mImports.glUniform2fv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform2fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, values] {
called = true;
observer->observeReads();
mImports.glUniform2fv(location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<Vec2f> l_v = slice((Vec2f*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformv_Vec2f__S(observer, call, location, l_v, GLenum::GL_FLOAT_VEC2);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniform2fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniform2uiv(CallObserver* observer, UniformLocation location, GLsizei count, GLuint* values) {
GAPID_DEBUG("glUniform2uiv(%" PRId32 ", %" PRId32 ", %p)", location, count, values);
if (mImports.glUniform2uiv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform2uiv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, values] {
called = true;
observer->observeReads();
mImports.glUniform2uiv(location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Slice<Vec2u> l_v = slice((Vec2u*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformv_Vec2u__S(observer, call, location, l_v, GLenum::GL_UNSIGNED_INT_VEC2);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniform2uiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniform3iv(CallObserver* observer, UniformLocation location, GLsizei count, GLint* values) {
GAPID_DEBUG("glUniform3iv(%" PRId32 ", %" PRId32 ", %p)", location, count, values);
if (mImports.glUniform3iv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform3iv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, values] {
called = true;
observer->observeReads();
mImports.glUniform3iv(location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<Vec3i> l_v = slice((Vec3i*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformv_Vec3i__S(observer, call, location, l_v, GLenum::GL_INT_VEC3);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniform3iv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniformMatrix3fv(CallObserver* observer, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glUniformMatrix3fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values);
if (mImports.glUniformMatrix3fv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformMatrix3fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glUniformMatrix3fv(location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<Mat3f> l_v = slice((Mat3f*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformMatrixv_Mat3f__S(observer, call, location, transpose, l_v, GLenum::GL_FLOAT_MAT3);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniformMatrix3fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUseProgramStages(CallObserver* observer, PipelineId pipeline, uint32_t stages, ProgramId program) {
GAPID_DEBUG("glUseProgramStages(%" PRIu32 ", %u, %" PRIu32 ")", pipeline, stages, program);
if (mImports.glUseProgramStages == nullptr) {
GAPID_WARNING("Application called unsupported function glUseProgramStages");
return;
}
bool called = false;
auto call = [this, observer, &called, pipeline, stages, program] {
called = true;
observer->observeReads();
mImports.glUseProgramStages(pipeline, stages, program);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subSupportsBits(observer, call, stages, (GLbitfield::GL_ALL_SHADER_BITS) | ((GLbitfield::GL_COMPUTE_SHADER_BIT) | ((GLbitfield::GL_FRAGMENT_SHADER_BIT) | (GLbitfield::GL_VERTEX_SHADER_BIT))));
if ((stages & GLbitfield::GL_ALL_SHADER_BITS) != 0) {
}
if ((stages & GLbitfield::GL_COMPUTE_SHADER_BIT) != 0) {
}
if ((stages & GLbitfield::GL_FRAGMENT_SHADER_BIT) != 0) {
}
if ((stages & GLbitfield::GL_VERTEX_SHADER_BIT) != 0) {
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUseProgramStages coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, *observer->getScratch()), stages, toEncoder< uint32_t >(program, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glViewport(CallObserver* observer, GLint x, GLint y, GLsizei width, GLsizei height) {
GAPID_DEBUG("glViewport(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, width, height);
if (mImports.glViewport == nullptr) {
GAPID_WARNING("Application called unsupported function glViewport");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, width, height] {
called = true;
observer->observeReads();
mImports.glViewport(x, y, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
if (((width) < ((GLsizei)(0L))) || ((height) < ((GLsizei)(0L)))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mRasterization.mViewport = Rect(x, y, width, height);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlViewport coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, *observer->getScratch()), toEncoder< int32_t >(y, *observer->getScratch()), toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetBooleanv(CallObserver* observer, uint32_t param, GLboolean* values) {
GAPID_DEBUG("glGetBooleanv(%u, %p)", param, values);
if (mImports.glGetBooleanv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetBooleanv");
return;
}
bool called = false;
auto call = [this, observer, &called, param, values] {
called = true;
observer->observeReads();
mImports.glGetBooleanv(param, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
call();
subGetStateVariable_GLboolean(observer, call, param, false, (GLuint)(0UL), values);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetBooleanv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< gapic::coder::gles::GLboolean__P >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetInteger64i_v(CallObserver* observer, uint32_t param, GLuint index, GLint64* values) {
GAPID_DEBUG("glGetInteger64i_v(%u, %" PRIu32 ", %p)", param, index, values);
if (mImports.glGetInteger64i_v == nullptr) {
GAPID_WARNING("Application called unsupported function glGetInteger64i_v");
return;
}
bool called = false;
auto call = [this, observer, &called, param, index, values] {
called = true;
observer->observeReads();
mImports.glGetInteger64i_v(param, index, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
subGetStateVariable_GLint64(observer, call, param, true, index, values);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetInteger64i_v coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint64__P >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGenTextures(CallObserver* observer, GLsizei count, TextureId* textures) {
GAPID_DEBUG("glGenTextures(%" PRId32 ", %p)", count, textures);
if (mImports.glGenTextures == nullptr) {
GAPID_WARNING("Application called unsupported function glGenTextures");
return;
}
bool called = false;
auto call = [this, observer, &called, count, textures] {
called = true;
observer->observeReads();
mImports.glGenTextures(count, textures);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
if ((count) < ((GLsizei)(0L))) {
subGlErrorInvalidValue(observer, call);
}
Slice<TextureId> l_t = slice(textures, (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
call();
for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) {
TextureId l_id = (TextureId)(slice(textures, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]);
checkNotNull(l_ctx).mInstances.mTextures[l_id] = std::shared_ptr<Texture>(new Texture(l_id, 0, 0, 0, GLintToImage(), GLintToCubemapLevel(), GLenum::GL_RED, GLenum::GL_GREEN, GLenum::GL_BLUE, GLenum::GL_ALPHA, std::move(Vec4f{(GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f)}), GLenum::GL_NEAREST_MIPMAP_LINEAR, GLenum::GL_LINEAR, GLenum::GL_REPEAT, GLenum::GL_REPEAT, GLenum::GL_REPEAT, (GLfloat)(-1000.f), (GLfloat)(1000.f), (GLint)(0L), (GLint)(1000L), GLenum::GL_DEPTH_COMPONENT, GLenum::GL_NONE, GLenum::GL_LEQUAL, GLbooleanLabels::GL_FALSE, (GLuint)(0UL), "", (GLfloat)(1.f), nullptr));
observer->write<TextureId>(l_t, (uint64_t)(l_i), l_id);
}
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenTextures coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::TextureId__P >(textures, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetSamplerParameterIuiv(CallObserver* observer, SamplerId sampler, uint32_t pname, GLuint* params) {
GAPID_DEBUG("glGetSamplerParameterIuiv(%" PRIu32 ", %u, %p)", sampler, pname, params);
if (mImports.glGetSamplerParameterIuiv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetSamplerParameterIuiv");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, params] {
called = true;
observer->observeReads();
mImports.glGetSamplerParameterIuiv(sampler, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
call();
subGetSamplerParameterIuiv(observer, call, sampler, pname, params);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetSamplerParameterIuiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLuint__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glSamplerParameteri(CallObserver* observer, SamplerId sampler, uint32_t pname, GLint param) {
GAPID_DEBUG("glSamplerParameteri(%" PRIu32 ", %u, %" PRId32 ")", sampler, pname, param);
if (mImports.glSamplerParameteri == nullptr) {
GAPID_WARNING("Application called unsupported function glSamplerParameteri");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, param] {
called = true;
observer->observeReads();
mImports.glSamplerParameteri(sampler, pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Vec1i l_params = {param};
subSamplerParameterv_Vec1i(observer, call, sampler, pname, l_params);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlSamplerParameteri coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *observer->getScratch()), pname, toEncoder< int32_t >(param, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glResumeTransformFeedback(CallObserver* observer) {
GAPID_DEBUG("glResumeTransformFeedback()");
if (mImports.glResumeTransformFeedback == nullptr) {
GAPID_WARNING("Application called unsupported function glResumeTransformFeedback");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glResumeTransformFeedback();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
std::shared_ptr<TransformFeedback> l__res_0 = subGetBoundTransformFeedback(observer, call);
checkNotNull(l__res_0).mPaused = (GLboolean)(0U);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlResumeTransformFeedback coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTransformFeedbackVaryings(CallObserver* observer, ProgramId program, GLsizei count, GLchar** varyings, uint32_t bufferMode) {
GAPID_DEBUG("glTransformFeedbackVaryings(%" PRIu32 ", %" PRId32 ", %p, %u)", program, count, varyings, bufferMode);
if (mImports.glTransformFeedbackVaryings == nullptr) {
GAPID_WARNING("Application called unsupported function glTransformFeedbackVaryings");
return;
}
bool called = false;
auto call = [this, observer, &called, program, count, varyings, bufferMode] {
called = true;
observer->observeReads();
mImports.glTransformFeedbackVaryings(program, count, varyings, bufferMode);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (bufferMode) {
case GLenum::GL_INTERLEAVED_ATTRIBS: // fall-through...
case GLenum::GL_SEPARATE_ATTRIBS: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, bufferMode);
}
}
Slice<GLchar*> l_names = slice(varyings, (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) {
(void)observer->string((char*)(observer->read(l_names, (uint64_t)(l_i))));
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTransformFeedbackVaryings coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__CP__CP >(varyings, *observer->getScratch()), bufferMode);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBindVertexArray(CallObserver* observer, VertexArrayId array) {
GAPID_DEBUG("glBindVertexArray(%" PRIu32 ")", array);
if (mImports.glBindVertexArray == nullptr) {
GAPID_WARNING("Application called unsupported function glBindVertexArray");
return;
}
bool called = false;
auto call = [this, observer, &called, array] {
called = true;
observer->observeReads();
mImports.glBindVertexArray(array);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subBindVertexArray(observer, call, array);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBindVertexArray coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(array, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGenVertexArrays(CallObserver* observer, GLsizei count, VertexArrayId* arrays) {
GAPID_DEBUG("glGenVertexArrays(%" PRId32 ", %p)", count, arrays);
if (mImports.glGenVertexArrays == nullptr) {
GAPID_WARNING("Application called unsupported function glGenVertexArrays");
return;
}
bool called = false;
auto call = [this, observer, &called, count, arrays] {
called = true;
observer->observeReads();
mImports.glGenVertexArrays(count, arrays);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
subGenVertexArrays(observer, call, count, arrays);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenVertexArrays coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::VertexArrayId__P >(arrays, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetVertexAttribfv(CallObserver* observer, AttributeLocation index, uint32_t pname, GLfloat* params) {
GAPID_DEBUG("glGetVertexAttribfv(%" PRIu32 ", %u, %p)", index, pname, params);
if (mImports.glGetVertexAttribfv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetVertexAttribfv");
return;
}
bool called = false;
auto call = [this, observer, &called, index, pname, params] {
called = true;
observer->observeReads();
mImports.glGetVertexAttribfv(index, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
if ((index) >= ((AttributeLocation)(checkNotNull(l_ctx).mConstants.mMaxVertexAttribs))) {
subGlErrorInvalidValue(observer, call);
}
call();
if ((pname) == (GLenum::GL_CURRENT_VERTEX_ATTRIB)) {
observer->write(slice(params, 0ULL, 4ULL));
} else {
uint64_t l__res_0 = subGetVertexAttrib(observer, call, l_ctx, index, pname);
observer->write<GLfloat>(slice(params, 0ULL, 1ULL), 0ULL, (GLfloat)(l__res_0));
}
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetVertexAttribfv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLfloat__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glVertexAttrib2f(CallObserver* observer, AttributeLocation location, GLfloat value0, GLfloat value1) {
GAPID_DEBUG("glVertexAttrib2f(%" PRIu32 ", %f, %f)", location, value0, value1);
if (mImports.glVertexAttrib2f == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttrib2f");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value0, value1] {
called = true;
observer->observeReads();
mImports.glVertexAttrib2f(location, value0, value1);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
subVertexAttribF(observer, call, location, std::move(Vec4f{value0, value1, (GLfloat)(0.f), (GLfloat)(1.f)}));
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlVertexAttrib2f coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, *observer->getScratch()), toEncoder< float >(value0, *observer->getScratch()), toEncoder< float >(value1, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glVertexAttribI4i(CallObserver* observer, AttributeLocation index, GLint x, GLint y, GLint z, GLint w) {
GAPID_DEBUG("glVertexAttribI4i(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", index, x, y, z, w);
if (mImports.glVertexAttribI4i == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttribI4i");
return;
}
bool called = false;
auto call = [this, observer, &called, index, x, y, z, w] {
called = true;
observer->observeReads();
mImports.glVertexAttribI4i(index, x, y, z, w);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subVertexAttribI(observer, call, index, std::move(Vec4i{x, y, z, w}));
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlVertexAttribI4i coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< int32_t >(x, *observer->getScratch()), toEncoder< int32_t >(y, *observer->getScratch()), toEncoder< int32_t >(z, *observer->getScratch()), toEncoder< int32_t >(w, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
Bool GlesSpy::glXMakeContextCurrent(CallObserver* observer, void* display, GLXDrawable draw, GLXDrawable read, GLXContext ctx) {
GAPID_DEBUG("glXMakeContextCurrent(%p, %p, %p, %p)", display, draw, read, ctx);
if (mImports.glXMakeContextCurrent == nullptr) {
GAPID_WARNING("Application called unsupported function glXMakeContextCurrent");
return 0;
}
Bool result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, draw, read, ctx] {
called = true;
observer->observeReads();
result = mImports.glXMakeContextCurrent(display, draw, read, ctx);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subSetContext(observer, call, findOrZero(this->GLXContexts, ctx));
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlXMakeContextCurrent coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__P >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::GLXDrawable >(draw, *observer->getScratch()), toEncoder< gapic::coder::gles::GLXDrawable >(read, *observer->getScratch()), toEncoder< gapic::coder::gles::GLXContext >(ctx, *observer->getScratch()), toEncoder< int >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
int GlesSpy::glXQueryDrawable(CallObserver* observer, void* display, GLXDrawable draw, int attribute, int* value) {
GAPID_DEBUG("glXQueryDrawable(%p, %p, %d, %p)", display, draw, attribute, value);
if (mImports.glXQueryDrawable == nullptr) {
GAPID_WARNING("Application called unsupported function glXQueryDrawable");
return 0;
}
int result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, draw, attribute, value] {
called = true;
observer->observeReads();
result = mImports.glXQueryDrawable(display, draw, attribute, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
observer->write<int>(slice(value, 0ULL, 1ULL), 0ULL, slice(value, 0ULL, 1ULL)[0ULL]);
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlXQueryDrawable coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__P >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::GLXDrawable >(draw, *observer->getScratch()), attribute, toEncoder< gapic::coder::gles::Int__P >(value, *observer->getScratch()), result);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
HGLRC GlesSpy::wglCreateContextAttribsARB(CallObserver* observer, HDC hdc, HGLRC hShareContext, int* attribList) {
GAPID_DEBUG("wglCreateContextAttribsARB(%p, %p, %p)", hdc, hShareContext, attribList);
if (mImports.wglCreateContextAttribsARB == nullptr) {
GAPID_WARNING("Application called unsupported function wglCreateContextAttribsARB");
return nullptr;
}
HGLRC result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, hdc, hShareContext, attribList] {
called = true;
observer->observeReads();
result = mImports.wglCreateContextAttribsARB(hdc, hShareContext, attribList);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
auto l_context = result;
std::shared_ptr<Context> l__res_0 = subCreateContext(observer, call);
this->WGLContexts[l_context] = l__res_0;
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::WglCreateContextAttribsARB coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::HDC >(hdc, *observer->getScratch()), toEncoder< gapic::coder::gles::HGLRC >(hShareContext, *observer->getScratch()), toEncoder< gapic::coder::gles::Int__P >(attribList, *observer->getScratch()), toEncoder< gapic::coder::gles::HGLRC >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
BOOL GlesSpy::wglMakeCurrent(CallObserver* observer, HDC hdc, HGLRC hglrc) {
GAPID_DEBUG("wglMakeCurrent(%p, %p)", hdc, hglrc);
if (mImports.wglMakeCurrent == nullptr) {
GAPID_WARNING("Application called unsupported function wglMakeCurrent");
return 0;
}
BOOL result = 0;
bool called = false;
auto call = [this, observer, &called, &result, hdc, hglrc] {
called = true;
observer->observeReads();
result = mImports.wglMakeCurrent(hdc, hglrc);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subSetContext(observer, call, findOrZero(this->WGLContexts, hglrc));
call();
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::WglMakeCurrent coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::HDC >(hdc, *observer->getScratch()), toEncoder< gapic::coder::gles::HGLRC >(hglrc, *observer->getScratch()), toEncoder< int >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
CGLError GlesSpy::CGLCreateContext(CallObserver* observer, CGLTexelFormatObj pix, CGLContextObj share, CGLContextObj* ctx) {
GAPID_DEBUG("CGLCreateContext(%p, %p, %p)", pix, share, ctx);
if (mImports.CGLCreateContext == nullptr) {
GAPID_WARNING("Application called unsupported function CGLCreateContext");
return 0;
}
CGLError result = 0;
bool called = false;
auto call = [this, observer, &called, &result, pix, share, ctx] {
called = true;
observer->observeReads();
result = mImports.CGLCreateContext(pix, share, ctx);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
auto l_context = slice(ctx, 0ULL, 1ULL)[0ULL];
std::shared_ptr<Context> l__res_0 = subCreateContext(observer, call);
this->CGLContexts[l_context] = l__res_0;
observer->write<CGLContextObj>(slice(ctx, 0ULL, 1ULL), 0ULL, l_context);
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::CGLCreateContext coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::CGLTexelFormatObj >(pix, *observer->getScratch()), toEncoder< gapic::coder::gles::CGLContextObj >(share, *observer->getScratch()), toEncoder< gapic::coder::gles::CGLContextObj__P >(ctx, *observer->getScratch()), toEncoder< int >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glGetQueryObjecti64v(CallObserver* observer, QueryId query, uint32_t parameter, int64_t* value) {
GAPID_DEBUG("glGetQueryObjecti64v(%" PRIu32 ", %u, %p)", query, parameter, value);
if (mImports.glGetQueryObjecti64v == nullptr) {
GAPID_WARNING("Application called unsupported function glGetQueryObjecti64v");
return;
}
bool called = false;
auto call = [this, observer, &called, query, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetQueryObjecti64v(query, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
observer->write<int64_t>(slice(value, 0ULL, 1ULL), 0ULL, slice(value, 0ULL, 1ULL)[0ULL]);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetQueryObjecti64v coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, *observer->getScratch()), parameter, toEncoder< gapic::coder::gles::S64__P >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glAlphaFunc(CallObserver* observer, uint32_t func, GLfloat ref) {
GAPID_DEBUG("glAlphaFunc(%u, %f)", func, ref);
if (mImports.glAlphaFunc == nullptr) {
GAPID_WARNING("Application called unsupported function glAlphaFunc");
return;
}
bool called = false;
auto call = [this, observer, &called, func, ref] {
called = true;
observer->observeReads();
mImports.glAlphaFunc(func, ref);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlAlphaFunc coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), func, toEncoder< float >(ref, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBindRenderbufferOES(CallObserver* observer, uint32_t target, GLuint renderbuffer) {
GAPID_DEBUG("glBindRenderbufferOES(%u, %" PRIu32 ")", target, renderbuffer);
if (mImports.glBindRenderbufferOES == nullptr) {
GAPID_WARNING("Application called unsupported function glBindRenderbufferOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, renderbuffer] {
called = true;
observer->observeReads();
mImports.glBindRenderbufferOES(target, renderbuffer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_framebuffer_object);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBindRenderbufferOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(renderbuffer, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBlendEquationOES(CallObserver* observer, uint32_t mode) {
GAPID_DEBUG("glBlendEquationOES(%u)", mode);
if (mImports.glBlendEquationOES == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendEquationOES");
return;
}
bool called = false;
auto call = [this, observer, &called, mode] {
called = true;
observer->observeReads();
mImports.glBlendEquationOES(mode);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_blend_subtract);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlendEquationOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glClipPlanef(CallObserver* observer, uint32_t p, GLfloat* eqn) {
GAPID_DEBUG("glClipPlanef(%u, %p)", p, eqn);
if (mImports.glClipPlanef == nullptr) {
GAPID_WARNING("Application called unsupported function glClipPlanef");
return;
}
bool called = false;
auto call = [this, observer, &called, p, eqn] {
called = true;
observer->observeReads();
mImports.glClipPlanef(p, eqn);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlClipPlanef coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), p, toEncoder< gapic::coder::gles::GLfloat__CP >(eqn, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glColor4ub(CallObserver* observer, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
GAPID_DEBUG("glColor4ub(%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", red, green, blue, alpha);
if (mImports.glColor4ub == nullptr) {
GAPID_WARNING("Application called unsupported function glColor4ub");
return;
}
bool called = false;
auto call = [this, observer, &called, red, green, blue, alpha] {
called = true;
observer->observeReads();
mImports.glColor4ub(red, green, blue, alpha);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlColor4ub coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint8_t >(red, *observer->getScratch()), toEncoder< uint8_t >(green, *observer->getScratch()), toEncoder< uint8_t >(blue, *observer->getScratch()), toEncoder< uint8_t >(alpha, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glCurrentPaletteMatrixOES(CallObserver* observer, GLuint matrixpaletteindex) {
GAPID_DEBUG("glCurrentPaletteMatrixOES(%" PRIu32 ")", matrixpaletteindex);
if (mImports.glCurrentPaletteMatrixOES == nullptr) {
GAPID_WARNING("Application called unsupported function glCurrentPaletteMatrixOES");
return;
}
bool called = false;
auto call = [this, observer, &called, matrixpaletteindex] {
called = true;
observer->observeReads();
mImports.glCurrentPaletteMatrixOES(matrixpaletteindex);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_matrix_palette);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlCurrentPaletteMatrixOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(matrixpaletteindex, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glDrawTexxvOES(CallObserver* observer, GLfixed* coords) {
GAPID_DEBUG("glDrawTexxvOES(%p)", coords);
if (mImports.glDrawTexxvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawTexxvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, coords] {
called = true;
observer->observeReads();
mImports.glDrawTexxvOES(coords);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_draw_texture);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDrawTexxvOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLfixed__CP >(coords, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
onPostDrawCall();
}
void GlesSpy::glFogf(CallObserver* observer, uint32_t pname, GLfloat param) {
GAPID_DEBUG("glFogf(%u, %f)", pname, param);
if (mImports.glFogf == nullptr) {
GAPID_WARNING("Application called unsupported function glFogf");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, param] {
called = true;
observer->observeReads();
mImports.glFogf(pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFogf coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< float >(param, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glFogxv(CallObserver* observer, uint32_t pname, GLfixed* param) {
GAPID_DEBUG("glFogxv(%u, %p)", pname, param);
if (mImports.glFogxv == nullptr) {
GAPID_WARNING("Application called unsupported function glFogxv");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, param] {
called = true;
observer->observeReads();
mImports.glFogxv(pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFogxv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< gapic::coder::gles::GLfixed__CP >(param, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glFrustumx(CallObserver* observer, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
GAPID_DEBUG("glFrustumx(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", l, r, b, t, n, f);
if (mImports.glFrustumx == nullptr) {
GAPID_WARNING("Application called unsupported function glFrustumx");
return;
}
bool called = false;
auto call = [this, observer, &called, l, r, b, t, n, f] {
called = true;
observer->observeReads();
mImports.glFrustumx(l, r, b, t, n, f);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFrustumx coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(l, *observer->getScratch()), toEncoder< int32_t >(r, *observer->getScratch()), toEncoder< int32_t >(b, *observer->getScratch()), toEncoder< int32_t >(t, *observer->getScratch()), toEncoder< int32_t >(n, *observer->getScratch()), toEncoder< int32_t >(f, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGenRenderbuffersOES(CallObserver* observer, GLsizei n, GLuint* renderbuffers) {
GAPID_DEBUG("glGenRenderbuffersOES(%" PRId32 ", %p)", n, renderbuffers);
if (mImports.glGenRenderbuffersOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGenRenderbuffersOES");
return;
}
bool called = false;
auto call = [this, observer, &called, n, renderbuffers] {
called = true;
observer->observeReads();
mImports.glGenRenderbuffersOES(n, renderbuffers);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_framebuffer_object);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenRenderbuffersOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(renderbuffers, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetLightxv(CallObserver* observer, uint32_t light, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glGetLightxv(%u, %u, %p)", light, pname, params);
if (mImports.glGetLightxv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetLightxv");
return;
}
bool called = false;
auto call = [this, observer, &called, light, pname, params] {
called = true;
observer->observeReads();
mImports.glGetLightxv(light, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetLightxv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), light, pname, toEncoder< gapic::coder::gles::GLfixed__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetTexParameterxv(CallObserver* observer, uint32_t target, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glGetTexParameterxv(%u, %u, %p)", target, pname, params);
if (mImports.glGetTexParameterxv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexParameterxv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexParameterxv(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetTexParameterxv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLfixed__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glLineWidthx(CallObserver* observer, GLfixed width) {
GAPID_DEBUG("glLineWidthx(%" PRId32 ")", width);
if (mImports.glLineWidthx == nullptr) {
GAPID_WARNING("Application called unsupported function glLineWidthx");
return;
}
bool called = false;
auto call = [this, observer, &called, width] {
called = true;
observer->observeReads();
mImports.glLineWidthx(width);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlLineWidthx coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(width, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glMultMatrixxOES(CallObserver* observer, GLfixed* m) {
GAPID_DEBUG("glMultMatrixxOES(%p)", m);
if (mImports.glMultMatrixxOES == nullptr) {
GAPID_WARNING("Application called unsupported function glMultMatrixxOES");
return;
}
bool called = false;
auto call = [this, observer, &called, m] {
called = true;
observer->observeReads();
mImports.glMultMatrixxOES(m);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_fixed_point);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlMultMatrixxOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLfixed__CP >(m, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glNormal3f(CallObserver* observer, GLfloat nx, GLfloat ny, GLfloat nz) {
GAPID_DEBUG("glNormal3f(%f, %f, %f)", nx, ny, nz);
if (mImports.glNormal3f == nullptr) {
GAPID_WARNING("Application called unsupported function glNormal3f");
return;
}
bool called = false;
auto call = [this, observer, &called, nx, ny, nz] {
called = true;
observer->observeReads();
mImports.glNormal3f(nx, ny, nz);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlNormal3f coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(nx, *observer->getScratch()), toEncoder< float >(ny, *observer->getScratch()), toEncoder< float >(nz, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glPopMatrix(CallObserver* observer) {
GAPID_DEBUG("glPopMatrix()");
if (mImports.glPopMatrix == nullptr) {
GAPID_WARNING("Application called unsupported function glPopMatrix");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glPopMatrix();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlPopMatrix coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexEnvf(CallObserver* observer, uint32_t target, uint32_t pname, GLfloat param) {
GAPID_DEBUG("glTexEnvf(%u, %u, %f)", target, pname, param);
if (mImports.glTexEnvf == nullptr) {
GAPID_WARNING("Application called unsupported function glTexEnvf");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, param] {
called = true;
observer->observeReads();
mImports.glTexEnvf(target, pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexEnvf coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< float >(param, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexEnvxv(CallObserver* observer, uint32_t target, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glTexEnvxv(%u, %u, %p)", target, pname, params);
if (mImports.glTexEnvxv == nullptr) {
GAPID_WARNING("Application called unsupported function glTexEnvxv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glTexEnvxv(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexEnvxv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLfixed__CP >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexGenfvOES(CallObserver* observer, uint32_t coord, uint32_t pname, GLfloat* params) {
GAPID_DEBUG("glTexGenfvOES(%u, %u, %p)", coord, pname, params);
if (mImports.glTexGenfvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTexGenfvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, coord, pname, params] {
called = true;
observer->observeReads();
mImports.glTexGenfvOES(coord, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_cube_map);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexGenfvOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), coord, pname, toEncoder< gapic::coder::gles::GLfloat__CP >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTranslatex(CallObserver* observer, GLfixed x, GLfixed y, GLfixed z) {
GAPID_DEBUG("glTranslatex(%" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, z);
if (mImports.glTranslatex == nullptr) {
GAPID_WARNING("Application called unsupported function glTranslatex");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, z] {
called = true;
observer->observeReads();
mImports.glTranslatex(x, y, z);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTranslatex coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, *observer->getScratch()), toEncoder< int32_t >(y, *observer->getScratch()), toEncoder< int32_t >(z, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glWeightPointerOES(CallObserver* observer, GLint size, uint32_t type, GLsizei stride, void* pointer) {
GAPID_DEBUG("glWeightPointerOES(%" PRId32 ", %u, %" PRId32 ", %p)", size, type, stride, pointer);
if (mImports.glWeightPointerOES == nullptr) {
GAPID_WARNING("Application called unsupported function glWeightPointerOES");
return;
}
bool called = false;
auto call = [this, observer, &called, size, type, stride, pointer] {
called = true;
observer->observeReads();
mImports.glWeightPointerOES(size, type, stride, pointer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_matrix_palette);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlWeightPointerOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(size, *observer->getScratch()), type, toEncoder< int32_t >(stride, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__CP >(pointer, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glVertexPointerBounds(CallObserver* observer, GLint size, uint32_t type, GLsizei stride, void* pointer, GLsizei count) {
GAPID_DEBUG("glVertexPointerBounds(%" PRId32 ", %u, %" PRId32 ", %p, %" PRId32 ")", size, type, stride, pointer, count);
if (mImports.glVertexPointerBounds == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexPointerBounds");
return;
}
bool called = false;
auto call = [this, observer, &called, size, type, stride, pointer, count] {
called = true;
observer->observeReads();
mImports.glVertexPointerBounds(size, type, stride, pointer, count);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlVertexPointerBounds coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(size, *observer->getScratch()), type, toEncoder< int32_t >(stride, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__CP >(pointer, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::contextInfo(CallObserver* observer, uint32_t constant_count, uint32_t* constant_names, uint32_t* constant_offsets, uint32_t* constant_sizes, uint8_t* constant_data, GLsizei backbuffer_width, GLsizei backbuffer_height, uint32_t backbuffer_color_fmt, uint32_t backbuffer_depth_fmt, uint32_t backbuffer_stencil_fmt, bool reset_viewport_scissor, bool preserve_buffers_on_swap) {
GAPID_DEBUG("contextInfo(%" PRIu32 ", %p, %p, %p, %p, %" PRId32 ", %" PRId32 ", %u, %u, %u, %d, %d)", constant_count, constant_names, constant_offsets, constant_sizes, constant_data, backbuffer_width, backbuffer_height, backbuffer_color_fmt, backbuffer_depth_fmt, backbuffer_stencil_fmt, reset_viewport_scissor, preserve_buffers_on_swap);
bool called = false;
auto call = [this, observer, &called, constant_count, constant_names, constant_offsets, constant_sizes, constant_data, backbuffer_width, backbuffer_height, backbuffer_color_fmt, backbuffer_depth_fmt, backbuffer_stencil_fmt, reset_viewport_scissor, preserve_buffers_on_swap] {
called = true;
observer->observeReads();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::ContextInfo coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), constant_count, toEncoder< gapic::coder::gles::GLenum__P >(constant_names, *observer->getScratch()), toEncoder< gapic::coder::gles::U32__P >(constant_offsets, *observer->getScratch()), toEncoder< gapic::coder::gles::U32__P >(constant_sizes, *observer->getScratch()), toEncoder< gapic::coder::gles::U8__P >(constant_data, *observer->getScratch()), toEncoder< int32_t >(backbuffer_width, *observer->getScratch()), toEncoder< int32_t >(backbuffer_height, *observer->getScratch()), backbuffer_color_fmt, backbuffer_depth_fmt, backbuffer_stencil_fmt, reset_viewport_scissor, preserve_buffers_on_swap);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
} // namespace gapii