blob: a381ea6ccfc51fb9025e4dfe4735ecbb6bbcca35 [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::glBlendEquationiEXT(CallObserver* observer, DrawBufferIndex buf, uint32_t mode) {
GAPID_DEBUG("glBlendEquationiEXT(%" PRIu32 ", %u)", buf, mode);
if (mImports.glBlendEquationiEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendEquationiEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, buf, mode] {
called = true;
observer->observeReads();
mImports.glBlendEquationiEXT(buf, mode);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_buffers_indexed);
subBlendEquationi(observer, call, buf, mode);
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::GlBlendEquationiEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buf, *observer->getScratch()), 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::glBlendFunciEXT(CallObserver* observer, DrawBufferIndex buf, uint32_t src, uint32_t dst) {
GAPID_DEBUG("glBlendFunciEXT(%" PRIu32 ", %u, %u)", buf, src, dst);
if (mImports.glBlendFunciEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendFunciEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, buf, src, dst] {
called = true;
observer->observeReads();
mImports.glBlendFunciEXT(buf, src, dst);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_buffers_indexed);
subBlendFunci(observer, call, buf, src, dst);
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::GlBlendFunciEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buf, *observer->getScratch()), src, dst);
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::glCopyImageSubDataEXT(CallObserver* observer, GLuint srcName, uint32_t srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, uint32_t dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) {
GAPID_DEBUG("glCopyImageSubDataEXT(%" PRIu32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
if (mImports.glCopyImageSubDataEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glCopyImageSubDataEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth] {
called = true;
observer->observeReads();
mImports.glCopyImageSubDataEXT(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_copy_image);
subCopyImageSubData(observer, call, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
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::GlCopyImageSubDataEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(srcName, *observer->getScratch()), srcTarget, toEncoder< int32_t >(srcLevel, *observer->getScratch()), toEncoder< int32_t >(srcX, *observer->getScratch()), toEncoder< int32_t >(srcY, *observer->getScratch()), toEncoder< int32_t >(srcZ, *observer->getScratch()), toEncoder< uint32_t >(dstName, *observer->getScratch()), dstTarget, toEncoder< int32_t >(dstLevel, *observer->getScratch()), toEncoder< int32_t >(dstX, *observer->getScratch()), toEncoder< int32_t >(dstY, *observer->getScratch()), toEncoder< int32_t >(dstZ, *observer->getScratch()), toEncoder< int32_t >(srcWidth, *observer->getScratch()), toEncoder< int32_t >(srcHeight, *observer->getScratch()), toEncoder< int32_t >(srcDepth, *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::glGetDebugMessageLogKHR(CallObserver* observer, GLuint count, GLsizei bufSize, uint32_t* sources, uint32_t* types, GLuint* ids, uint32_t* severities, GLsizei* lengths, GLchar* messageLog) {
GAPID_DEBUG("glGetDebugMessageLogKHR(%" PRIu32 ", %" PRId32 ", %p, %p, %p, %p, %p, %p)", count, bufSize, sources, types, ids, severities, lengths, messageLog);
if (mImports.glGetDebugMessageLogKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glGetDebugMessageLogKHR");
return 0;
}
GLuint result = 0;
bool called = false;
auto call = [this, observer, &called, &result, count, bufSize, sources, types, ids, severities, lengths, messageLog] {
called = true;
observer->observeReads();
result = mImports.glGetDebugMessageLogKHR(count, bufSize, sources, types, ids, severities, lengths, messageLog);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
call();
auto l_l = result;
subGetDebugMessageLog(observer, call, count, bufSize, sources, types, ids, severities, lengths, messageLog, l_l);
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::GlGetDebugMessageLogKHR coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(count, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__P >(sources, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__P >(types, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(ids, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__P >(severities, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(lengths, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(messageLog, *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::glGetTexParameterIivEXT(CallObserver* observer, uint32_t target, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetTexParameterIivEXT(%u, %u, %p)", target, pname, params);
if (mImports.glGetTexParameterIivEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexParameterIivEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexParameterIivEXT(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_texture_border_clamp);
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
subGetTexParameterIiv(observer, call, target, 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::GlGetTexParameterIivEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, 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);
}
GLboolean GlesSpy::glIsEnablediEXT(CallObserver* observer, uint32_t target, GLuint index) {
GAPID_DEBUG("glIsEnablediEXT(%u, %" PRIu32 ")", target, index);
if (mImports.glIsEnablediEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glIsEnablediEXT");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, target, index] {
called = true;
observer->observeReads();
result = mImports.glIsEnablediEXT(target, index);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_buffers_indexed);
GLboolean l__res_0 = subIsEnabledi(observer, call, target, index);
call();
if (UNLIKELY(shouldComputeExpectedReturn())) {
setExpectedReturn<GLboolean>(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::GlIsEnablediEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, *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::glPatchParameteriEXT(CallObserver* observer, uint32_t pname, GLint value) {
GAPID_DEBUG("glPatchParameteriEXT(%u, %" PRId32 ")", pname, value);
if (mImports.glPatchParameteriEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glPatchParameteriEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, value] {
called = true;
observer->observeReads();
mImports.glPatchParameteriEXT(pname, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_tessellation_shader);
subPatchParameteri(observer, call, pname, 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::GlPatchParameteriEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< int32_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::glBeginQuery(CallObserver* observer, uint32_t target, QueryId query) {
GAPID_DEBUG("glBeginQuery(%u, %" PRIu32 ")", target, query);
if (mImports.glBeginQuery == nullptr) {
GAPID_WARNING("Application called unsupported function glBeginQuery");
return;
}
bool called = false;
auto call = [this, observer, &called, target, query] {
called = true;
observer->observeReads();
mImports.glBeginQuery(target, query);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (target) {
case GLenum::GL_ANY_SAMPLES_PASSED: // fall-through...
case GLenum::GL_ANY_SAMPLES_PASSED_CONSERVATIVE: // fall-through...
case GLenum::GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: {
break;
}
case GLenum::GL_PRIMITIVES_GENERATED: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, target);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mActiveQueries[target] = 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::GlBeginQuery coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(query, *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::glEndQuery(CallObserver* observer, uint32_t target) {
GAPID_DEBUG("glEndQuery(%u)", target);
if (mImports.glEndQuery == nullptr) {
GAPID_WARNING("Application called unsupported function glEndQuery");
return;
}
bool called = false;
auto call = [this, observer, &called, target] {
called = true;
observer->observeReads();
mImports.glEndQuery(target);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (target) {
case GLenum::GL_ANY_SAMPLES_PASSED: // fall-through...
case GLenum::GL_ANY_SAMPLES_PASSED_CONSERVATIVE: // fall-through...
case GLenum::GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: {
break;
}
case GLenum::GL_PRIMITIVES_GENERATED: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, target);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mActiveQueries.erase(target);
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::GlEndQuery coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target);
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::glGetBufferPointerv(CallObserver* observer, uint32_t target, uint32_t pname, void** params) {
GAPID_DEBUG("glGetBufferPointerv(%u, %u, %p)", target, pname, params);
if (mImports.glGetBufferPointerv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetBufferPointerv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetBufferPointerv(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
subGetBufferPointerv(observer, call, target, 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::GlGetBufferPointerv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, 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);
}
void GlesSpy::glDebugMessageControl(CallObserver* observer, uint32_t source, uint32_t type, uint32_t severity, GLsizei count, GLuint* ids, GLboolean enabled) {
GAPID_DEBUG("glDebugMessageControl(%u, %u, %u, %" PRId32 ", %p, %" PRIu8 ")", source, type, severity, count, ids, enabled);
if (mImports.glDebugMessageControl == nullptr) {
GAPID_WARNING("Application called unsupported function glDebugMessageControl");
return;
}
bool called = false;
auto call = [this, observer, &called, source, type, severity, count, ids, enabled] {
called = true;
observer->observeReads();
mImports.glDebugMessageControl(source, type, severity, count, ids, enabled);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subDebugMessageControl(observer, call, source, type, severity, count, ids, enabled);
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::GlDebugMessageControl coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), source, type, severity, toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__CP >(ids, *observer->getScratch()), toEncoder< uint8_t >(enabled, *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::glGetObjectLabel(CallObserver* observer, uint32_t identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label) {
GAPID_DEBUG("glGetObjectLabel(%u, %" PRIu32 ", %" PRId32 ", %p, %p)", identifier, name, bufSize, length, label);
if (mImports.glGetObjectLabel == nullptr) {
GAPID_WARNING("Application called unsupported function glGetObjectLabel");
return;
}
bool called = false;
auto call = [this, observer, &called, identifier, name, bufSize, length, label] {
called = true;
observer->observeReads();
mImports.glGetObjectLabel(identifier, name, bufSize, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
call();
subGetObjectLabel(observer, call, identifier, name, 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::GlGetObjectLabel coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), identifier, toEncoder< uint32_t >(name, *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::glObjectPtrLabel(CallObserver* observer, void* ptr, GLsizei length, GLchar* label) {
GAPID_DEBUG("glObjectPtrLabel(%p, %" PRId32 ", %p)", ptr, length, label);
if (mImports.glObjectPtrLabel == nullptr) {
GAPID_WARNING("Application called unsupported function glObjectPtrLabel");
return;
}
bool called = false;
auto call = [this, observer, &called, ptr, length, label] {
called = true;
observer->observeReads();
mImports.glObjectPtrLabel(ptr, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subObjectPtrLabel(observer, call, ptr, 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::GlObjectPtrLabel coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__CP >(ptr, *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::glDrawElements(CallObserver* observer, uint32_t draw_mode, GLsizei indices_count, uint32_t indices_type, IndicesPointer indices) {
GAPID_DEBUG("glDrawElements(%u, %" PRId32 ", %u, %p)", draw_mode, indices_count, indices_type, indices);
if (mImports.glDrawElements == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawElements");
return;
}
bool called = false;
auto call = [this, observer, &called, draw_mode, indices_count, indices_type, indices] {
called = true;
observer->observeReads();
mImports.glDrawElements(draw_mode, indices_count, indices_type, indices);
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);
subDrawElements(observer, call, l_ctx, draw_mode, indices_count, indices_type, indices, (GLsizei)(1L), (GLint)(0L));
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::GlDrawElements coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), draw_mode, toEncoder< int32_t >(indices_count, *observer->getScratch()), indices_type, toEncoder< gapic::coder::gles::IndicesPointer >(indices, *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::glDrawElementsInstancedBaseVertex(CallObserver* observer, uint32_t draw_mode, GLsizei indices_count, uint32_t indices_type, IndicesPointer indices, GLsizei instance_count, GLint base_vertex) {
GAPID_DEBUG("glDrawElementsInstancedBaseVertex(%u, %" PRId32 ", %u, %p, %" PRId32 ", %" PRId32 ")", draw_mode, indices_count, indices_type, indices, instance_count, base_vertex);
if (mImports.glDrawElementsInstancedBaseVertex == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawElementsInstancedBaseVertex");
return;
}
bool called = false;
auto call = [this, observer, &called, draw_mode, indices_count, indices_type, indices, instance_count, base_vertex] {
called = true;
observer->observeReads();
mImports.glDrawElementsInstancedBaseVertex(draw_mode, indices_count, indices_type, indices, instance_count, base_vertex);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subDrawElementsInstancedBaseVertex(observer, call, draw_mode, indices_count, indices_type, indices, instance_count, 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::GlDrawElementsInstancedBaseVertex coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), draw_mode, toEncoder< int32_t >(indices_count, *observer->getScratch()), indices_type, toEncoder< gapic::coder::gles::IndicesPointer >(indices, *observer->getScratch()), toEncoder< int32_t >(instance_count, *observer->getScratch()), toEncoder< int32_t >(base_vertex, *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();
}
EGLint GlesSpy::eglClientWaitSyncKHR(CallObserver* observer, EGLDisplay dpy, EGLSyncKHR sync, EGLint sync_flags, EGLTimeKHR timeout) {
GAPID_DEBUG("eglClientWaitSyncKHR(%p, %p, %d, %" PRIu64 ")", dpy, sync, sync_flags, timeout);
if (mImports.eglClientWaitSyncKHR == nullptr) {
GAPID_WARNING("Application called unsupported function eglClientWaitSyncKHR");
return 0;
}
EGLint result = 0;
bool called = false;
auto call = [this, observer, &called, &result, dpy, sync, sync_flags, timeout] {
called = true;
observer->observeReads();
result = mImports.eglClientWaitSyncKHR(dpy, sync, sync_flags, timeout);
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::EglClientWaitSyncKHR coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(dpy, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLSyncKHR >(sync, *observer->getScratch()), toEncoder< int >(sync_flags, *observer->getScratch()), toEncoder< uint64_t >(timeout, *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;
}
EGLBoolean GlesSpy::eglCopyBuffers(CallObserver* observer, EGLDisplay display, EGLSurface surface, EGLNativePixmapType native_pixmap) {
GAPID_DEBUG("eglCopyBuffers(%p, %p, %p)", display, surface, native_pixmap);
if (mImports.eglCopyBuffers == nullptr) {
GAPID_WARNING("Application called unsupported function eglCopyBuffers");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, surface, native_pixmap] {
called = true;
observer->observeReads();
result = mImports.eglCopyBuffers(display, surface, native_pixmap);
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::EglCopyBuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLSurface >(surface, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLNativePixmapType >(native_pixmap, *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::eglGetDisplay(CallObserver* observer, EGLNativeDisplayType native_display) {
GAPID_DEBUG("eglGetDisplay(%d)", native_display);
if (mImports.eglGetDisplay == nullptr) {
GAPID_WARNING("Application called unsupported function eglGetDisplay");
return nullptr;
}
EGLDisplay result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, native_display] {
called = true;
observer->observeReads();
result = mImports.eglGetDisplay(native_display);
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::EglGetDisplay coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int >(native_display, *observer->getScratch()), 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;
}
EGLint GlesSpy::eglGetError(CallObserver* observer) {
GAPID_DEBUG("eglGetError()");
if (mImports.eglGetError == nullptr) {
GAPID_WARNING("Application called unsupported function eglGetError");
return 0;
}
EGLint result = 0;
bool called = false;
auto call = [this, observer, &called, &result] {
called = true;
observer->observeReads();
result = mImports.eglGetError();
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::EglGetError coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), 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;
}
EGLBoolean GlesSpy::eglGetSyncAttribKHR(CallObserver* observer, EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint* value) {
GAPID_DEBUG("eglGetSyncAttribKHR(%p, %p, %d, %p)", dpy, sync, attribute, value);
if (mImports.eglGetSyncAttribKHR == nullptr) {
GAPID_WARNING("Application called unsupported function eglGetSyncAttribKHR");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, dpy, sync, attribute, value] {
called = true;
observer->observeReads();
result = mImports.eglGetSyncAttribKHR(dpy, sync, attribute, value);
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::EglGetSyncAttribKHR coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(dpy, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLSyncKHR >(sync, *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;
}
EGLBoolean GlesSpy::eglWaitClient(CallObserver* observer) {
GAPID_DEBUG("eglWaitClient()");
if (mImports.eglWaitClient == nullptr) {
GAPID_WARNING("Application called unsupported function eglWaitClient");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result] {
called = true;
observer->observeReads();
result = mImports.eglWaitClient();
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::EglWaitClient coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), 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::glColorMaskiOES(CallObserver* observer, DrawBufferIndex index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
GAPID_DEBUG("glColorMaskiOES(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", index, r, g, b, a);
if (mImports.glColorMaskiOES == nullptr) {
GAPID_WARNING("Application called unsupported function glColorMaskiOES");
return;
}
bool called = false;
auto call = [this, observer, &called, index, r, g, b, a] {
called = true;
observer->observeReads();
mImports.glColorMaskiOES(index, r, g, b, a);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_draw_buffers_indexed);
subColorMaski(observer, call, index, r, g, b, a);
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::GlColorMaskiOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< uint8_t >(r, *observer->getScratch()), toEncoder< uint8_t >(g, *observer->getScratch()), toEncoder< uint8_t >(b, *observer->getScratch()), toEncoder< uint8_t >(a, *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::glCompressedTexSubImage3DOES(CallObserver* observer, uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, uint32_t format, GLsizei image_size, TexturePointer data) {
GAPID_DEBUG("glCompressedTexSubImage3DOES(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %" PRId32 ", %p)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data);
if (mImports.glCompressedTexSubImage3DOES == nullptr) {
GAPID_WARNING("Application called unsupported function glCompressedTexSubImage3DOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data] {
called = true;
observer->observeReads();
mImports.glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_3D);
subCompressedTexSubImage3D(observer, call, target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data);
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::GlCompressedTexSubImage3DOES 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, toEncoder< int32_t >(image_size, *observer->getScratch()), toEncoder< gapic::coder::gles::TexturePointer >(data, *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::glCopyTexSubImage3DOES(CallObserver* observer, uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
GAPID_DEBUG("glCopyTexSubImage3DOES(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", target, level, xoffset, yoffset, zoffset, x, y, width, height);
if (mImports.glCopyTexSubImage3DOES == nullptr) {
GAPID_WARNING("Application called unsupported function glCopyTexSubImage3DOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, level, xoffset, yoffset, zoffset, x, y, width, height] {
called = true;
observer->observeReads();
mImports.glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_3D);
subCopyTexSubImage3D(observer, call, target, level, xoffset, yoffset, zoffset, 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::GlCopyTexSubImage3DOES 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 >(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::glDeleteProgramPipelinesEXT(CallObserver* observer, GLsizei n, PipelineId* pipelines) {
GAPID_DEBUG("glDeleteProgramPipelinesEXT(%" PRId32 ", %p)", n, pipelines);
if (mImports.glDeleteProgramPipelinesEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteProgramPipelinesEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, n, pipelines] {
called = true;
observer->observeReads();
mImports.glDeleteProgramPipelinesEXT(n, pipelines);
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::GlDeleteProgramPipelinesEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, *observer->getScratch()), toEncoder< gapic::coder::gles::PipelineId__CP >(pipelines, *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::glDepthRangeArrayfvNV(CallObserver* observer, GLuint first, GLsizei count, GLfloat* v) {
GAPID_DEBUG("glDepthRangeArrayfvNV(%" PRIu32 ", %" PRId32 ", %p)", first, count, v);
if (mImports.glDepthRangeArrayfvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glDepthRangeArrayfvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, first, count, v] {
called = true;
observer->observeReads();
mImports.glDepthRangeArrayfvNV(first, count, v);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_viewport_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::GlDepthRangeArrayfvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(first, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(v, *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::glDepthRangeIndexedfNV(CallObserver* observer, GLuint index, GLfloat n, GLfloat f) {
GAPID_DEBUG("glDepthRangeIndexedfNV(%" PRIu32 ", %f, %f)", index, n, f);
if (mImports.glDepthRangeIndexedfNV == nullptr) {
GAPID_WARNING("Application called unsupported function glDepthRangeIndexedfNV");
return;
}
bool called = false;
auto call = [this, observer, &called, index, n, f] {
called = true;
observer->observeReads();
mImports.glDepthRangeIndexedfNV(index, n, f);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_viewport_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::GlDepthRangeIndexedfNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< float >(n, *observer->getScratch()), toEncoder< float >(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::glDisableDriverControlQCOM(CallObserver* observer, GLuint driverControl) {
GAPID_DEBUG("glDisableDriverControlQCOM(%" PRIu32 ")", driverControl);
if (mImports.glDisableDriverControlQCOM == nullptr) {
GAPID_WARNING("Application called unsupported function glDisableDriverControlQCOM");
return;
}
bool called = false;
auto call = [this, observer, &called, driverControl] {
called = true;
observer->observeReads();
mImports.glDisableDriverControlQCOM(driverControl);
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::GlDisableDriverControlQCOM coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(driverControl, *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::glFramebufferSampleLocationsfvNV(CallObserver* observer, uint32_t target, GLuint start, GLsizei count, GLfloat* v) {
GAPID_DEBUG("glFramebufferSampleLocationsfvNV(%u, %" PRIu32 ", %" PRId32 ", %p)", target, start, count, v);
if (mImports.glFramebufferSampleLocationsfvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glFramebufferSampleLocationsfvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, target, start, count, v] {
called = true;
observer->observeReads();
mImports.glFramebufferSampleLocationsfvNV(target, start, count, v);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_sample_locations);
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::GlFramebufferSampleLocationsfvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(start, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(v, *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::glGetIntegeri_vEXT(CallObserver* observer, uint32_t target, GLuint index, GLint* data) {
GAPID_DEBUG("glGetIntegeri_vEXT(%u, %" PRIu32 ", %p)", target, index, data);
if (mImports.glGetIntegeri_vEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glGetIntegeri_vEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, index, data] {
called = true;
observer->observeReads();
mImports.glGetIntegeri_vEXT(target, index, data);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_multiview_draw_buffers);
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::GlGetIntegeri_vEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__P >(data, *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);
}
GLfloat GlesSpy::glGetPathLengthNV(CallObserver* observer, GLuint path, GLsizei startSegment, GLsizei numSegments) {
GAPID_DEBUG("glGetPathLengthNV(%" PRIu32 ", %" PRId32 ", %" PRId32 ")", path, startSegment, numSegments);
if (mImports.glGetPathLengthNV == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPathLengthNV");
return 0;
}
GLfloat result = 0;
bool called = false;
auto call = [this, observer, &called, &result, path, startSegment, numSegments] {
called = true;
observer->observeReads();
result = mImports.glGetPathLengthNV(path, startSegment, numSegments);
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::GlGetPathLengthNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *observer->getScratch()), toEncoder< int32_t >(startSegment, *observer->getScratch()), toEncoder< int32_t >(numSegments, *observer->getScratch()), toEncoder< float >(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::glGetPerfCounterInfoINTEL(CallObserver* observer, GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar* counterDesc, GLuint* counterOffset, GLuint* counterDataSize, GLuint* counterTypeEnum, GLuint* counterDataTypeEnum, GLuint64* rawCounterMaxValue) {
GAPID_DEBUG("glGetPerfCounterInfoINTEL(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %p, %" PRIu32 ", %p, %p, %p, %p, %p, %p)", queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue);
if (mImports.glGetPerfCounterInfoINTEL == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPerfCounterInfoINTEL");
return;
}
bool called = false;
auto call = [this, observer, &called, queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue] {
called = true;
observer->observeReads();
mImports.glGetPerfCounterInfoINTEL(queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue);
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::GlGetPerfCounterInfoINTEL coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(queryId, *observer->getScratch()), toEncoder< uint32_t >(counterId, *observer->getScratch()), toEncoder< uint32_t >(counterNameLength, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(counterName, *observer->getScratch()), toEncoder< uint32_t >(counterDescLength, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(counterDesc, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(counterOffset, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(counterDataSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(counterTypeEnum, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(counterDataTypeEnum, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint64__P >(rawCounterMaxValue, *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::glGetPerfMonitorGroupStringAMD(CallObserver* observer, GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString) {
GAPID_DEBUG("glGetPerfMonitorGroupStringAMD(%" PRIu32 ", %" PRId32 ", %p, %p)", group, bufSize, length, groupString);
if (mImports.glGetPerfMonitorGroupStringAMD == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPerfMonitorGroupStringAMD");
return;
}
bool called = false;
auto call = [this, observer, &called, group, bufSize, length, groupString] {
called = true;
observer->observeReads();
mImports.glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
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::GlGetPerfMonitorGroupStringAMD coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(group, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(groupString, *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::glGetPerfMonitorGroupsAMD(CallObserver* observer, GLint* numGroups, GLsizei groupsSize, GLuint* groups) {
GAPID_DEBUG("glGetPerfMonitorGroupsAMD(%p, %" PRId32 ", %p)", numGroups, groupsSize, groups);
if (mImports.glGetPerfMonitorGroupsAMD == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPerfMonitorGroupsAMD");
return;
}
bool called = false;
auto call = [this, observer, &called, numGroups, groupsSize, groups] {
called = true;
observer->observeReads();
mImports.glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
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::GlGetPerfMonitorGroupsAMD coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLint__P >(numGroups, *observer->getScratch()), toEncoder< int32_t >(groupsSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(groups, *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::glGetTextureSamplerHandleNV(CallObserver* observer, TextureId texture, SamplerId sampler) {
GAPID_DEBUG("glGetTextureSamplerHandleNV(%" PRIu32 ", %" PRIu32 ")", texture, sampler);
if (mImports.glGetTextureSamplerHandleNV == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTextureSamplerHandleNV");
return 0;
}
GLuint64 result = 0;
bool called = false;
auto call = [this, observer, &called, &result, texture, sampler] {
called = true;
observer->observeReads();
result = mImports.glGetTextureSamplerHandleNV(texture, sampler);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_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::GlGetTextureSamplerHandleNV 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;
}
GLboolean GlesSpy::glIsImageHandleResidentNV(CallObserver* observer, GLuint64 handle) {
GAPID_DEBUG("glIsImageHandleResidentNV(%" PRIu64 ")", handle);
if (mImports.glIsImageHandleResidentNV == nullptr) {
GAPID_WARNING("Application called unsupported function glIsImageHandleResidentNV");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, handle] {
called = true;
observer->observeReads();
result = mImports.glIsImageHandleResidentNV(handle);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_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::GlIsImageHandleResidentNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint64_t >(handle, *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;
}
GLboolean GlesSpy::glIsPointInFillPathNV(CallObserver* observer, GLuint path, GLuint mask, GLfloat x, GLfloat y) {
GAPID_DEBUG("glIsPointInFillPathNV(%" PRIu32 ", %" PRIu32 ", %f, %f)", path, mask, x, y);
if (mImports.glIsPointInFillPathNV == nullptr) {
GAPID_WARNING("Application called unsupported function glIsPointInFillPathNV");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, path, mask, x, y] {
called = true;
observer->observeReads();
result = mImports.glIsPointInFillPathNV(path, mask, x, y);
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::GlIsPointInFillPathNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *observer->getScratch()), toEncoder< uint32_t >(mask, *observer->getScratch()), toEncoder< float >(x, *observer->getScratch()), toEncoder< float >(y, *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::glMakeTextureHandleResidentNV(CallObserver* observer, GLuint64 handle) {
GAPID_DEBUG("glMakeTextureHandleResidentNV(%" PRIu64 ")", handle);
if (mImports.glMakeTextureHandleResidentNV == nullptr) {
GAPID_WARNING("Application called unsupported function glMakeTextureHandleResidentNV");
return;
}
bool called = false;
auto call = [this, observer, &called, handle] {
called = true;
observer->observeReads();
mImports.glMakeTextureHandleResidentNV(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::GlMakeTextureHandleResidentNV 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::glMatrixLoad3x3fNV(CallObserver* observer, uint32_t matrixMode, GLfloat* m) {
GAPID_DEBUG("glMatrixLoad3x3fNV(%u, %p)", matrixMode, m);
if (mImports.glMatrixLoad3x3fNV == nullptr) {
GAPID_WARNING("Application called unsupported function glMatrixLoad3x3fNV");
return;
}
bool called = false;
auto call = [this, observer, &called, matrixMode, m] {
called = true;
observer->observeReads();
mImports.glMatrixLoad3x3fNV(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::GlMatrixLoad3x3fNV 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);
}
uint32_t GlesSpy::glPathMemoryGlyphIndexArrayNV(CallObserver* observer, GLuint firstPathName, uint32_t fontTarget, GLsizeiptr fontSize, void* fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale) {
GAPID_DEBUG("glPathMemoryGlyphIndexArrayNV(%" PRIu32 ", %u, %" PRId32 ", %p, %" PRId32 ", %" PRIu32 ", %" PRId32 ", %" PRIu32 ", %f)", firstPathName, fontTarget, fontSize, fontData, faceIndex, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale);
if (mImports.glPathMemoryGlyphIndexArrayNV == nullptr) {
GAPID_WARNING("Application called unsupported function glPathMemoryGlyphIndexArrayNV");
return 0;
}
uint32_t result = 0;
bool called = false;
auto call = [this, observer, &called, &result, firstPathName, fontTarget, fontSize, fontData, faceIndex, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale] {
called = true;
observer->observeReads();
result = mImports.glPathMemoryGlyphIndexArrayNV(firstPathName, fontTarget, fontSize, fontData, faceIndex, 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::GlPathMemoryGlyphIndexArrayNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(firstPathName, *observer->getScratch()), fontTarget, toEncoder< int32_t >(fontSize, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__CP >(fontData, *observer->getScratch()), toEncoder< int32_t >(faceIndex, *observer->getScratch()), 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::glPrimitiveBoundingBoxOES(CallObserver* observer, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
GAPID_DEBUG("glPrimitiveBoundingBoxOES(%f, %f, %f, %f, %f, %f, %f, %f)", minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
if (mImports.glPrimitiveBoundingBoxOES == nullptr) {
GAPID_WARNING("Application called unsupported function glPrimitiveBoundingBoxOES");
return;
}
bool called = false;
auto call = [this, observer, &called, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW] {
called = true;
observer->observeReads();
mImports.glPrimitiveBoundingBoxOES(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_primitive_bounding_box);
subPrimitiveBoundingBox(observer, call, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
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::GlPrimitiveBoundingBoxOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(minX, *observer->getScratch()), toEncoder< float >(minY, *observer->getScratch()), toEncoder< float >(minZ, *observer->getScratch()), toEncoder< float >(minW, *observer->getScratch()), toEncoder< float >(maxX, *observer->getScratch()), toEncoder< float >(maxY, *observer->getScratch()), toEncoder< float >(maxZ, *observer->getScratch()), toEncoder< float >(maxW, *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::glProgramUniformMatrix2x3fvEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) {
GAPID_DEBUG("glProgramUniformMatrix2x3fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value);
if (mImports.glProgramUniformMatrix2x3fvEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix2x3fvEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, value] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix2x3fvEXT(program, location, count, transpose, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniformMatrix2x3fv(observer, call, program, 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::GlProgramUniformMatrix2x3fvEXT 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 >(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::glProgramUniformMatrix3x2fvEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) {
GAPID_DEBUG("glProgramUniformMatrix3x2fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value);
if (mImports.glProgramUniformMatrix3x2fvEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix3x2fvEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, value] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix3x2fvEXT(program, location, count, transpose, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniformMatrix3x2fv(observer, call, program, 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::GlProgramUniformMatrix3x2fvEXT 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 >(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::glQueryCounterEXT(CallObserver* observer, QueryId query, uint32_t target) {
GAPID_DEBUG("glQueryCounterEXT(%" PRIu32 ", %u)", query, target);
if (mImports.glQueryCounterEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glQueryCounterEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, query, target] {
called = true;
observer->observeReads();
mImports.glQueryCounterEXT(query, target);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_disjoint_timer_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::GlQueryCounterEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, *observer->getScratch()), target);
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::glSamplerParameterIuivOES(CallObserver* observer, SamplerId sampler, uint32_t pname, GLuint* param) {
GAPID_DEBUG("glSamplerParameterIuivOES(%" PRIu32 ", %u, %p)", sampler, pname, param);
if (mImports.glSamplerParameterIuivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glSamplerParameterIuivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, param] {
called = true;
observer->observeReads();
mImports.glSamplerParameterIuivOES(sampler, pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_border_clamp);
subSamplerParameterIuiv(observer, call, sampler, pname, param);
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::GlSamplerParameterIuivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLuint__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::glScissorIndexedvNV(CallObserver* observer, GLuint index, GLint* v) {
GAPID_DEBUG("glScissorIndexedvNV(%" PRIu32 ", %p)", index, v);
if (mImports.glScissorIndexedvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glScissorIndexedvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, index, v] {
called = true;
observer->observeReads();
mImports.glScissorIndexedvNV(index, v);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_viewport_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::GlScissorIndexedvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__CP >(v, *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::glTextureViewOES(CallObserver* observer, TextureId texture, uint32_t target, GLuint origtexture, uint32_t internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) {
GAPID_DEBUG("glTextureViewOES(%" PRIu32 ", %u, %" PRIu32 ", %u, %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
if (mImports.glTextureViewOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTextureViewOES");
return;
}
bool called = false;
auto call = [this, observer, &called, texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers] {
called = true;
observer->observeReads();
mImports.glTextureViewOES(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_view);
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::GlTextureViewOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, *observer->getScratch()), target, toEncoder< uint32_t >(origtexture, *observer->getScratch()), internalformat, toEncoder< uint32_t >(minlevel, *observer->getScratch()), toEncoder< uint32_t >(numlevels, *observer->getScratch()), toEncoder< uint32_t >(minlayer, *observer->getScratch()), toEncoder< uint32_t >(numlayers, *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::glTransformPathNV(CallObserver* observer, GLuint resultPath, GLuint srcPath, uint32_t transformType, GLfloat* transformValues) {
GAPID_DEBUG("glTransformPathNV(%" PRIu32 ", %" PRIu32 ", %u, %p)", resultPath, srcPath, transformType, transformValues);
if (mImports.glTransformPathNV == nullptr) {
GAPID_WARNING("Application called unsupported function glTransformPathNV");
return;
}
bool called = false;
auto call = [this, observer, &called, resultPath, srcPath, transformType, transformValues] {
called = true;
observer->observeReads();
mImports.glTransformPathNV(resultPath, srcPath, 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::GlTransformPathNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(resultPath, *observer->getScratch()), toEncoder< uint32_t >(srcPath, *observer->getScratch()), 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);
}
void GlesSpy::glValidateProgramPipelineEXT(CallObserver* observer, PipelineId pipeline) {
GAPID_DEBUG("glValidateProgramPipelineEXT(%" PRIu32 ")", pipeline);
if (mImports.glValidateProgramPipelineEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glValidateProgramPipelineEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, pipeline] {
called = true;
observer->observeReads();
mImports.glValidateProgramPipelineEXT(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::GlValidateProgramPipelineEXT 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::glViewportIndexedfNV(CallObserver* observer, GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
GAPID_DEBUG("glViewportIndexedfNV(%" PRIu32 ", %f, %f, %f, %f)", index, x, y, w, h);
if (mImports.glViewportIndexedfNV == nullptr) {
GAPID_WARNING("Application called unsupported function glViewportIndexedfNV");
return;
}
bool called = false;
auto call = [this, observer, &called, index, x, y, w, h] {
called = true;
observer->observeReads();
mImports.glViewportIndexedfNV(index, x, y, w, h);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_viewport_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::GlViewportIndexedfNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< float >(x, *observer->getScratch()), toEncoder< float >(y, *observer->getScratch()), toEncoder< float >(w, *observer->getScratch()), toEncoder< float >(h, *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);
}
GLsizei GlesSpy::glGetFramebufferPixelLocalStorageSizeEXT(CallObserver* observer, GLuint target) {
GAPID_DEBUG("glGetFramebufferPixelLocalStorageSizeEXT(%" PRIu32 ")", target);
if (mImports.glGetFramebufferPixelLocalStorageSizeEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glGetFramebufferPixelLocalStorageSizeEXT");
return 0;
}
GLsizei result = 0;
bool called = false;
auto call = [this, observer, &called, &result, target] {
called = true;
observer->observeReads();
result = mImports.glGetFramebufferPixelLocalStorageSizeEXT(target);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_shader_pixel_local_storage2);
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::GlGetFramebufferPixelLocalStorageSizeEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(target, *observer->getScratch()), toEncoder< int32_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::glPolygonOffsetClampEXT(CallObserver* observer, GLfloat factor, GLfloat units, GLfloat clamp) {
GAPID_DEBUG("glPolygonOffsetClampEXT(%f, %f, %f)", factor, units, clamp);
if (mImports.glPolygonOffsetClampEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glPolygonOffsetClampEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, factor, units, clamp] {
called = true;
observer->observeReads();
mImports.glPolygonOffsetClampEXT(factor, units, clamp);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_polygon_offset_clamp);
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::GlPolygonOffsetClampEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(factor, *observer->getScratch()), toEncoder< float >(units, *observer->getScratch()), toEncoder< float >(clamp, *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::glProgramUniform1ui64vNV(CallObserver* observer, GLuint program, GLint location, GLsizei count, GLuint64EXT* value) {
GAPID_DEBUG("glProgramUniform1ui64vNV(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value);
if (mImports.glProgramUniform1ui64vNV == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform1ui64vNV");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, value] {
called = true;
observer->observeReads();
mImports.glProgramUniform1ui64vNV(program, 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::GlProgramUniform1ui64vNV 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::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::glProgramUniform2i64NV(CallObserver* observer, GLuint program, GLint location, GLint64EXT x, GLint64EXT y) {
GAPID_DEBUG("glProgramUniform2i64NV(%" PRIu32 ", %" PRId32 ", %" PRId64 ", %" PRId64 ")", program, location, x, y);
if (mImports.glProgramUniform2i64NV == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform2i64NV");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, x, y] {
called = true;
observer->observeReads();
mImports.glProgramUniform2i64NV(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::GlProgramUniform2i64NV 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()));
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::glUniform1ui64NV(CallObserver* observer, GLint location, GLuint64EXT x) {
GAPID_DEBUG("glUniform1ui64NV(%" PRId32 ", %" PRIu64 ")", location, x);
if (mImports.glUniform1ui64NV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform1ui64NV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, x] {
called = true;
observer->observeReads();
mImports.glUniform1ui64NV(location, x);
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::GlUniform1ui64NV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint64_t >(x, *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::glUniform2i64vNV(CallObserver* observer, GLint location, GLsizei count, GLint64EXT* value) {
GAPID_DEBUG("glUniform2i64vNV(%" PRId32 ", %" PRId32 ", %p)", location, count, value);
if (mImports.glUniform2i64vNV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform2i64vNV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, value] {
called = true;
observer->observeReads();
mImports.glUniform2i64vNV(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::GlUniform2i64vNV 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::glUniformHandleui64vIMG(CallObserver* observer, GLint location, GLsizei count, GLuint64* value) {
GAPID_DEBUG("glUniformHandleui64vIMG(%" PRId32 ", %" PRId32 ", %p)", location, count, value);
if (mImports.glUniformHandleui64vIMG == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformHandleui64vIMG");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, value] {
called = true;
observer->observeReads();
mImports.glUniformHandleui64vIMG(location, count, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_IMG_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::GlUniformHandleui64vIMG coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint64__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::glStencilOp(CallObserver* observer, uint32_t fail, uint32_t zfail, uint32_t zpass) {
GAPID_DEBUG("glStencilOp(%u, %u, %u)", fail, zfail, zpass);
if (mImports.glStencilOp == nullptr) {
GAPID_WARNING("Application called unsupported function glStencilOp");
return;
}
bool called = false;
auto call = [this, observer, &called, fail, zfail, zpass] {
called = true;
observer->observeReads();
mImports.glStencilOp(fail, zfail, zpass);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subStencilOpSeparate(observer, call, GLenum::GL_FRONT_AND_BACK, fail, zfail, zpass);
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::GlStencilOp coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), fail, zfail, zpass);
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::glClearBufferfv(CallObserver* observer, uint32_t buffer, GLint drawbuffer, GLfloat* value) {
GAPID_DEBUG("glClearBufferfv(%u, %" PRId32 ", %p)", buffer, drawbuffer, value);
if (mImports.glClearBufferfv == nullptr) {
GAPID_WARNING("Application called unsupported function glClearBufferfv");
return;
}
bool called = false;
auto call = [this, observer, &called, buffer, drawbuffer, value] {
called = true;
observer->observeReads();
mImports.glClearBufferfv(buffer, drawbuffer, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (buffer) {
case GLenum::GL_COLOR: {
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
if ((drawbuffer) >= (checkNotNull(l_ctx).mConstants.mMaxDrawBuffers)) {
subGlErrorInvalidValue(observer, call);
}
observer->read(slice(value, 0ULL, 4ULL));
break;
}
case GLenum::GL_DEPTH: {
if ((drawbuffer) != ((GLint)(0L))) {
subGlErrorInvalidValue(observer, call);
}
observer->read(slice(value, 0ULL, 1ULL));
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::GlClearBufferfv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), buffer, toEncoder< int32_t >(drawbuffer, *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::glClearStencil(CallObserver* observer, GLint stencil) {
GAPID_DEBUG("glClearStencil(%" PRId32 ")", stencil);
if (mImports.glClearStencil == nullptr) {
GAPID_WARNING("Application called unsupported function glClearStencil");
return;
}
bool called = false;
auto call = [this, observer, &called, stencil] {
called = true;
observer->observeReads();
mImports.glClearStencil(stencil);
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);
checkNotNull(l_ctx).mFramebuffer.mStencilClearValue = stencil;
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::GlClearStencil coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), 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::glColorMask(CallObserver* observer, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
GAPID_DEBUG("glColorMask(%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", red, green, blue, alpha);
if (mImports.glColorMask == nullptr) {
GAPID_WARNING("Application called unsupported function glColorMask");
return;
}
bool called = false;
auto call = [this, observer, &called, red, green, blue, alpha] {
called = true;
observer->observeReads();
mImports.glColorMask(red, green, blue, alpha);
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);
for (DrawBufferIndex l_i = (DrawBufferIndex)(0UL); l_i < (DrawBufferIndex)(uint32_t((checkNotNull(l_ctx).mFramebuffer.mColorWritemask.size()))); ++l_i) {
checkNotNull(l_ctx).mFramebuffer.mColorWritemask[l_i] = {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::GlColorMask 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::glDeleteFramebuffers(CallObserver* observer, GLsizei count, FramebufferId* framebuffers) {
GAPID_DEBUG("glDeleteFramebuffers(%" PRId32 ", %p)", count, framebuffers);
if (mImports.glDeleteFramebuffers == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteFramebuffers");
return;
}
bool called = false;
auto call = [this, observer, &called, count, framebuffers] {
called = true;
observer->observeReads();
mImports.glDeleteFramebuffers(count, framebuffers);
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<FramebufferId> l_f = slice(framebuffers, (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) {
FramebufferId l_id = observer->read(l_f, (uint64_t)(l_i));
if ((l_id) != ((FramebufferId)(0UL))) {
checkNotNull(l_ctx).mInstances.mFramebuffers.erase(l_id);
if ((l_id) == (findOrZero(checkNotNull(l_ctx).mBoundFramebuffers, GLenum::GL_READ_FRAMEBUFFER))) {
checkNotNull(l_ctx).mBoundFramebuffers[GLenum::GL_READ_FRAMEBUFFER] = (FramebufferId)(0UL);
}
if ((l_id) == (findOrZero(checkNotNull(l_ctx).mBoundFramebuffers, GLenum::GL_DRAW_FRAMEBUFFER))) {
checkNotNull(l_ctx).mBoundFramebuffers[GLenum::GL_DRAW_FRAMEBUFFER] = (FramebufferId)(0UL);
}
}
}
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::GlDeleteFramebuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::FramebufferId__CP >(framebuffers, *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::glIsFramebuffer(CallObserver* observer, FramebufferId framebuffer) {
GAPID_DEBUG("glIsFramebuffer(%" PRIu32 ")", framebuffer);
if (mImports.glIsFramebuffer == nullptr) {
GAPID_WARNING("Application called unsupported function glIsFramebuffer");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, framebuffer] {
called = true;
observer->observeReads();
result = mImports.glIsFramebuffer(framebuffer);
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.mFramebuffers.count(framebuffer) > 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::GlIsFramebuffer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(framebuffer, *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::glReadnPixels(CallObserver* observer, GLint x, GLint y, GLsizei width, GLsizei height, uint32_t format, uint32_t type, GLsizei bufSize, void* data) {
GAPID_DEBUG("glReadnPixels(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %" PRId32 ", %p)", x, y, width, height, format, type, bufSize, data);
if (mImports.glReadnPixels == nullptr) {
GAPID_WARNING("Application called unsupported function glReadnPixels");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, width, height, format, type, bufSize, data] {
called = true;
observer->observeReads();
mImports.glReadnPixels(x, y, width, height, format, type, bufSize, data);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
call();
subReadnPixels(observer, call, x, y, width, height, format, type, bufSize, data);
} 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::GlReadnPixels 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()), format, type, toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__P >(data, *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);
}
GLint GlesSpy::glGetProgramResourceLocation(CallObserver* observer, ProgramId program, uint32_t programInterface, const char* name) {
GAPID_DEBUG("glGetProgramResourceLocation(%" PRIu32 ", %u, %s)", program, programInterface, name);
if (mImports.glGetProgramResourceLocation == nullptr) {
GAPID_WARNING("Application called unsupported function glGetProgramResourceLocation");
return 0;
}
GLint result = 0;
bool called = false;
auto call = [this, observer, &called, &result, program, programInterface, name] {
called = true;
observer->observeReads();
result = mImports.glGetProgramResourceLocation(program, programInterface, name);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
switch (programInterface) {
case GLenum::GL_PROGRAM_INPUT: // fall-through...
case GLenum::GL_PROGRAM_OUTPUT: // fall-through...
case GLenum::GL_TRANSFORM_FEEDBACK_BUFFER: // fall-through...
case GLenum::GL_UNIFORM: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, programInterface);
}
}
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::GlGetProgramResourceLocation coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), programInterface, toEncoder< const char* >(name, *observer->getScratch()), toEncoder< int32_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::glGetProgramResourceiv(CallObserver* observer, ProgramId program, uint32_t programInterface, GLuint index, GLsizei propCount, uint32_t* props, GLsizei bufSize, GLsizei* length, GLint* params) {
GAPID_DEBUG("glGetProgramResourceiv(%" PRIu32 ", %u, %" PRIu32 ", %" PRId32 ", %p, %" PRId32 ", %p, %p)", program, programInterface, index, propCount, props, bufSize, length, params);
if (mImports.glGetProgramResourceiv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetProgramResourceiv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, programInterface, index, propCount, props, bufSize, length, params] {
called = true;
observer->observeReads();
mImports.glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
switch (programInterface) {
case GLenum::GL_ATOMIC_COUNTER_BUFFER: // fall-through...
case GLenum::GL_BUFFER_VARIABLE: // fall-through...
case GLenum::GL_PROGRAM_INPUT: // fall-through...
case GLenum::GL_PROGRAM_OUTPUT: // fall-through...
case GLenum::GL_SHADER_STORAGE_BLOCK: // fall-through...
case GLenum::GL_TRANSFORM_FEEDBACK_BUFFER: // fall-through...
case GLenum::GL_TRANSFORM_FEEDBACK_VARYING: // fall-through...
case GLenum::GL_UNIFORM: // fall-through...
case GLenum::GL_UNIFORM_BLOCK: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, programInterface);
}
}
observer->read(slice(props, (uint64_t)((GLsizei)(0L)), (uint64_t)(propCount)));
call();
if ((length) != (nullptr)) {
GLsizei l_l = (GLsizei)(slice(length, 0ULL, 1ULL)[0ULL]);
observer->write<GLsizei>(slice(length, 0ULL, 1ULL), 0ULL, l_l);
observer->write(slice(params, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_l)));
} else {
observer->write(slice(params, (uint64_t)((GLsizei)(0L)), (uint64_t)(bufSize)));
}
} 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::GlGetProgramResourceiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), programInterface, toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< int32_t >(propCount, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__CP >(props, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(length, *observer->getScratch()), 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);
}
UniformBlockId GlesSpy::glGetUniformBlockIndex(CallObserver* observer, ProgramId program, const char* uniformBlockName) {
GAPID_DEBUG("glGetUniformBlockIndex(%" PRIu32 ", %s)", program, uniformBlockName);
if (mImports.glGetUniformBlockIndex == nullptr) {
GAPID_WARNING("Application called unsupported function glGetUniformBlockIndex");
return 0;
}
UniformBlockId result = 0;
bool called = false;
auto call = [this, observer, &called, &result, program, uniformBlockName] {
called = true;
observer->observeReads();
result = mImports.glGetUniformBlockIndex(program, uniformBlockName);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (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::GlGetUniformBlockIndex coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< const char* >(uniformBlockName, *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;
}
UniformLocation GlesSpy::glGetUniformLocation(CallObserver* observer, ProgramId program, const char* name) {
GAPID_DEBUG("glGetUniformLocation(%" PRIu32 ", %s)", program, name);
if (mImports.glGetUniformLocation == nullptr) {
GAPID_WARNING("Application called unsupported function glGetUniformLocation");
return 0;
}
UniformLocation result = 0;
bool called = false;
auto call = [this, observer, &called, &result, program, name] {
called = true;
observer->observeReads();
result = mImports.glGetUniformLocation(program, 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);
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::GlGetUniformLocation coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< const char* >(name, *observer->getScratch()), toEncoder< int32_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::glGetUniformiv(CallObserver* observer, ProgramId program, UniformLocation location, GLint* values) {
GAPID_DEBUG("glGetUniformiv(%" PRIu32 ", %" PRId32 ", %p)", program, location, values);
if (mImports.glGetUniformiv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetUniformiv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, values] {
called = true;
observer->observeReads();
mImports.glGetUniformiv(program, location, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
call();
subGetUniformv_GLint__P(observer, call, program, location, 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::GlGetUniformiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), 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);
}
void GlesSpy::glMemoryBarrierByRegion(CallObserver* observer, uint32_t barriers) {
GAPID_DEBUG("glMemoryBarrierByRegion(%u)", barriers);
if (mImports.glMemoryBarrierByRegion == nullptr) {
GAPID_WARNING("Application called unsupported function glMemoryBarrierByRegion");
return;
}
bool called = false;
auto call = [this, observer, &called, barriers] {
called = true;
observer->observeReads();
mImports.glMemoryBarrierByRegion(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::GlMemoryBarrierByRegion 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::glProgramUniform1f(CallObserver* observer, ProgramId program, UniformLocation location, GLfloat value0) {
GAPID_DEBUG("glProgramUniform1f(%" PRIu32 ", %" PRId32 ", %f)", program, location, value0);
if (mImports.glProgramUniform1f == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform1f");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value0] {
called = true;
observer->observeReads();
mImports.glProgramUniform1f(program, location, value0);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform1f(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::GlProgramUniform1f coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< float >(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::glProgramUniform3ui(CallObserver* observer, ProgramId program, UniformLocation location, GLuint value0, GLuint value1, GLuint value2) {
GAPID_DEBUG("glProgramUniform3ui(%" PRIu32 ", %" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, location, value0, value1, value2);
if (mImports.glProgramUniform3ui == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform3ui");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value0, value1, value2] {
called = true;
observer->observeReads();
mImports.glProgramUniform3ui(program, location, value0, value1, value2);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform3ui(observer, call, program, location, value0, value1, value2);
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::GlProgramUniform3ui 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()));
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::glProgramUniform4i(CallObserver* observer, ProgramId program, UniformLocation location, GLint value0, GLint value1, GLint value2, GLint value3) {
GAPID_DEBUG("glProgramUniform4i(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", program, location, value0, value1, value2, value3);
if (mImports.glProgramUniform4i == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform4i");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, value0, value1, value2, value3] {
called = true;
observer->observeReads();
mImports.glProgramUniform4i(program, location, value0, value1, value2, value3);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform4i(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::GlProgramUniform4i 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()), toEncoder< int32_t >(value1, *observer->getScratch()), toEncoder< int32_t >(value2, *observer->getScratch()), toEncoder< int32_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::glProgramUniformMatrix4fv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glProgramUniformMatrix4fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values);
if (mImports.glProgramUniformMatrix4fv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix4fv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix4fv(program, location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniformMatrix4fv(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::GlProgramUniformMatrix4fv 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::glUniform1fv(CallObserver* observer, UniformLocation location, GLsizei count, GLfloat* values) {
GAPID_DEBUG("glUniform1fv(%" PRId32 ", %" PRId32 ", %p)", location, count, values);
if (mImports.glUniform1fv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform1fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, values] {
called = true;
observer->observeReads();
mImports.glUniform1fv(location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<GLfloat> l_v = slice(values, (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformv_GLfloat__S(observer, call, location, l_v, GLenum::GL_FLOAT);
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::GlUniform1fv 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::glUniform3uiv(CallObserver* observer, UniformLocation location, GLsizei count, GLuint* values) {
GAPID_DEBUG("glUniform3uiv(%" PRId32 ", %" PRId32 ", %p)", location, count, values);
if (mImports.glUniform3uiv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform3uiv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, values] {
called = true;
observer->observeReads();
mImports.glUniform3uiv(location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Slice<Vec3u> l_v = slice((Vec3u*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformv_Vec3u__S(observer, call, location, l_v, GLenum::GL_UNSIGNED_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::GlUniform3uiv 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::glUniform4iv(CallObserver* observer, UniformLocation location, GLsizei count, GLint* values) {
GAPID_DEBUG("glUniform4iv(%" PRId32 ", %" PRId32 ", %p)", location, count, values);
if (mImports.glUniform4iv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform4iv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, values] {
called = true;
observer->observeReads();
mImports.glUniform4iv(location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<Vec4i> l_v = slice((Vec4i*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
subUniformv_Vec4i__S(observer, call, location, l_v, GLenum::GL_INT_VEC4);
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::GlUniform4iv 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::glGetMultisamplefv(CallObserver* observer, uint32_t pname, GLuint index, GLfloat* val) {
GAPID_DEBUG("glGetMultisamplefv(%u, %" PRIu32 ", %p)", pname, index, val);
if (mImports.glGetMultisamplefv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetMultisamplefv");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, index, val] {
called = true;
observer->observeReads();
mImports.glGetMultisamplefv(pname, index, val);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
switch (pname) {
case GLenum::GL_SAMPLE_POSITION: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, pname);
}
}
observer->read(slice(val, 0ULL, 2ULL));
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::GlGetMultisamplefv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__P >(val, *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::glIsSync(CallObserver* observer, GLsync sync) {
GAPID_DEBUG("glIsSync(%p)", sync);
if (mImports.glIsSync == nullptr) {
GAPID_WARNING("Application called unsupported function glIsSync");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, sync] {
called = true;
observer->observeReads();
result = mImports.glIsSync(sync);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
GLboolean l__res_0 = subIsSync(observer, call, sync);
call();
if (UNLIKELY(shouldComputeExpectedReturn())) {
setExpectedReturn<GLboolean>(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::GlIsSync coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLsync >(sync, *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::glDeleteTextures(CallObserver* observer, GLsizei count, TextureId* textures) {
GAPID_DEBUG("glDeleteTextures(%" PRId32 ", %p)", count, textures);
if (mImports.glDeleteTextures == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteTextures");
return;
}
bool called = false;
auto call = [this, observer, &called, count, textures] {
called = true;
observer->observeReads();
mImports.glDeleteTextures(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);
for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) {
TextureId l_id = observer->read(l_t, (uint64_t)(l_i));
if ((l_id) != ((TextureId)(0UL))) {
checkNotNull(l_ctx).mInstances.mTextures.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::GlDeleteTextures coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::TextureId__CP >(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::glGetSamplerParameterfv(CallObserver* observer, SamplerId sampler, uint32_t pname, GLfloat* params) {
GAPID_DEBUG("glGetSamplerParameterfv(%" PRIu32 ", %u, %p)", sampler, pname, params);
if (mImports.glGetSamplerParameterfv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetSamplerParameterfv");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, params] {
called = true;
observer->observeReads();
mImports.glGetSamplerParameterfv(sampler, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
subGetSamplerParameterv_GLfloat(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::GlGetSamplerParameterfv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *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);
}
GLboolean GlesSpy::glIsTexture(CallObserver* observer, TextureId texture) {
GAPID_DEBUG("glIsTexture(%" PRIu32 ")", texture);
if (mImports.glIsTexture == nullptr) {
GAPID_WARNING("Application called unsupported function glIsTexture");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, texture] {
called = true;
observer->observeReads();
result = mImports.glIsTexture(texture);
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.mTextures.count(texture) > 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::GlIsTexture coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, *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::glSamplerParameterf(CallObserver* observer, SamplerId sampler, uint32_t pname, GLfloat param) {
GAPID_DEBUG("glSamplerParameterf(%" PRIu32 ", %u, %f)", sampler, pname, param);
if (mImports.glSamplerParameterf == nullptr) {
GAPID_WARNING("Application called unsupported function glSamplerParameterf");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, param] {
called = true;
observer->observeReads();
mImports.glSamplerParameterf(sampler, pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Vec1f l_params = {param};
subSamplerParameterv_Vec1f(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::GlSamplerParameterf coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *observer->getScratch()), 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::glTexParameteriv(CallObserver* observer, uint32_t target, uint32_t pname, GLint* params) {
GAPID_DEBUG("glTexParameteriv(%u, %u, %p)", target, pname, params);
if (mImports.glTexParameteriv == nullptr) {
GAPID_WARNING("Application called unsupported function glTexParameteriv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glTexParameteriv(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subTexParameterv_GLint__CP(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::GlTexParameteriv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLint__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::glTexStorage2DMultisample(CallObserver* observer, uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
GAPID_DEBUG("glTexStorage2DMultisample(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRIu8 ")", target, samples, internalformat, width, height, fixedsamplelocations);
if (mImports.glTexStorage2DMultisample == nullptr) {
GAPID_WARNING("Application called unsupported function glTexStorage2DMultisample");
return;
}
bool called = false;
auto call = [this, observer, &called, target, samples, internalformat, width, height, fixedsamplelocations] {
called = true;
observer->observeReads();
mImports.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
switch (target) {
case GLenum::GL_TEXTURE_2D_MULTISAMPLE: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, target);
}
}
switch (internalformat) {
case GLenum::GL_DEPTH24_STENCIL8: // fall-through...
case GLenum::GL_DEPTH32F_STENCIL8: // fall-through...
case GLenum::GL_DEPTH_COMPONENT16: // fall-through...
case GLenum::GL_DEPTH_COMPONENT24: // fall-through...
case GLenum::GL_DEPTH_COMPONENT32F: // fall-through...
case GLenum::GL_R11F_G11F_B10F: // fall-through...
case GLenum::GL_R16F: // fall-through...
case GLenum::GL_R16I: // fall-through...
case GLenum::GL_R16UI: // fall-through...
case GLenum::GL_R32F: // fall-through...
case GLenum::GL_R32I: // fall-through...
case GLenum::GL_R32UI: // fall-through...
case GLenum::GL_R8: // fall-through...
case GLenum::GL_R8I: // fall-through...
case GLenum::GL_R8UI: // fall-through...
case GLenum::GL_R8_SNORM: // fall-through...
case GLenum::GL_RG16F: // fall-through...
case GLenum::GL_RG16I: // fall-through...
case GLenum::GL_RG16UI: // fall-through...
case GLenum::GL_RG32F: // fall-through...
case GLenum::GL_RG32I: // fall-through...
case GLenum::GL_RG32UI: // fall-through...
case GLenum::GL_RG8: // fall-through...
case GLenum::GL_RG8I: // fall-through...
case GLenum::GL_RG8UI: // fall-through...
case GLenum::GL_RG8_SNORM: // fall-through...
case GLenum::GL_RGB10_A2: // fall-through...
case GLenum::GL_RGB10_A2UI: // fall-through...
case GLenum::GL_RGB16F: // fall-through...
case GLenum::GL_RGB16I: // fall-through...
case GLenum::GL_RGB16UI: // fall-through...
case GLenum::GL_RGB32F: // fall-through...
case GLenum::GL_RGB32I: // fall-through...
case GLenum::GL_RGB32UI: // fall-through...
case GLenum::GL_RGB565: // fall-through...
case GLenum::GL_RGB5_A1: // fall-through...
case GLenum::GL_RGB8: // fall-through...
case GLenum::GL_RGB8I: // fall-through...
case GLenum::GL_RGB8UI: // fall-through...
case GLenum::GL_RGB8_SNORM: // fall-through...
case GLenum::GL_RGB9_E5: // fall-through...
case GLenum::GL_RGBA16F: // fall-through...
case GLenum::GL_RGBA16I: // fall-through...
case GLenum::GL_RGBA16UI: // fall-through...
case GLenum::GL_RGBA32F: // fall-through...
case GLenum::GL_RGBA32I: // fall-through...
case GLenum::GL_RGBA32UI: // fall-through...
case GLenum::GL_RGBA4: // fall-through...
case GLenum::GL_RGBA8: // fall-through...
case GLenum::GL_RGBA8I: // fall-through...
case GLenum::GL_RGBA8UI: // fall-through...
case GLenum::GL_RGBA8_SNORM: // fall-through...
case GLenum::GL_SRGB8: // fall-through...
case GLenum::GL_SRGB8_ALPHA8: {
break;
}
case GLenum::GL_STENCIL_INDEX8: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, internalformat);
}
}
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::GlTexStorage2DMultisample 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()), toEncoder< uint8_t >(fixedsamplelocations, *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::glDeleteTransformFeedbacks(CallObserver* observer, GLsizei n, TransformFeedbackId* ids) {
GAPID_DEBUG("glDeleteTransformFeedbacks(%" PRId32 ", %p)", n, ids);
if (mImports.glDeleteTransformFeedbacks == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteTransformFeedbacks");
return;
}
bool called = false;
auto call = [this, observer, &called, n, ids] {
called = true;
observer->observeReads();
mImports.glDeleteTransformFeedbacks(n, ids);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Slice<TransformFeedbackId> l_tfs = slice(ids, (uint64_t)((GLsizei)(0L)), (uint64_t)(n));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
for (GLsizei l_i = (GLsizei)(0L); l_i < n; ++l_i) {
TransformFeedbackId l_id = observer->read(l_tfs, (uint64_t)(l_i));
if ((l_id) != ((TransformFeedbackId)(0UL))) {
checkNotNull(l_ctx).mInstances.mTransformFeedbacks[l_id] = std::shared_ptr<TransformFeedback>();
}
}
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::GlDeleteTransformFeedbacks coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, *observer->getScratch()), toEncoder< gapic::coder::gles::TransformFeedbackId__CP >(ids, *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::glIsTransformFeedback(CallObserver* observer, TransformFeedbackId id) {
GAPID_DEBUG("glIsTransformFeedback(%" PRIu32 ")", id);
if (mImports.glIsTransformFeedback == nullptr) {
GAPID_WARNING("Application called unsupported function glIsTransformFeedback");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, id] {
called = true;
observer->observeReads();
result = mImports.glIsTransformFeedback(id);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
call();
if (UNLIKELY(shouldComputeExpectedReturn())) {
setExpectedReturn<GLboolean>((GLboolean)(checkNotNull(l_ctx).mInstances.mTransformFeedbacks.count(id) > 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::GlIsTransformFeedback coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(id, *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::glGetVertexAttribPointerv(CallObserver* observer, AttributeLocation index, uint32_t pname, void** pointer) {
GAPID_DEBUG("glGetVertexAttribPointerv(%" PRIu32 ", %u, %p)", index, pname, pointer);
if (mImports.glGetVertexAttribPointerv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetVertexAttribPointerv");
return;
}
bool called = false;
auto call = [this, observer, &called, index, pname, pointer] {
called = true;
observer->observeReads();
mImports.glGetVertexAttribPointerv(index, pname, pointer);
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);
}
if ((pname) != (GLenum::GL_VERTEX_ATTRIB_ARRAY_POINTER)) {
subGlErrorInvalidEnum(observer, call, pname);
}
std::shared_ptr<VertexArray> l_vao = findOrZero(checkNotNull(l_ctx).mInstances.mVertexArrays, checkNotNull(l_ctx).mBoundVertexArray);
call();
observer->write<void*>(slice(pointer, 0ULL, 1ULL), 0ULL, (void*)(checkNotNull(findOrZero(checkNotNull(l_vao).mVertexAttributeArrays, index)).mPointer));
} 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::GlGetVertexAttribPointerv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::Void__P__P >(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::glVertexAttrib3fv(CallObserver* observer, AttributeLocation location, GLfloat* value) {
GAPID_DEBUG("glVertexAttrib3fv(%" PRIu32 ", %p)", location, value);
if (mImports.glVertexAttrib3fv == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttrib3fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value] {
called = true;
observer->observeReads();
mImports.glVertexAttrib3fv(location, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<GLfloat> l_v = slice(value, 0ULL, 3ULL);
Vec4f l_vec = {observer->read(l_v, 0ULL), observer->read(l_v, 1ULL), observer->read(l_v, 2ULL), (GLfloat)(1.f)};
subVertexAttribF(observer, call, location, l_vec);
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::GlVertexAttrib3fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, *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::glVertexAttribPointer(CallObserver* observer, AttributeLocation location, GLint size, uint32_t type, GLboolean normalized, GLsizei stride, VertexPointer data) {
GAPID_DEBUG("glVertexAttribPointer(%" PRIu32 ", %" PRId32 ", %u, %" PRIu8 ", %" PRId32 ", %p)", location, size, type, normalized, stride, data);
if (mImports.glVertexAttribPointer == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttribPointer");
return;
}
bool called = false;
auto call = [this, observer, &called, location, size, type, normalized, stride, data] {
called = true;
observer->observeReads();
mImports.glVertexAttribPointer(location, size, type, normalized, stride, data);
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);
subVertexAttribPointer(observer, call, l_ctx, location, size, type, normalized, stride, data, false);
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::GlVertexAttribPointer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, *observer->getScratch()), toEncoder< int32_t >(size, *observer->getScratch()), type, toEncoder< uint8_t >(normalized, *observer->getScratch()), toEncoder< int32_t >(stride, *observer->getScratch()), toEncoder< gapic::coder::gles::VertexPointer >(data, *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::glXMakeCurrent(CallObserver* observer, void* display, GLXDrawable drawable, GLXContext ctx) {
GAPID_DEBUG("glXMakeCurrent(%p, %p, %p)", display, drawable, ctx);
if (mImports.glXMakeCurrent == nullptr) {
GAPID_WARNING("Application called unsupported function glXMakeCurrent");
return 0;
}
Bool result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, drawable, ctx] {
called = true;
observer->observeReads();
result = mImports.glXMakeCurrent(display, drawable, 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::GlXMakeCurrent coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__P >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::GLXDrawable >(drawable, *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;
}
void GlesSpy::wglSwapBuffers(CallObserver* observer, HDC hdc) {
GAPID_DEBUG("wglSwapBuffers(%p)", hdc);
if (mImports.wglSwapBuffers == nullptr) {
GAPID_WARNING("Application called unsupported function wglSwapBuffers");
return;
}
bool called = false;
auto call = [this, observer, &called, hdc] {
called = true;
observer->observeReads();
mImports.wglSwapBuffers(hdc);
onPostFence(observer);
};
onPreEndOfFrame();
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::WglSwapBuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::HDC >(hdc, *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::glGetQueryObjectui64v(CallObserver* observer, QueryId query, uint32_t parameter, uint64_t* value) {
GAPID_DEBUG("glGetQueryObjectui64v(%" PRIu32 ", %u, %p)", query, parameter, value);
if (mImports.glGetQueryObjectui64v == nullptr) {
GAPID_WARNING("Application called unsupported function glGetQueryObjectui64v");
return;
}
bool called = false;
auto call = [this, observer, &called, query, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetQueryObjectui64v(query, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
observer->write<uint64_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::GlGetQueryObjectui64v coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, *observer->getScratch()), parameter, toEncoder< gapic::coder::gles::U64__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::glAlphaFuncxOES(CallObserver* observer, uint32_t func, GLfixed ref) {
GAPID_DEBUG("glAlphaFuncxOES(%u, %" PRId32 ")", func, ref);
if (mImports.glAlphaFuncxOES == nullptr) {
GAPID_WARNING("Application called unsupported function glAlphaFuncxOES");
return;
}
bool called = false;
auto call = [this, observer, &called, func, ref] {
called = true;
observer->observeReads();
mImports.glAlphaFuncxOES(func, ref);
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::GlAlphaFuncxOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), func, toEncoder< int32_t >(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::glBindFramebufferOES(CallObserver* observer, uint32_t target, GLuint framebuffer) {
GAPID_DEBUG("glBindFramebufferOES(%u, %" PRIu32 ")", target, framebuffer);
if (mImports.glBindFramebufferOES == nullptr) {
GAPID_WARNING("Application called unsupported function glBindFramebufferOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, framebuffer] {
called = true;
observer->observeReads();
mImports.glBindFramebufferOES(target, framebuffer);
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::GlBindFramebufferOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(framebuffer, *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::glClearDepthxOES(CallObserver* observer, GLfixed depth) {
GAPID_DEBUG("glClearDepthxOES(%" PRId32 ")", depth);
if (mImports.glClearDepthxOES == nullptr) {
GAPID_WARNING("Application called unsupported function glClearDepthxOES");
return;
}
bool called = false;
auto call = [this, observer, &called, depth] {
called = true;
observer->observeReads();
mImports.glClearDepthxOES(depth);
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::GlClearDepthxOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), 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::glColor4x(CallObserver* observer, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
GAPID_DEBUG("glColor4x(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", red, green, blue, alpha);
if (mImports.glColor4x == nullptr) {
GAPID_WARNING("Application called unsupported function glColor4x");
return;
}
bool called = false;
auto call = [this, observer, &called, red, green, blue, alpha] {
called = true;
observer->observeReads();
mImports.glColor4x(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::GlColor4x coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(red, *observer->getScratch()), toEncoder< int32_t >(green, *observer->getScratch()), toEncoder< int32_t >(blue, *observer->getScratch()), toEncoder< int32_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::glDepthRangexOES(CallObserver* observer, GLfixed n, GLfixed f) {
GAPID_DEBUG("glDepthRangexOES(%" PRId32 ", %" PRId32 ")", n, f);
if (mImports.glDepthRangexOES == nullptr) {
GAPID_WARNING("Application called unsupported function glDepthRangexOES");
return;
}
bool called = false;
auto call = [this, observer, &called, n, f] {
called = true;
observer->observeReads();
mImports.glDepthRangexOES(n, f);
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::GlDepthRangexOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), 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::glDrawTexsvOES(CallObserver* observer, GLshort* coords) {
GAPID_DEBUG("glDrawTexsvOES(%p)", coords);
if (mImports.glDrawTexsvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawTexsvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, coords] {
called = true;
observer->observeReads();
mImports.glDrawTexsvOES(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::GlDrawTexsvOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLshort__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::glGenFramebuffersOES(CallObserver* observer, GLsizei n, GLuint* framebuffers) {
GAPID_DEBUG("glGenFramebuffersOES(%" PRId32 ", %p)", n, framebuffers);
if (mImports.glGenFramebuffersOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGenFramebuffersOES");
return;
}
bool called = false;
auto call = [this, observer, &called, n, framebuffers] {
called = true;
observer->observeReads();
mImports.glGenFramebuffersOES(n, framebuffers);
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::GlGenFramebuffersOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(framebuffers, *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::glGetClipPlanefOES(CallObserver* observer, uint32_t plane, GLfloat* equation) {
GAPID_DEBUG("glGetClipPlanefOES(%u, %p)", plane, equation);
if (mImports.glGetClipPlanefOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetClipPlanefOES");
return;
}
bool called = false;
auto call = [this, observer, &called, plane, equation] {
called = true;
observer->observeReads();
mImports.glGetClipPlanefOES(plane, equation);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_single_precision);
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::GlGetClipPlanefOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), plane, toEncoder< gapic::coder::gles::GLfloat__P >(equation, *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::glGetFramebufferAttachmentParameterivOES(CallObserver* observer, uint32_t target, uint32_t attachment, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetFramebufferAttachmentParameterivOES(%u, %u, %u, %p)", target, attachment, pname, params);
if (mImports.glGetFramebufferAttachmentParameterivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetFramebufferAttachmentParameterivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, attachment, pname, params] {
called = true;
observer->observeReads();
mImports.glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
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::GlGetFramebufferAttachmentParameterivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, attachment, 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::glGetMaterialxv(CallObserver* observer, uint32_t face, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glGetMaterialxv(%u, %u, %p)", face, pname, params);
if (mImports.glGetMaterialxv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetMaterialxv");
return;
}
bool called = false;
auto call = [this, observer, &called, face, pname, params] {
called = true;
observer->observeReads();
mImports.glGetMaterialxv(face, 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::GlGetMaterialxv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), face, 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::glGetTexEnviv(CallObserver* observer, uint32_t target, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetTexEnviv(%u, %u, %p)", target, pname, params);
if (mImports.glGetTexEnviv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexEnviv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexEnviv(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::GlGetTexEnviv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, 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::glGetTexEnvxvOES(CallObserver* observer, uint32_t target, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glGetTexEnvxvOES(%u, %u, %p)", target, pname, params);
if (mImports.glGetTexEnvxvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexEnvxvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexEnvxvOES(target, pname, params);
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::GlGetTexEnvxvOES 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::glGetTexGenivOES(CallObserver* observer, uint32_t coord, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetTexGenivOES(%u, %u, %p)", coord, pname, params);
if (mImports.glGetTexGenivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexGenivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, coord, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexGenivOES(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::GlGetTexGenivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), coord, 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::glLightModelx(CallObserver* observer, uint32_t pname, GLfixed param) {
GAPID_DEBUG("glLightModelx(%u, %" PRId32 ")", pname, param);
if (mImports.glLightModelx == nullptr) {
GAPID_WARNING("Application called unsupported function glLightModelx");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, param] {
called = true;
observer->observeReads();
mImports.glLightModelx(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::GlLightModelx 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);
}
void GlesSpy::glLightxvOES(CallObserver* observer, uint32_t light, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glLightxvOES(%u, %u, %p)", light, pname, params);
if (mImports.glLightxvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glLightxvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, light, pname, params] {
called = true;
observer->observeReads();
mImports.glLightxvOES(light, pname, params);
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::GlLightxvOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), light, 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::glMaterialx(CallObserver* observer, uint32_t face, uint32_t pname, GLfixed param) {
GAPID_DEBUG("glMaterialx(%u, %u, %" PRId32 ")", face, pname, param);
if (mImports.glMaterialx == nullptr) {
GAPID_WARNING("Application called unsupported function glMaterialx");
return;
}
bool called = false;
auto call = [this, observer, &called, face, pname, param] {
called = true;
observer->observeReads();
mImports.glMaterialx(face, 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::GlMaterialx coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), face, 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::glOrthoxOES(CallObserver* observer, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
GAPID_DEBUG("glOrthoxOES(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", l, r, b, t, n, f);
if (mImports.glOrthoxOES == nullptr) {
GAPID_WARNING("Application called unsupported function glOrthoxOES");
return;
}
bool called = false;
auto call = [this, observer, &called, l, r, b, t, n, f] {
called = true;
observer->observeReads();
mImports.glOrthoxOES(l, r, b, t, n, f);
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::GlOrthoxOES 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::glPointParameterx(CallObserver* observer, uint32_t pname, GLfixed param) {
GAPID_DEBUG("glPointParameterx(%u, %" PRId32 ")", pname, param);
if (mImports.glPointParameterx == nullptr) {
GAPID_WARNING("Application called unsupported function glPointParameterx");
return;
}
bool called = false;
auto call = [this, observer, &called, pname, param] {
called = true;
observer->observeReads();
mImports.glPointParameterx(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::GlPointParameterx 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);
}
void GlesSpy::glPolygonOffsetx(CallObserver* observer, GLfixed factor, GLfixed units) {
GAPID_DEBUG("glPolygonOffsetx(%" PRId32 ", %" PRId32 ")", factor, units);
if (mImports.glPolygonOffsetx == nullptr) {
GAPID_WARNING("Application called unsupported function glPolygonOffsetx");
return;
}
bool called = false;
auto call = [this, observer, &called, factor, units] {
called = true;
observer->observeReads();
mImports.glPolygonOffsetx(factor, units);
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::GlPolygonOffsetx coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(factor, *observer->getScratch()), toEncoder< int32_t >(units, *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::glRotatef(CallObserver* observer, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
GAPID_DEBUG("glRotatef(%f, %f, %f, %f)", angle, x, y, z);
if (mImports.glRotatef == nullptr) {
GAPID_WARNING("Application called unsupported function glRotatef");
return;
}
bool called = false;
auto call = [this, observer, &called, angle, x, y, z] {
called = true;
observer->observeReads();
mImports.glRotatef(angle, 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::GlRotatef coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(angle, *observer->getScratch()), toEncoder< float >(x, *observer->getScratch()), toEncoder< float >(y, *observer->getScratch()), toEncoder< float >(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::glScalexOES(CallObserver* observer, GLfixed x, GLfixed y, GLfixed z) {
GAPID_DEBUG("glScalexOES(%" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, z);
if (mImports.glScalexOES == nullptr) {
GAPID_WARNING("Application called unsupported function glScalexOES");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, z] {
called = true;
observer->observeReads();
mImports.glScalexOES(x, y, z);
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::GlScalexOES 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::glTexCoordPointer(CallObserver* observer, GLint size, uint32_t type, GLsizei stride, void* pointer) {
GAPID_DEBUG("glTexCoordPointer(%" PRId32 ", %u, %" PRId32 ", %p)", size, type, stride, pointer);
if (mImports.glTexCoordPointer == nullptr) {
GAPID_WARNING("Application called unsupported function glTexCoordPointer");
return;
}
bool called = false;
auto call = [this, observer, &called, size, type, stride, pointer] {
called = true;
observer->observeReads();
mImports.glTexCoordPointer(size, type, stride, pointer);
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::GlTexCoordPointer 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::glTexEnvi(CallObserver* observer, uint32_t target, uint32_t pname, GLint param) {
GAPID_DEBUG("glTexEnvi(%u, %u, %" PRId32 ")", target, pname, param);
if (mImports.glTexEnvi == nullptr) {
GAPID_WARNING("Application called unsupported function glTexEnvi");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, param] {
called = true;
observer->observeReads();
mImports.glTexEnvi(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::GlTexEnvi coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, 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::glTexParameterxvOES(CallObserver* observer, uint32_t target, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glTexParameterxvOES(%u, %u, %p)", target, pname, params);
if (mImports.glTexParameterxvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTexParameterxvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glTexParameterxvOES(target, pname, params);
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::GlTexParameterxvOES 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::glWeightPointerOESBounds(CallObserver* observer, GLint size, uint32_t type, GLsizei stride, void* pointer, GLsizei count) {
GAPID_DEBUG("glWeightPointerOESBounds(%" PRId32 ", %u, %" PRId32 ", %p, %" PRId32 ")", size, type, stride, pointer, count);
if (mImports.glWeightPointerOESBounds == nullptr) {
GAPID_WARNING("Application called unsupported function glWeightPointerOESBounds");
return;
}
bool called = false;
auto call = [this, observer, &called, size, type, stride, pointer, count] {
called = true;
observer->observeReads();
mImports.glWeightPointerOESBounds(size, type, stride, pointer, count);
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::GlWeightPointerOESBounds 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);
}
} // namespace gapii