blob: 818147aebcd882a5c552764fbd891d7d3b525658 [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::glDebugMessageControlKHR(CallObserver* observer, uint32_t source, uint32_t type, uint32_t severity, GLsizei count, GLuint* ids, GLboolean enabled) {
GAPID_DEBUG("glDebugMessageControlKHR(%u, %u, %u, %" PRId32 ", %p, %" PRIu8 ")", source, type, severity, count, ids, enabled);
if (mImports.glDebugMessageControlKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glDebugMessageControlKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, source, type, severity, count, ids, enabled] {
called = true;
observer->observeReads();
mImports.glDebugMessageControlKHR(source, type, severity, count, ids, enabled);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
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::GlDebugMessageControlKHR 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::glGetObjectLabelKHR(CallObserver* observer, uint32_t identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label) {
GAPID_DEBUG("glGetObjectLabelKHR(%u, %" PRIu32 ", %" PRId32 ", %p, %p)", identifier, name, bufSize, length, label);
if (mImports.glGetObjectLabelKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glGetObjectLabelKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, identifier, name, bufSize, length, label] {
called = true;
observer->observeReads();
mImports.glGetObjectLabelKHR(identifier, name, bufSize, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
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::GlGetObjectLabelKHR 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::glObjectPtrLabelKHR(CallObserver* observer, void* ptr, GLsizei length, GLchar* label) {
GAPID_DEBUG("glObjectPtrLabelKHR(%p, %" PRId32 ", %p)", ptr, length, label);
if (mImports.glObjectPtrLabelKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glObjectPtrLabelKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, ptr, length, label] {
called = true;
observer->observeReads();
mImports.glObjectPtrLabelKHR(ptr, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_debug);
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::GlObjectPtrLabelKHR 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::glGenQueries(CallObserver* observer, GLsizei count, QueryId* queries) {
GAPID_DEBUG("glGenQueries(%" PRId32 ", %p)", count, queries);
if (mImports.glGenQueries == nullptr) {
GAPID_WARNING("Application called unsupported function glGenQueries");
return;
}
bool called = false;
auto call = [this, observer, &called, count, queries] {
called = true;
observer->observeReads();
mImports.glGenQueries(count, queries);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Slice<QueryId> l_q = slice(queries, (uint64_t)((GLsizei)(0L)), (uint64_t)(count));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
call();
for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) {
QueryId l_id = (QueryId)(slice(queries, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]);
checkNotNull(l_ctx).mInstances.mQueries[l_id] = std::shared_ptr<Query>(new Query(""));
observer->write<QueryId>(l_q, (uint64_t)(l_i), l_id);
}
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenQueries coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::QueryId__P >(queries, *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::glDeleteBuffers(CallObserver* observer, GLsizei count, BufferId* buffers) {
GAPID_DEBUG("glDeleteBuffers(%" PRId32 ", %p)", count, buffers);
if (mImports.glDeleteBuffers == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteBuffers");
return;
}
bool called = false;
auto call = [this, observer, &called, count, buffers] {
called = true;
observer->observeReads();
mImports.glDeleteBuffers(count, buffers);
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<BufferId> l_b = slice(buffers, (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) {
BufferId l_id = observer->read(l_b, (uint64_t)(l_i));
if ((l_id) != ((BufferId)(0UL))) {
checkNotNull(l_ctx).mInstances.mBuffers.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::GlDeleteBuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::BufferId__CP >(buffers, *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::glDrawArraysIndirect(CallObserver* observer, uint32_t draw_mode, void* indirect) {
GAPID_DEBUG("glDrawArraysIndirect(%u, %p)", draw_mode, indirect);
if (mImports.glDrawArraysIndirect == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawArraysIndirect");
return;
}
bool called = false;
auto call = [this, observer, &called, draw_mode, indirect] {
called = true;
observer->observeReads();
mImports.glDrawArraysIndirect(draw_mode, indirect);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subCheckPrimitiveType(observer, call, draw_mode);
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
if ((checkNotNull(l_ctx).mBoundVertexArray) == ((VertexArrayId)(0UL))) {
subGlErrorInvalidOperation(observer, call);
}
if ((checkNotNull(l_ctx).mBoundBuffers.mDrawIndirectBuffer) == ((BufferId)(0UL))) {
subGlErrorInvalidOperation(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::GlDrawArraysIndirect coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), draw_mode, toEncoder< gapic::coder::gles::Void__CP >(indirect, *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::glDrawRangeElements(CallObserver* observer, uint32_t draw_mode, GLuint start, GLuint end, GLsizei indices_count, uint32_t indices_type, IndicesPointer indices) {
GAPID_DEBUG("glDrawRangeElements(%u, %" PRIu32 ", %" PRIu32 ", %" PRId32 ", %u, %p)", draw_mode, start, end, indices_count, indices_type, indices);
if (mImports.glDrawRangeElements == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawRangeElements");
return;
}
bool called = false;
auto call = [this, observer, &called, draw_mode, start, end, indices_count, indices_type, indices] {
called = true;
observer->observeReads();
mImports.glDrawRangeElements(draw_mode, start, end, indices_count, indices_type, indices);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
if ((end) < (start)) {
subGlErrorInvalidValue(observer, call);
}
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::GlDrawRangeElements coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), draw_mode, toEncoder< uint32_t >(start, *observer->getScratch()), toEncoder< uint32_t >(end, *observer->getScratch()), 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::glPrimitiveBoundingBox(CallObserver* observer, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
GAPID_DEBUG("glPrimitiveBoundingBox(%f, %f, %f, %f, %f, %f, %f, %f)", minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
if (mImports.glPrimitiveBoundingBox == nullptr) {
GAPID_WARNING("Application called unsupported function glPrimitiveBoundingBox");
return;
}
bool called = false;
auto call = [this, observer, &called, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW] {
called = true;
observer->observeReads();
mImports.glPrimitiveBoundingBox(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
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::GlPrimitiveBoundingBox 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);
}
EGLBoolean GlesSpy::eglBindAPI(CallObserver* observer, uint32_t api) {
GAPID_DEBUG("eglBindAPI(%u)", api);
if (mImports.eglBindAPI == nullptr) {
GAPID_WARNING("Application called unsupported function eglBindAPI");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, api] {
called = true;
observer->observeReads();
result = mImports.eglBindAPI(api);
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::EglBindAPI coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), api, 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::eglGetConfigs(CallObserver* observer, EGLDisplay display, EGLConfig* configs, EGLint config_size, EGLint* num_config) {
GAPID_DEBUG("eglGetConfigs(%p, %p, %d, %p)", display, configs, config_size, num_config);
if (mImports.eglGetConfigs == nullptr) {
GAPID_WARNING("Application called unsupported function eglGetConfigs");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, configs, config_size, num_config] {
called = true;
observer->observeReads();
result = mImports.eglGetConfigs(display, configs, config_size, num_config);
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::EglGetConfigs coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLConfig__P >(configs, *observer->getScratch()), toEncoder< int >(config_size, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLint__P >(num_config, *observer->getScratch()), toEncoder< int >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
EGLBoolean GlesSpy::eglQueryContext(CallObserver* observer, EGLDisplay display, EGLContext context, EGLint attribute, EGLint* value) {
GAPID_DEBUG("eglQueryContext(%p, %p, %d, %p)", display, context, attribute, value);
if (mImports.eglQueryContext == nullptr) {
GAPID_WARNING("Application called unsupported function eglQueryContext");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, display, context, attribute, value] {
called = true;
observer->observeReads();
result = mImports.eglQueryContext(display, context, attribute, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
observer->write<EGLint>(slice(value, 0ULL, 1ULL), 0ULL, slice(value, 0ULL, 1ULL)[0ULL]);
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::EglQueryContext coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::EGLContext >(context, *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::eglReleaseThread(CallObserver* observer) {
GAPID_DEBUG("eglReleaseThread()");
if (mImports.eglReleaseThread == nullptr) {
GAPID_WARNING("Application called unsupported function eglReleaseThread");
return 0;
}
EGLBoolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result] {
called = true;
observer->observeReads();
result = mImports.eglReleaseThread();
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::EglReleaseThread 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::glBeginQueryEXT(CallObserver* observer, uint32_t target, QueryId query) {
GAPID_DEBUG("glBeginQueryEXT(%u, %" PRIu32 ")", target, query);
if (mImports.glBeginQueryEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glBeginQueryEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, query] {
called = true;
observer->observeReads();
mImports.glBeginQueryEXT(target, query);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension2(observer, call, ExtensionId::GL_EXT_disjoint_timer_query, ExtensionId::GL_EXT_occlusion_query_boolean);
call();
} 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::GlBeginQueryEXT 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::glBlendBarrierNV(CallObserver* observer) {
GAPID_DEBUG("glBlendBarrierNV()");
if (mImports.glBlendBarrierNV == nullptr) {
GAPID_WARNING("Application called unsupported function glBlendBarrierNV");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glBlendBarrierNV();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_blend_equation_advanced);
subBlendBarrier(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlendBarrierNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBlitFramebufferNV(CallObserver* observer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, uint32_t mask, uint32_t filter) {
GAPID_DEBUG("glBlitFramebufferNV(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u)", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
if (mImports.glBlitFramebufferNV == nullptr) {
GAPID_WARNING("Application called unsupported function glBlitFramebufferNV");
return;
}
bool called = false;
auto call = [this, observer, &called, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter] {
called = true;
observer->observeReads();
mImports.glBlitFramebufferNV(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_framebuffer_blit);
subBlitFramebuffer(observer, call, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlBlitFramebufferNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(srcX0, *observer->getScratch()), toEncoder< int32_t >(srcY0, *observer->getScratch()), toEncoder< int32_t >(srcX1, *observer->getScratch()), toEncoder< int32_t >(srcY1, *observer->getScratch()), toEncoder< int32_t >(dstX0, *observer->getScratch()), toEncoder< int32_t >(dstY0, *observer->getScratch()), toEncoder< int32_t >(dstX1, *observer->getScratch()), toEncoder< int32_t >(dstY1, *observer->getScratch()), mask, filter);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glCoverageMaskNV(CallObserver* observer, GLboolean mask) {
GAPID_DEBUG("glCoverageMaskNV(%" PRIu8 ")", mask);
if (mImports.glCoverageMaskNV == nullptr) {
GAPID_WARNING("Application called unsupported function glCoverageMaskNV");
return;
}
bool called = false;
auto call = [this, observer, &called, mask] {
called = true;
observer->observeReads();
mImports.glCoverageMaskNV(mask);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_coverage_sample);
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::GlCoverageMaskNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint8_t >(mask, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glDrawArraysInstancedBaseInstanceEXT(CallObserver* observer, uint32_t mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance) {
GAPID_DEBUG("glDrawArraysInstancedBaseInstanceEXT(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu32 ")", mode, first, count, instancecount, baseinstance);
if (mImports.glDrawArraysInstancedBaseInstanceEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawArraysInstancedBaseInstanceEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, mode, first, count, instancecount, baseinstance] {
called = true;
observer->observeReads();
mImports.glDrawArraysInstancedBaseInstanceEXT(mode, first, count, instancecount, baseinstance);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_base_instance);
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::GlDrawArraysInstancedBaseInstanceEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< int32_t >(first, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< int32_t >(instancecount, *observer->getScratch()), toEncoder< uint32_t >(baseinstance, *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::glDrawElementsInstancedBaseVertexEXT(CallObserver* observer, uint32_t mode, GLsizei count, uint32_t type, IndicesPointer indices, GLsizei instancecount, GLint basevertex) {
GAPID_DEBUG("glDrawElementsInstancedBaseVertexEXT(%u, %" PRId32 ", %u, %p, %" PRId32 ", %" PRId32 ")", mode, count, type, indices, instancecount, basevertex);
if (mImports.glDrawElementsInstancedBaseVertexEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawElementsInstancedBaseVertexEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, mode, count, type, indices, instancecount, basevertex] {
called = true;
observer->observeReads();
mImports.glDrawElementsInstancedBaseVertexEXT(mode, count, type, indices, instancecount, basevertex);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_draw_elements_base_vertex);
subDrawElementsInstancedBaseVertex(observer, call, mode, count, type, indices, instancecount, basevertex);
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::GlDrawElementsInstancedBaseVertexEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< int32_t >(count, *observer->getScratch()), type, toEncoder< gapic::coder::gles::IndicesPointer >(indices, *observer->getScratch()), toEncoder< int32_t >(instancecount, *observer->getScratch()), toEncoder< int32_t >(basevertex, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
onPostDrawCall();
}
void GlesSpy::glDrawRangeElementsBaseVertexOES(CallObserver* observer, uint32_t mode, GLuint start, GLuint end, GLsizei count, uint32_t type, IndicesPointer indices, GLint basevertex) {
GAPID_DEBUG("glDrawRangeElementsBaseVertexOES(%u, %" PRIu32 ", %" PRIu32 ", %" PRId32 ", %u, %p, %" PRId32 ")", mode, start, end, count, type, indices, basevertex);
if (mImports.glDrawRangeElementsBaseVertexOES == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawRangeElementsBaseVertexOES");
return;
}
bool called = false;
auto call = [this, observer, &called, mode, start, end, count, type, indices, basevertex] {
called = true;
observer->observeReads();
mImports.glDrawRangeElementsBaseVertexOES(mode, start, end, count, type, indices, basevertex);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_draw_elements_base_vertex);
subDrawRangeElementsBaseVertex(observer, call, mode, start, end, count, type, indices, basevertex);
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::GlDrawRangeElementsBaseVertexOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< uint32_t >(start, *observer->getScratch()), toEncoder< uint32_t >(end, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), type, toEncoder< gapic::coder::gles::IndicesPointer >(indices, *observer->getScratch()), toEncoder< int32_t >(basevertex, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
onPostDrawCall();
}
void GlesSpy::glEnableDriverControlQCOM(CallObserver* observer, GLuint driverControl) {
GAPID_DEBUG("glEnableDriverControlQCOM(%" PRIu32 ")", driverControl);
if (mImports.glEnableDriverControlQCOM == nullptr) {
GAPID_WARNING("Application called unsupported function glEnableDriverControlQCOM");
return;
}
bool called = false;
auto call = [this, observer, &called, driverControl] {
called = true;
observer->observeReads();
mImports.glEnableDriverControlQCOM(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::GlEnableDriverControlQCOM 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::glEnableiNV(CallObserver* observer, uint32_t target, GLuint index) {
GAPID_DEBUG("glEnableiNV(%u, %" PRIu32 ")", target, index);
if (mImports.glEnableiNV == nullptr) {
GAPID_WARNING("Application called unsupported function glEnableiNV");
return;
}
bool called = false;
auto call = [this, observer, &called, target, index] {
called = true;
observer->observeReads();
mImports.glEnableiNV(target, index);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_viewport_array);
subEnablei(observer, call, target, index);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlEnableiNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glEndQueryEXT(CallObserver* observer, uint32_t target) {
GAPID_DEBUG("glEndQueryEXT(%u)", target);
if (mImports.glEndQueryEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glEndQueryEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target] {
called = true;
observer->observeReads();
mImports.glEndQueryEXT(target);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension2(observer, call, ExtensionId::GL_EXT_disjoint_timer_query, ExtensionId::GL_EXT_occlusion_query_boolean);
call();
} 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::GlEndQueryEXT 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::glFramebufferTexture2DMultisampleEXT(CallObserver* observer, uint32_t target, uint32_t attachment, uint32_t textarget, TextureId texture, GLint level, GLsizei samples) {
GAPID_DEBUG("glFramebufferTexture2DMultisampleEXT(%u, %u, %u, %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, attachment, textarget, texture, level, samples);
if (mImports.glFramebufferTexture2DMultisampleEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glFramebufferTexture2DMultisampleEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, attachment, textarget, texture, level, samples] {
called = true;
observer->observeReads();
mImports.glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_multisampled_render_to_texture);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFramebufferTexture2DMultisampleEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, attachment, textarget, toEncoder< uint32_t >(texture, *observer->getScratch()), toEncoder< int32_t >(level, *observer->getScratch()), toEncoder< int32_t >(samples, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glFramebufferTexture3DOES(CallObserver* observer, uint32_t target, uint32_t attachment, uint32_t textarget, TextureId texture, GLint level, GLint zoffset) {
GAPID_DEBUG("glFramebufferTexture3DOES(%u, %u, %u, %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, attachment, textarget, texture, level, zoffset);
if (mImports.glFramebufferTexture3DOES == nullptr) {
GAPID_WARNING("Application called unsupported function glFramebufferTexture3DOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, attachment, textarget, texture, level, zoffset] {
called = true;
observer->observeReads();
mImports.glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_3D);
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::GlFramebufferTexture3DOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, attachment, textarget, toEncoder< uint32_t >(texture, *observer->getScratch()), toEncoder< int32_t >(level, *observer->getScratch()), toEncoder< int32_t >(zoffset, *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::glGetFirstPerfQueryIdINTEL(CallObserver* observer, GLuint* queryId) {
GAPID_DEBUG("glGetFirstPerfQueryIdINTEL(%p)", queryId);
if (mImports.glGetFirstPerfQueryIdINTEL == nullptr) {
GAPID_WARNING("Application called unsupported function glGetFirstPerfQueryIdINTEL");
return;
}
bool called = false;
auto call = [this, observer, &called, queryId] {
called = true;
observer->observeReads();
mImports.glGetFirstPerfQueryIdINTEL(queryId);
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::GlGetFirstPerfQueryIdINTEL coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLuint__P >(queryId, *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::glGetObjectLabelEXT(CallObserver* observer, uint32_t type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar* label) {
GAPID_DEBUG("glGetObjectLabelEXT(%u, %" PRIu32 ", %" PRId32 ", %p, %p)", type, object, bufSize, length, label);
if (mImports.glGetObjectLabelEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glGetObjectLabelEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, type, object, bufSize, length, label] {
called = true;
observer->observeReads();
mImports.glGetObjectLabelEXT(type, object, bufSize, length, label);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_debug_label);
switch (type) {
case GLenum::GL_TEXTURE: // fall-through...
case GLenum::GL_FRAMEBUFFER: // fall-through...
case GLenum::GL_RENDERBUFFER: // fall-through...
case GLenum::GL_BUFFER_OBJECT_EXT: // fall-through...
case GLenum::GL_SHADER_OBJECT_EXT: // fall-through...
case GLenum::GL_PROGRAM_OBJECT_EXT: // fall-through...
case GLenum::GL_VERTEX_ARRAY_OBJECT_EXT: // fall-through...
case GLenum::GL_QUERY_OBJECT_EXT: // fall-through...
case GLenum::GL_SAMPLER: // fall-through...
case GLenum::GL_TRANSFORM_FEEDBACK: // fall-through...
case GLenum::GL_PROGRAM_PIPELINE_OBJECT_EXT: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, type);
}
}
(void)object;
call();
subWriteString(observer, call, 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::GlGetObjectLabelEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), type, toEncoder< uint32_t >(object, *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::glGetPerfMonitorCounterStringAMD(CallObserver* observer, GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString) {
GAPID_DEBUG("glGetPerfMonitorCounterStringAMD(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p, %p)", group, counter, bufSize, length, counterString);
if (mImports.glGetPerfMonitorCounterStringAMD == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPerfMonitorCounterStringAMD");
return;
}
bool called = false;
auto call = [this, observer, &called, group, counter, bufSize, length, counterString] {
called = true;
observer->observeReads();
mImports.glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
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::GlGetPerfMonitorCounterStringAMD coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(group, *observer->getScratch()), toEncoder< uint32_t >(counter, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(counterString, *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::glGetPerfQueryIdByNameINTEL(CallObserver* observer, GLchar* queryName, GLuint* queryId) {
GAPID_DEBUG("glGetPerfQueryIdByNameINTEL(%p, %p)", queryName, queryId);
if (mImports.glGetPerfQueryIdByNameINTEL == nullptr) {
GAPID_WARNING("Application called unsupported function glGetPerfQueryIdByNameINTEL");
return;
}
bool called = false;
auto call = [this, observer, &called, queryName, queryId] {
called = true;
observer->observeReads();
mImports.glGetPerfQueryIdByNameINTEL(queryName, queryId);
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::GlGetPerfQueryIdByNameINTEL coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLchar__P >(queryName, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__P >(queryId, *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::glGetProgramBinaryOES(CallObserver* observer, ProgramId program, GLsizei buffer_size, GLsizei* bytes_written, uint32_t* binary_format, void* binary) {
GAPID_DEBUG("glGetProgramBinaryOES(%" PRIu32 ", %" PRId32 ", %p, %p, %p)", program, buffer_size, bytes_written, binary_format, binary);
if (mImports.glGetProgramBinaryOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetProgramBinaryOES");
return;
}
bool called = false;
auto call = [this, observer, &called, program, buffer_size, bytes_written, binary_format, binary] {
called = true;
observer->observeReads();
mImports.glGetProgramBinaryOES(program, buffer_size, bytes_written, binary_format, binary);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_get_program_binary);
call();
subGetProgramBinary(observer, call, program, buffer_size, bytes_written, binary_format, binary);
} 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::GlGetProgramBinaryOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(buffer_size, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(bytes_written, *observer->getScratch()), toEncoder< gapic::coder::gles::GLenum__P >(binary_format, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__P >(binary, *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::glGetQueryObjectui64vEXT(CallObserver* observer, QueryId query, uint32_t parameter, GLuint64* value) {
GAPID_DEBUG("glGetQueryObjectui64vEXT(%" PRIu32 ", %u, %p)", query, parameter, value);
if (mImports.glGetQueryObjectui64vEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glGetQueryObjectui64vEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, query, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetQueryObjectui64vEXT(query, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_disjoint_timer_query);
call();
observer->write<GLuint64>(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::GlGetQueryObjectui64vEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, *observer->getScratch()), parameter, toEncoder< gapic::coder::gles::GLuint64__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::glGetTexParameterIuivOES(CallObserver* observer, uint32_t target, uint32_t pname, GLuint* params) {
GAPID_DEBUG("glGetTexParameterIuivOES(%u, %u, %p)", target, pname, params);
if (mImports.glGetTexParameterIuivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexParameterIuivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexParameterIuivOES(target, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_border_clamp);
call();
subGetTexParameterIuiv(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::GlGetTexParameterIuivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLuint__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLboolean GlesSpy::glIsPointInStrokePathNV(CallObserver* observer, GLuint path, GLfloat x, GLfloat y) {
GAPID_DEBUG("glIsPointInStrokePathNV(%" PRIu32 ", %f, %f)", path, x, y);
if (mImports.glIsPointInStrokePathNV == nullptr) {
GAPID_WARNING("Application called unsupported function glIsPointInStrokePathNV");
return 0;
}
GLboolean result = 0;
bool called = false;
auto call = [this, observer, &called, &result, path, x, y] {
called = true;
observer->observeReads();
result = mImports.glIsPointInStrokePathNV(path, 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::GlIsPointInStrokePathNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *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::glMatrixLoadTranspose3x3fNV(CallObserver* observer, uint32_t matrixMode, GLfloat* m) {
GAPID_DEBUG("glMatrixLoadTranspose3x3fNV(%u, %p)", matrixMode, m);
if (mImports.glMatrixLoadTranspose3x3fNV == nullptr) {
GAPID_WARNING("Application called unsupported function glMatrixLoadTranspose3x3fNV");
return;
}
bool called = false;
auto call = [this, observer, &called, matrixMode, m] {
called = true;
observer->observeReads();
mImports.glMatrixLoadTranspose3x3fNV(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::GlMatrixLoadTranspose3x3fNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), matrixMode, toEncoder< gapic::coder::gles::GLfloat__CP >(m, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glMultiDrawArraysIndirectEXT(CallObserver* observer, uint32_t mode, void* indirect, GLsizei drawcount, GLsizei stride) {
GAPID_DEBUG("glMultiDrawArraysIndirectEXT(%u, %p, %" PRId32 ", %" PRId32 ")", mode, indirect, drawcount, stride);
if (mImports.glMultiDrawArraysIndirectEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glMultiDrawArraysIndirectEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, mode, indirect, drawcount, stride] {
called = true;
observer->observeReads();
mImports.glMultiDrawArraysIndirectEXT(mode, indirect, drawcount, stride);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_multi_draw_indirect);
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::GlMultiDrawArraysIndirectEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< gapic::coder::gles::Void__CP >(indirect, *observer->getScratch()), toEncoder< int32_t >(drawcount, *observer->getScratch()), toEncoder< int32_t >(stride, *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::glNamedFramebufferSampleLocationsfvNV(CallObserver* observer, FramebufferId framebuffer, GLuint start, GLsizei count, GLfloat* v) {
GAPID_DEBUG("glNamedFramebufferSampleLocationsfvNV(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p)", framebuffer, start, count, v);
if (mImports.glNamedFramebufferSampleLocationsfvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glNamedFramebufferSampleLocationsfvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, framebuffer, start, count, v] {
called = true;
observer->observeReads();
mImports.glNamedFramebufferSampleLocationsfvNV(framebuffer, 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::GlNamedFramebufferSampleLocationsfvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(framebuffer, *observer->getScratch()), 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);
}
uint32_t GlesSpy::glPathGlyphIndexRangeNV(CallObserver* observer, uint32_t fontTarget, void* fontName, uint32_t fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount) {
GAPID_DEBUG("glPathGlyphIndexRangeNV(%u, %p, %u, %" PRIu32 ", %f, %" PRIu32 ")", fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount);
if (mImports.glPathGlyphIndexRangeNV == nullptr) {
GAPID_WARNING("Application called unsupported function glPathGlyphIndexRangeNV");
return 0;
}
uint32_t result = 0;
bool called = false;
auto call = [this, observer, &called, &result, fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount] {
called = true;
observer->observeReads();
result = mImports.glPathGlyphIndexRangeNV(fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount);
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::GlPathGlyphIndexRangeNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), fontTarget, toEncoder< gapic::coder::gles::Void__CP >(fontName, *observer->getScratch()), fontStyle, toEncoder< uint32_t >(pathParameterTemplate, *observer->getScratch()), toEncoder< float >(emScale, *observer->getScratch()), toEncoder< uint32_t >(baseAndCount, *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::glPathParameterfvNV(CallObserver* observer, GLuint path, uint32_t pname, GLfloat* value) {
GAPID_DEBUG("glPathParameterfvNV(%" PRIu32 ", %u, %p)", path, pname, value);
if (mImports.glPathParameterfvNV == nullptr) {
GAPID_WARNING("Application called unsupported function glPathParameterfvNV");
return;
}
bool called = false;
auto call = [this, observer, &called, path, pname, value] {
called = true;
observer->observeReads();
mImports.glPathParameterfvNV(path, pname, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlPathParameterfvNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *observer->getScratch()), pname, 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::glPathStringNV(CallObserver* observer, GLuint path, uint32_t format, GLsizei length, void* pathString) {
GAPID_DEBUG("glPathStringNV(%" PRIu32 ", %u, %" PRId32 ", %p)", path, format, length, pathString);
if (mImports.glPathStringNV == nullptr) {
GAPID_WARNING("Application called unsupported function glPathStringNV");
return;
}
bool called = false;
auto call = [this, observer, &called, path, format, length, pathString] {
called = true;
observer->observeReads();
mImports.glPathStringNV(path, format, length, pathString);
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::GlPathStringNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, *observer->getScratch()), format, toEncoder< int32_t >(length, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__CP >(pathString, *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::glProgramUniform1fEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLfloat v0) {
GAPID_DEBUG("glProgramUniform1fEXT(%" PRIu32 ", %" PRId32 ", %f)", program, location, v0);
if (mImports.glProgramUniform1fEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform1fEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, v0] {
called = true;
observer->observeReads();
mImports.glProgramUniform1fEXT(program, location, v0);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniform1f(observer, call, program, location, v0);
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::GlProgramUniform1fEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< float >(v0, *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::glProgramUniform3uiEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLuint v0, GLuint v1, GLuint v2) {
GAPID_DEBUG("glProgramUniform3uiEXT(%" PRIu32 ", %" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, location, v0, v1, v2);
if (mImports.glProgramUniform3uiEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform3uiEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, v0, v1, v2] {
called = true;
observer->observeReads();
mImports.glProgramUniform3uiEXT(program, location, v0, v1, v2);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniform3ui(observer, call, program, location, v0, v1, v2);
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::GlProgramUniform3uiEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint32_t >(v0, *observer->getScratch()), toEncoder< uint32_t >(v1, *observer->getScratch()), toEncoder< uint32_t >(v2, *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::glProgramUniform4iEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLint v0, GLint v1, GLint v2, GLint v3) {
GAPID_DEBUG("glProgramUniform4iEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", program, location, v0, v1, v2, v3);
if (mImports.glProgramUniform4iEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform4iEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, v0, v1, v2, v3] {
called = true;
observer->observeReads();
mImports.glProgramUniform4iEXT(program, location, v0, v1, v2, v3);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniform4i(observer, call, program, location, v0, v1, v2, v3);
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::GlProgramUniform4iEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(v0, *observer->getScratch()), toEncoder< int32_t >(v1, *observer->getScratch()), toEncoder< int32_t >(v2, *observer->getScratch()), toEncoder< int32_t >(v3, *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::glProgramUniformMatrix4fvEXT(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) {
GAPID_DEBUG("glProgramUniformMatrix4fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value);
if (mImports.glProgramUniformMatrix4fvEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix4fvEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, value] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_separate_shader_objects);
subProgramUniformMatrix4fv(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::GlProgramUniformMatrix4fvEXT 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::glReadBufferIndexedEXT(CallObserver* observer, uint32_t src, GLint index) {
GAPID_DEBUG("glReadBufferIndexedEXT(%u, %" PRId32 ")", src, index);
if (mImports.glReadBufferIndexedEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glReadBufferIndexedEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, src, index] {
called = true;
observer->observeReads();
mImports.glReadBufferIndexedEXT(src, index);
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::GlReadBufferIndexedEXT coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), src, toEncoder< int32_t >(index, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glReadnPixelsEXT(CallObserver* observer, GLint x, GLint y, GLsizei width, GLsizei height, uint32_t format, uint32_t type, GLsizei bufSize, void* data) {
GAPID_DEBUG("glReadnPixelsEXT(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %" PRId32 ", %p)", x, y, width, height, format, type, bufSize, data);
if (mImports.glReadnPixelsEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glReadnPixelsEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, width, height, format, type, bufSize, data] {
called = true;
observer->observeReads();
mImports.glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_robustness);
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::GlReadnPixelsEXT 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);
}
void GlesSpy::glReadnPixelsKHR(CallObserver* observer, GLint x, GLint y, GLsizei width, GLsizei height, uint32_t format, uint32_t type, GLsizei bufSize, void* data) {
GAPID_DEBUG("glReadnPixelsKHR(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %" PRId32 ", %p)", x, y, width, height, format, type, bufSize, data);
if (mImports.glReadnPixelsKHR == nullptr) {
GAPID_WARNING("Application called unsupported function glReadnPixelsKHR");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, width, height, format, type, bufSize, data] {
called = true;
observer->observeReads();
mImports.glReadnPixelsKHR(x, y, width, height, format, type, bufSize, data);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_KHR_robustness);
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::GlReadnPixelsKHR 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);
}
void GlesSpy::glRenderbufferStorageMultisampleAPPLE(CallObserver* observer, uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) {
GAPID_DEBUG("glRenderbufferStorageMultisampleAPPLE(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height);
if (mImports.glRenderbufferStorageMultisampleAPPLE == nullptr) {
GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleAPPLE");
return;
}
bool called = false;
auto call = [this, observer, &called, target, samples, internalformat, width, height] {
called = true;
observer->observeReads();
mImports.glRenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_APPLE_framebuffer_multisample);
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::GlRenderbufferStorageMultisampleAPPLE coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, *observer->getScratch()), internalformat, toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glRenderbufferStorageMultisampleNV(CallObserver* observer, uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) {
GAPID_DEBUG("glRenderbufferStorageMultisampleNV(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height);
if (mImports.glRenderbufferStorageMultisampleNV == nullptr) {
GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleNV");
return;
}
bool called = false;
auto call = [this, observer, &called, target, samples, internalformat, width, height] {
called = true;
observer->observeReads();
mImports.glRenderbufferStorageMultisampleNV(target, samples, internalformat, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_framebuffer_multisample);
subRenderbufferStorageMultisample(observer, call, target, samples, internalformat, width, height);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlRenderbufferStorageMultisampleNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, *observer->getScratch()), internalformat, toEncoder< int32_t >(width, *observer->getScratch()), toEncoder< int32_t >(height, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glResolveMultisampleFramebufferAPPLE(CallObserver* observer) {
GAPID_DEBUG("glResolveMultisampleFramebufferAPPLE()");
if (mImports.glResolveMultisampleFramebufferAPPLE == nullptr) {
GAPID_WARNING("Application called unsupported function glResolveMultisampleFramebufferAPPLE");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glResolveMultisampleFramebufferAPPLE();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_APPLE_framebuffer_multisample);
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::GlResolveMultisampleFramebufferAPPLE coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glSamplerParameterIivOES(CallObserver* observer, SamplerId sampler, uint32_t pname, GLint* param) {
GAPID_DEBUG("glSamplerParameterIivOES(%" PRIu32 ", %u, %p)", sampler, pname, param);
if (mImports.glSamplerParameterIivOES == nullptr) {
GAPID_WARNING("Application called unsupported function glSamplerParameterIivOES");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, param] {
called = true;
observer->observeReads();
mImports.glSamplerParameterIivOES(sampler, pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_texture_border_clamp);
subSamplerParameterIiv(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::GlSamplerParameterIivOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLint__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::glStencilThenCoverStrokePathInstancedNV(CallObserver* observer, GLsizei numPaths, uint32_t pathNameType, void* paths, GLuint pathBase, GLint reference, GLuint mask, uint32_t coverMode, uint32_t transformType, GLfloat* transformValues) {
GAPID_DEBUG("glStencilThenCoverStrokePathInstancedNV(%" PRId32 ", %u, %p, %" PRIu32 ", %" PRId32 ", %" PRIu32 ", %u, %u, %p)", numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues);
if (mImports.glStencilThenCoverStrokePathInstancedNV == nullptr) {
GAPID_WARNING("Application called unsupported function glStencilThenCoverStrokePathInstancedNV");
return;
}
bool called = false;
auto call = [this, observer, &called, numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues] {
called = true;
observer->observeReads();
mImports.glStencilThenCoverStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_path_rendering);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlStencilThenCoverStrokePathInstancedNV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(numPaths, *observer->getScratch()), pathNameType, toEncoder< gapic::coder::gles::Void__CP >(paths, *observer->getScratch()), toEncoder< uint32_t >(pathBase, *observer->getScratch()), toEncoder< int32_t >(reference, *observer->getScratch()), toEncoder< uint32_t >(mask, *observer->getScratch()), coverMode, transformType, toEncoder< gapic::coder::gles::GLfloat__CP >(transformValues, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexPageCommitmentEXT(CallObserver* observer, uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) {
GAPID_DEBUG("glTexPageCommitmentEXT(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ")", target, level, xoffset, yoffset, zoffset, width, height, depth, commit);
if (mImports.glTexPageCommitmentEXT == nullptr) {
GAPID_WARNING("Application called unsupported function glTexPageCommitmentEXT");
return;
}
bool called = false;
auto call = [this, observer, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, commit] {
called = true;
observer->observeReads();
mImports.glTexPageCommitmentEXT(target, level, xoffset, yoffset, zoffset, width, height, depth, commit);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_EXT_sparse_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::GlTexPageCommitmentEXT 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()), toEncoder< uint8_t >(commit, *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::glUniformHandleui64NV(CallObserver* observer, UniformLocation location, GLuint64 value) {
GAPID_DEBUG("glUniformHandleui64NV(%" PRId32 ", %" PRIu64 ")", location, value);
if (mImports.glUniformHandleui64NV == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformHandleui64NV");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value] {
called = true;
observer->observeReads();
mImports.glUniformHandleui64NV(location, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_NV_bindless_texture);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlUniformHandleui64NV coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint64_t >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glStencilOpSeparate(CallObserver* observer, uint32_t face, uint32_t stencil_fail, uint32_t stencil_pass_depth_fail, uint32_t stencil_pass_depth_pass) {
GAPID_DEBUG("glStencilOpSeparate(%u, %u, %u, %u)", face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass);
if (mImports.glStencilOpSeparate == nullptr) {
GAPID_WARNING("Application called unsupported function glStencilOpSeparate");
return;
}
bool called = false;
auto call = [this, observer, &called, face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass] {
called = true;
observer->observeReads();
mImports.glStencilOpSeparate(face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
subStencilOpSeparate(observer, call, face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass);
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::GlStencilOpSeparate coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass);
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::glBindFramebuffer(CallObserver* observer, uint32_t target, FramebufferId framebuffer) {
GAPID_DEBUG("glBindFramebuffer(%u, %" PRIu32 ")", target, framebuffer);
if (mImports.glBindFramebuffer == nullptr) {
GAPID_WARNING("Application called unsupported function glBindFramebuffer");
return;
}
bool called = false;
auto call = [this, observer, &called, target, framebuffer] {
called = true;
observer->observeReads();
mImports.glBindFramebuffer(target, framebuffer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
switch (target) {
case GLenum::GL_FRAMEBUFFER: {
break;
}
case GLenum::GL_DRAW_FRAMEBUFFER: // fall-through...
case GLenum::GL_READ_FRAMEBUFFER: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, target);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
if (!(checkNotNull(l_ctx).mInstances.mFramebuffers.count(framebuffer) > 0)) {
checkNotNull(l_ctx).mInstances.mFramebuffers[framebuffer] = std::shared_ptr<Framebuffer>(new Framebuffer(GLenumToFramebufferAttachment(), GLintToGLenum(), GLenum::GL_COLOR_ATTACHMENT0, (GLint)(0L), (GLint)(0L), (GLint)(0L), (GLint)(0L), GLbooleanLabels::GL_FALSE, ""));
}
if ((target) == (GLenum::GL_FRAMEBUFFER)) {
checkNotNull(l_ctx).mBoundFramebuffers[GLenum::GL_READ_FRAMEBUFFER] = framebuffer;
checkNotNull(l_ctx).mBoundFramebuffers[GLenum::GL_DRAW_FRAMEBUFFER] = framebuffer;
} else {
checkNotNull(l_ctx).mBoundFramebuffers[target] = framebuffer;
}
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::GlBindFramebuffer 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::glColorMaski(CallObserver* observer, DrawBufferIndex index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
GAPID_DEBUG("glColorMaski(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", index, r, g, b, a);
if (mImports.glColorMaski == nullptr) {
GAPID_WARNING("Application called unsupported function glColorMaski");
return;
}
bool called = false;
auto call = [this, observer, &called, index, r, g, b, a] {
called = true;
observer->observeReads();
mImports.glColorMaski(index, r, g, b, a);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
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::GlColorMaski 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::glGenFramebuffers(CallObserver* observer, GLsizei count, FramebufferId* framebuffers) {
GAPID_DEBUG("glGenFramebuffers(%" PRId32 ", %p)", count, framebuffers);
if (mImports.glGenFramebuffers == nullptr) {
GAPID_WARNING("Application called unsupported function glGenFramebuffers");
return;
}
bool called = false;
auto call = [this, observer, &called, count, framebuffers] {
called = true;
observer->observeReads();
mImports.glGenFramebuffers(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);
call();
for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) {
FramebufferId l_id = (FramebufferId)(slice(framebuffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]);
checkNotNull(l_ctx).mInstances.mFramebuffers[l_id] = std::shared_ptr<Framebuffer>(new Framebuffer(GLenumToFramebufferAttachment(), GLintToGLenum(), GLenum::GL_COLOR_ATTACHMENT0, (GLint)(0L), (GLint)(0L), (GLint)(0L), (GLint)(0L), GLbooleanLabels::GL_FALSE, ""));
observer->write<FramebufferId>(l_f, (uint64_t)(l_i), l_id);
}
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenFramebuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::FramebufferId__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::glGetFramebufferAttachmentParameteriv(CallObserver* observer, uint32_t framebuffer_target, uint32_t attachment, uint32_t parameter, GLint* value) {
GAPID_DEBUG("glGetFramebufferAttachmentParameteriv(%u, %u, %u, %p)", framebuffer_target, attachment, parameter, value);
if (mImports.glGetFramebufferAttachmentParameteriv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetFramebufferAttachmentParameteriv");
return;
}
bool called = false;
auto call = [this, observer, &called, framebuffer_target, attachment, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetFramebufferAttachmentParameteriv(framebuffer_target, attachment, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
switch (attachment) {
case GLenum::GL_COLOR_ATTACHMENT0: // fall-through...
case GLenum::GL_DEPTH_ATTACHMENT: // fall-through...
case GLenum::GL_STENCIL_ATTACHMENT: {
break;
}
case GLenum::GL_BACK: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT1: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT10: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT11: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT12: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT13: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT14: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT15: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT2: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT3: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT4: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT5: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT6: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT7: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT8: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT9: // fall-through...
case GLenum::GL_DEPTH: // fall-through...
case GLenum::GL_DEPTH_STENCIL_ATTACHMENT: // fall-through...
case GLenum::GL_STENCIL: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, attachment);
}
}
switch (parameter) {
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: {
break;
}
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: // fall-through...
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
break;
}
case GLenum::GL_FRAMEBUFFER_ATTACHMENT_LAYERED: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
break;
}
default: {
subGlErrorInvalidEnum(observer, call, parameter);
}
}
std::shared_ptr<Framebuffer> l_framebuffer = subGetBoundFramebufferOrErrorInvalidEnum(observer, call, framebuffer_target);
FramebufferAttachment l_a = findOrZero(checkNotNull(l_framebuffer).mAttachments, attachment);
if (((l_a.mObjectType) == (GLenum::GL_NONE)) && (((parameter) != (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)) && ((parameter) != (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)))) {
subGlErrorInvalidOperation(observer, call);
}
call();
observer->write<GLint>(slice(value, 0ULL, 1ULL), 0ULL, /* switch(parameter) */
/* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE))) ? ((GLint)(l_a.mObjectType)) :
/* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME))) ? ((GLint)(l_a.mObjectName)) :
/* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL))) ? (l_a.mTextureLevel) :
/* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE))) ? ((GLint)(l_a.mTextureCubeMapFace)) :
/* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_LAYERED: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_LAYERED))) ? ((GLint)(l_a.mLayered)) :
/* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER))) ? (l_a.mTextureLayer) :
/* default: */ 0);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetFramebufferAttachmentParameteriv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), framebuffer_target, attachment, parameter, toEncoder< gapic::coder::gles::GLint__P >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glReadBuffer(CallObserver* observer, uint32_t src) {
GAPID_DEBUG("glReadBuffer(%u)", src);
if (mImports.glReadBuffer == nullptr) {
GAPID_WARNING("Application called unsupported function glReadBuffer");
return;
}
bool called = false;
auto call = [this, observer, &called, src] {
called = true;
observer->observeReads();
mImports.glReadBuffer(src);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (src) {
case GLenum::GL_BACK: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT0: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT1: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT10: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT11: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT12: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT13: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT14: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT15: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT2: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT3: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT4: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT5: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT6: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT7: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT8: // fall-through...
case GLenum::GL_COLOR_ATTACHMENT9: // fall-through...
case GLenum::GL_NONE: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, src);
}
}
std::shared_ptr<Framebuffer> l_framebuffer = subGetBoundFramebufferOrErrorInvalidEnum(observer, call, GLenum::GL_READ_FRAMEBUFFER);
checkNotNull(l_framebuffer).mReadBuffer = src;
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::GlReadBuffer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), src);
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::glFlush(CallObserver* observer) {
GAPID_DEBUG("glFlush()");
if (mImports.glFlush == nullptr) {
GAPID_WARNING("Application called unsupported function glFlush");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glFlush();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(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::GlFlush coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
uint32_t GlesSpy::glGetGraphicsResetStatus(CallObserver* observer) {
GAPID_DEBUG("glGetGraphicsResetStatus()");
if (mImports.glGetGraphicsResetStatus == nullptr) {
GAPID_WARNING("Application called unsupported function glGetGraphicsResetStatus");
return 0;
}
uint32_t result = 0;
bool called = false;
auto call = [this, observer, &called, &result] {
called = true;
observer->observeReads();
result = mImports.glGetGraphicsResetStatus();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
subGetGraphicsResetStatus(observer, call);
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::GlGetGraphicsResetStatus coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), result);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glDeleteShader(CallObserver* observer, ShaderId shader) {
GAPID_DEBUG("glDeleteShader(%" PRIu32 ")", shader);
if (mImports.glDeleteShader == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteShader");
return;
}
bool called = false;
auto call = [this, observer, &called, shader] {
called = true;
observer->observeReads();
mImports.glDeleteShader(shader);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
if ((shader) != ((ShaderId)(0UL))) {
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckShader(observer, call, l_ctx, shader);
if (checkNotNull(l_ctx).mInstances.mShaders.count(shader) > 0) {
std::shared_ptr<Shader> l_s = findOrZero(checkNotNull(l_ctx).mInstances.mShaders, shader);
checkNotNull(l_s).mDeleteStatus = true;
subReapShader(observer, call, l_ctx, shader, l_s);
}
}
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDeleteShader coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetAttachedShaders(CallObserver* observer, ProgramId program, GLsizei buffer_length, GLsizei* shaders_length_written, ShaderId* shaders) {
GAPID_DEBUG("glGetAttachedShaders(%" PRIu32 ", %" PRId32 ", %p, %p)", program, buffer_length, shaders_length_written, shaders);
if (mImports.glGetAttachedShaders == nullptr) {
GAPID_WARNING("Application called unsupported function glGetAttachedShaders");
return;
}
bool called = false;
auto call = [this, observer, &called, program, buffer_length, shaders_length_written, shaders] {
called = true;
observer->observeReads();
mImports.glGetAttachedShaders(program, buffer_length, shaders_length_written, shaders);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckProgram(observer, call, l_ctx, program);
if ((buffer_length) < ((GLsizei)(0L))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<Program> l_p = findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, program);
int32_t l_l = subMin(observer, call, (int32_t)(buffer_length), int32_t((checkNotNull(l_p).mShaders.size())));
call();
if ((shaders_length_written) != (nullptr)) {
observer->write<GLsizei>(slice(shaders_length_written, 0ULL, 1ULL), 0ULL, (GLsizei)(l_l));
}
Slice<ShaderId> l_s = slice(shaders, (uint64_t)(0L), (uint64_t)(l_l));
{
int32_t l_i = 0;
for (GLenumToShaderId::iterator it = checkNotNull(l_p).mShaders.begin(); it != checkNotNull(l_p).mShaders.end(); ++it, ++l_i) {
uint32_t l__ = it->first;
ShaderId l_v = it->second;
if ((l_i) < (l_l)) {
observer->write<ShaderId>(l_s, (uint64_t)(l_i), l_v);
}
}
}
} 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::GlGetAttachedShaders coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(buffer_length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(shaders_length_written, *observer->getScratch()), toEncoder< gapic::coder::gles::ShaderId__P >(shaders, *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::glGetProgramInfoLog(CallObserver* observer, ProgramId program, GLsizei buffer_length, GLsizei* string_length_written, GLchar* info) {
GAPID_DEBUG("glGetProgramInfoLog(%" PRIu32 ", %" PRId32 ", %p, %p)", program, buffer_length, string_length_written, info);
if (mImports.glGetProgramInfoLog == nullptr) {
GAPID_WARNING("Application called unsupported function glGetProgramInfoLog");
return;
}
bool called = false;
auto call = [this, observer, &called, program, buffer_length, string_length_written, info] {
called = true;
observer->observeReads();
mImports.glGetProgramInfoLog(program, buffer_length, string_length_written, info);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckProgram(observer, call, l_ctx, program);
if ((buffer_length) < ((GLsizei)(0L))) {
subGlErrorInvalidValue(observer, call);
}
call();
subWriteString(observer, call, buffer_length, string_length_written, info);
} 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::GlGetProgramInfoLog coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(buffer_length, *observer->getScratch()), toEncoder< gapic::coder::gles::GLsizei__P >(string_length_written, *observer->getScratch()), toEncoder< gapic::coder::gles::GLchar__P >(info, *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::glGetShaderiv(CallObserver* observer, ShaderId shader, uint32_t parameter, GLint* value) {
GAPID_DEBUG("glGetShaderiv(%" PRIu32 ", %u, %p)", shader, parameter, value);
if (mImports.glGetShaderiv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetShaderiv");
return;
}
bool called = false;
auto call = [this, observer, &called, shader, parameter, value] {
called = true;
observer->observeReads();
mImports.glGetShaderiv(shader, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
switch (parameter) {
case GLenum::GL_COMPILE_STATUS: // fall-through...
case GLenum::GL_DELETE_STATUS: // fall-through...
case GLenum::GL_INFO_LOG_LENGTH: // fall-through...
case GLenum::GL_SHADER_SOURCE_LENGTH: // fall-through...
case GLenum::GL_SHADER_TYPE: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, parameter);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
subCheckShader(observer, call, l_ctx, shader);
std::shared_ptr<Shader> l_s = findOrZero(checkNotNull(l_ctx).mInstances.mShaders, shader);
call();
observer->write<GLint>(slice(value, 0ULL, 1ULL), 0ULL, /* switch(parameter) */
/* case GLenum::GL_SHADER_TYPE: */(((parameter) == (GLenum::GL_SHADER_TYPE))) ? ((GLint)(checkNotNull(l_s).mType)) :
/* case GLenum::GL_DELETE_STATUS: */(((parameter) == (GLenum::GL_DELETE_STATUS))) ? (/* switch(checkNotNull(l_s).mDeleteStatus) */
/* case true: */(((checkNotNull(l_s).mDeleteStatus) == (true))) ? ((GLint)(1L)) :
/* case false: */(((checkNotNull(l_s).mDeleteStatus) == (false))) ? ((GLint)(0L)) :
/* default: */ 0) :
/* case GLenum::GL_COMPILE_STATUS: */(((parameter) == (GLenum::GL_COMPILE_STATUS))) ? (/* switch(checkNotNull(l_s).mCompiled) */
/* case true: */(((checkNotNull(l_s).mCompiled) == (true))) ? ((GLint)(1L)) :
/* case false: */(((checkNotNull(l_s).mCompiled) == (false))) ? ((GLint)(0L)) :
/* default: */ 0) :
/* case GLenum::GL_INFO_LOG_LENGTH: */(((parameter) == (GLenum::GL_INFO_LOG_LENGTH))) ? ((GLint)(int32_t((checkNotNull(l_s).mInfoLog.count())))) :
/* case GLenum::GL_SHADER_SOURCE_LENGTH: */(((parameter) == (GLenum::GL_SHADER_SOURCE_LENGTH))) ? ((GLint)(int32_t((checkNotNull(l_s).mSource.size())))) :
/* default: */ 0);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetShaderiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, *observer->getScratch()), parameter, toEncoder< gapic::coder::gles::GLint__P >(value, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetnUniformfv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei bufSize, GLfloat* values) {
GAPID_DEBUG("glGetnUniformfv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, values);
if (mImports.glGetnUniformfv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetnUniformfv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, bufSize, values] {
called = true;
observer->observeReads();
mImports.glGetnUniformfv(program, location, bufSize, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
call();
subGetnUniformfv_GLfloat__P(observer, call, program, location, bufSize, 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::GlGetnUniformfv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__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::glGetnUniformuiv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei bufSize, GLuint* values) {
GAPID_DEBUG("glGetnUniformuiv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, values);
if (mImports.glGetnUniformuiv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetnUniformuiv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, bufSize, values] {
called = true;
observer->observeReads();
mImports.glGetnUniformuiv(program, location, bufSize, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
call();
subGetnUniformuiv(observer, call, program, location, bufSize, 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::GlGetnUniformuiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(bufSize, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__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::glProgramParameteri(CallObserver* observer, ProgramId program, uint32_t pname, GLint value) {
GAPID_DEBUG("glProgramParameteri(%" PRIu32 ", %u, %" PRId32 ")", program, pname, value);
if (mImports.glProgramParameteri == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramParameteri");
return;
}
bool called = false;
auto call = [this, observer, &called, program, pname, value] {
called = true;
observer->observeReads();
mImports.glProgramParameteri(program, pname, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subProgramParameteri(observer, call, program, 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::GlProgramParameteri coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), 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::glProgramUniform2fv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLfloat* values) {
GAPID_DEBUG("glProgramUniform2fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values);
if (mImports.glProgramUniform2fv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform2fv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, values] {
called = true;
observer->observeReads();
mImports.glProgramUniform2fv(program, location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform2fv(observer, call, program, location, count, 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::GlProgramUniform2fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(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::glProgramUniform2uiv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLuint* values) {
GAPID_DEBUG("glProgramUniform2uiv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values);
if (mImports.glProgramUniform2uiv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform2uiv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, values] {
called = true;
observer->observeReads();
mImports.glProgramUniform2uiv(program, location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform2uiv(observer, call, program, location, count, 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::GlProgramUniform2uiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLuint__CP >(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::glProgramUniform3iv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLint* values) {
GAPID_DEBUG("glProgramUniform3iv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values);
if (mImports.glProgramUniform3iv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniform3iv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, values] {
called = true;
observer->observeReads();
mImports.glProgramUniform3iv(program, location, count, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniform3iv(observer, call, program, location, count, 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::GlProgramUniform3iv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::GLint__CP >(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::glProgramUniformMatrix3fv(CallObserver* observer, ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glProgramUniformMatrix3fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values);
if (mImports.glProgramUniformMatrix3fv == nullptr) {
GAPID_WARNING("Application called unsupported function glProgramUniformMatrix3fv");
return;
}
bool called = false;
auto call = [this, observer, &called, program, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glProgramUniformMatrix3fv(program, location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
subProgramUniformMatrix3fv(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::GlProgramUniformMatrix3fv 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::glUniform1i(CallObserver* observer, UniformLocation location, GLint value) {
GAPID_DEBUG("glUniform1i(%" PRId32 ", %" PRId32 ")", location, value);
if (mImports.glUniform1i == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform1i");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value] {
called = true;
observer->observeReads();
mImports.glUniform1i(location, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<GLint> l_v = make<GLint>(1ULL);
observer->write<GLint>(l_v, 0ULL, value);
subUniformv_GLint__S(observer, call, location, l_v, GLenum::GL_INT);
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::GlUniform1i coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), 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::glUniform4f(CallObserver* observer, UniformLocation location, GLfloat value0, GLfloat value1, GLfloat value2, GLfloat value3) {
GAPID_DEBUG("glUniform4f(%" PRId32 ", %f, %f, %f, %f)", location, value0, value1, value2, value3);
if (mImports.glUniform4f == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform4f");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value0, value1, value2, value3] {
called = true;
observer->observeReads();
mImports.glUniform4f(location, value0, value1, value2, value3);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
Slice<Vec4f> l_v = make<Vec4f>(1ULL);
observer->write<Vec4f>(l_v, 0ULL, {value0, value1, value2, value3});
subUniformv_Vec4f__S(observer, call, location, l_v, GLenum::GL_FLOAT_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::GlUniform4f coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< float >(value0, *observer->getScratch()), toEncoder< float >(value1, *observer->getScratch()), toEncoder< float >(value2, *observer->getScratch()), toEncoder< float >(value3, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniform4ui(CallObserver* observer, UniformLocation location, GLuint value0, GLuint value1, GLuint value2, GLuint value3) {
GAPID_DEBUG("glUniform4ui(%" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", location, value0, value1, value2, value3);
if (mImports.glUniform4ui == nullptr) {
GAPID_WARNING("Application called unsupported function glUniform4ui");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value0, value1, value2, value3] {
called = true;
observer->observeReads();
mImports.glUniform4ui(location, value0, value1, value2, value3);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Slice<Vec4u> l_v = make<Vec4u>(1ULL);
observer->write<Vec4u>(l_v, 0ULL, {value0, value1, value2, value3});
subUniformv_Vec4u__S(observer, call, location, l_v, GLenum::GL_UNSIGNED_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::GlUniform4ui coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< uint32_t >(value0, *observer->getScratch()), toEncoder< uint32_t >(value1, *observer->getScratch()), toEncoder< uint32_t >(value2, *observer->getScratch()), toEncoder< uint32_t >(value3, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniformBlockBinding(CallObserver* observer, ProgramId program, UniformBlockId uniform_block_index, GLuint uniform_block_binding) {
GAPID_DEBUG("glUniformBlockBinding(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, uniform_block_index, uniform_block_binding);
if (mImports.glUniformBlockBinding == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformBlockBinding");
return;
}
bool called = false;
auto call = [this, observer, &called, program, uniform_block_index, uniform_block_binding] {
called = true;
observer->observeReads();
mImports.glUniformBlockBinding(program, uniform_block_index, uniform_block_binding);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (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::GlUniformBlockBinding coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()), toEncoder< uint32_t >(uniform_block_index, *observer->getScratch()), toEncoder< uint32_t >(uniform_block_binding, *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::glUniformMatrix3x4fv(CallObserver* observer, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glUniformMatrix3x4fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values);
if (mImports.glUniformMatrix3x4fv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformMatrix3x4fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glUniformMatrix3x4fv(location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subUniformMatrix3x4fv(observer, call, 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::GlUniformMatrix3x4fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glUniformMatrix4x3fv(CallObserver* observer, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) {
GAPID_DEBUG("glUniformMatrix4x3fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values);
if (mImports.glUniformMatrix4x3fv == nullptr) {
GAPID_WARNING("Application called unsupported function glUniformMatrix4x3fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, count, transpose, values] {
called = true;
observer->observeReads();
mImports.glUniformMatrix4x3fv(location, count, transpose, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subUniformMatrix4x3fv(observer, call, 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::GlUniformMatrix4x3fv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< uint8_t >(transpose, *observer->getScratch()), toEncoder< gapic::coder::gles::GLfloat__CP >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glValidateProgram(CallObserver* observer, ProgramId program) {
GAPID_DEBUG("glValidateProgram(%" PRIu32 ")", program);
if (mImports.glValidateProgram == nullptr) {
GAPID_WARNING("Application called unsupported function glValidateProgram");
return;
}
bool called = false;
auto call = [this, observer, &called, program] {
called = true;
observer->observeReads();
mImports.glValidateProgram(program);
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();
} 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::GlValidateProgram coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glFrontFace(CallObserver* observer, uint32_t orientation) {
GAPID_DEBUG("glFrontFace(%u)", orientation);
if (mImports.glFrontFace == nullptr) {
GAPID_WARNING("Application called unsupported function glFrontFace");
return;
}
bool called = false;
auto call = [this, observer, &called, orientation] {
called = true;
observer->observeReads();
mImports.glFrontFace(orientation);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
switch (orientation) {
case GLenum::GL_CCW: // fall-through...
case GLenum::GL_CW: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, orientation);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mRasterization.mFrontFace = orientation;
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::GlFrontFace coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), orientation);
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::glLineWidth(CallObserver* observer, GLfloat width) {
GAPID_DEBUG("glLineWidth(%f)", width);
if (mImports.glLineWidth == nullptr) {
GAPID_WARNING("Application called unsupported function glLineWidth");
return;
}
bool called = false;
auto call = [this, observer, &called, width] {
called = true;
observer->observeReads();
mImports.glLineWidth(width);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
if ((width) <= ((GLfloat)(0.f))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
checkNotNull(l_ctx).mRasterization.mLineWidth = width;
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::GlLineWidth coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(width, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetBooleani_v(CallObserver* observer, uint32_t param, GLuint index, GLboolean* values) {
GAPID_DEBUG("glGetBooleani_v(%u, %" PRIu32 ", %p)", param, index, values);
if (mImports.glGetBooleani_v == nullptr) {
GAPID_WARNING("Application called unsupported function glGetBooleani_v");
return;
}
bool called = false;
auto call = [this, observer, &called, param, index, values] {
called = true;
observer->observeReads();
mImports.glGetBooleani_v(param, index, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
call();
subGetStateVariable_GLboolean(observer, call, param, true, index, values);
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetBooleani_v coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< gapic::coder::gles::GLboolean__P >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetInteger64v(CallObserver* observer, uint32_t param, GLint64* values) {
GAPID_DEBUG("glGetInteger64v(%u, %p)", param, values);
if (mImports.glGetInteger64v == nullptr) {
GAPID_WARNING("Application called unsupported function glGetInteger64v");
return;
}
bool called = false;
auto call = [this, observer, &called, param, values] {
called = true;
observer->observeReads();
mImports.glGetInteger64v(param, values);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
subGetInteger64v(observer, call, param, 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::GlGetInteger64v coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< gapic::coder::gles::GLint64__P >(values, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
GLsync GlesSpy::glFenceSync(CallObserver* observer, uint32_t condition, uint32_t syncFlags) {
GAPID_DEBUG("glFenceSync(%u, %u)", condition, syncFlags);
if (mImports.glFenceSync == nullptr) {
GAPID_WARNING("Application called unsupported function glFenceSync");
return nullptr;
}
GLsync result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, condition, syncFlags] {
called = true;
observer->observeReads();
result = mImports.glFenceSync(condition, syncFlags);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
call();
GLsync l_sync = (GLsync)(result);
subFenceSync(observer, call, condition, syncFlags, l_sync);
if (UNLIKELY(shouldComputeExpectedReturn())) {
setExpectedReturn<GLsync>(l_sync);
}
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFenceSync coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), condition, syncFlags, toEncoder< gapic::coder::gles::GLsync >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glWaitSync(CallObserver* observer, GLsync sync, uint32_t syncFlags, GLuint64 timeout) {
GAPID_DEBUG("glWaitSync(%p, %u, %" PRIu64 ")", sync, syncFlags, timeout);
if (mImports.glWaitSync == nullptr) {
GAPID_WARNING("Application called unsupported function glWaitSync");
return;
}
bool called = false;
auto call = [this, observer, &called, sync, syncFlags, timeout] {
called = true;
observer->observeReads();
mImports.glWaitSync(sync, syncFlags, timeout);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
subWaitSync(observer, call, sync, syncFlags, timeout);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlWaitSync coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLsync >(sync, *observer->getScratch()), syncFlags, toEncoder< uint64_t >(timeout, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glBindTexture(CallObserver* observer, uint32_t target, TextureId texture) {
GAPID_DEBUG("glBindTexture(%u, %" PRIu32 ")", target, texture);
if (mImports.glBindTexture == nullptr) {
GAPID_WARNING("Application called unsupported function glBindTexture");
return;
}
bool called = false;
auto call = [this, observer, &called, target, texture] {
called = true;
observer->observeReads();
mImports.glBindTexture(target, 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);
if ((texture) != ((TextureId)(0UL))) {
if (!(checkNotNull(l_ctx).mInstances.mTextures.count(texture) > 0)) {
if ((target) == (GLenum::GL_TEXTURE_EXTERNAL_OES)) {
checkNotNull(l_ctx).mInstances.mTextures[texture] = std::shared_ptr<Texture>(new Texture(texture, 0, 0, 0, GLintToImage(), GLintToCubemapLevel(), GLenum::GL_RED, GLenum::GL_GREEN, GLenum::GL_BLUE, GLenum::GL_ALPHA, std::move(Vec4f{(GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f)}), GLenum::GL_LINEAR, GLenum::GL_LINEAR, GLenum::GL_CLAMP_TO_EDGE, GLenum::GL_CLAMP_TO_EDGE, GLenum::GL_REPEAT, (GLfloat)(-1000.f), (GLfloat)(1000.f), (GLint)(0L), (GLint)(1000L), GLenum::GL_DEPTH_COMPONENT, GLenum::GL_NONE, GLenum::GL_LEQUAL, GLbooleanLabels::GL_FALSE, (GLuint)(0UL), "", (GLfloat)(1.f)));
} else {
checkNotNull(l_ctx).mInstances.mTextures[texture] = std::shared_ptr<Texture>(new Texture(texture, 0, 0, 0, GLintToImage(), GLintToCubemapLevel(), GLenum::GL_RED, GLenum::GL_GREEN, GLenum::GL_BLUE, GLenum::GL_ALPHA, std::move(Vec4f{(GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f)}), GLenum::GL_NEAREST_MIPMAP_LINEAR, GLenum::GL_LINEAR, GLenum::GL_REPEAT, GLenum::GL_REPEAT, GLenum::GL_REPEAT, (GLfloat)(-1000.f), (GLfloat)(1000.f), (GLint)(0L), (GLint)(1000L), GLenum::GL_DEPTH_COMPONENT, GLenum::GL_NONE, GLenum::GL_LEQUAL, GLbooleanLabels::GL_FALSE, (GLuint)(0UL), "", (GLfloat)(1.f)));
}
}
std::shared_ptr<Texture> l_t = findOrZero(checkNotNull(l_ctx).mInstances.mTextures, texture);
if ((checkNotNull(l_t).mKind) == ((uint32_t)(0L))) {
checkNotNull(l_t).mKind = target;
} else {
if ((checkNotNull(l_t).mKind) != (target)) {
subGlErrorInvalidOperation(observer, call);
}
}
}
std::shared_ptr<TextureUnit> l_tu = findOrZero(checkNotNull(l_ctx).mTextureUnits, checkNotNull(l_ctx).mActiveTextureUnit);
switch (target) {
case GLenum::GL_TEXTURE_2D: {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
checkNotNull(l_tu).mBinding2d = texture;
break;
}
case GLenum::GL_TEXTURE_EXTERNAL_OES: {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
checkNotNull(l_tu).mBindingExternalOes = texture;
break;
}
case GLenum::GL_TEXTURE_2D_ARRAY: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
checkNotNull(l_tu).mBinding2dArray = texture;
break;
}
case GLenum::GL_TEXTURE_2D_MULTISAMPLE: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
checkNotNull(l_tu).mBinding2dMultisample = texture;
break;
}
case GLenum::GL_TEXTURE_2D_MULTISAMPLE_ARRAY: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
checkNotNull(l_tu).mBinding2dMultisampleArray = texture;
break;
}
case GLenum::GL_TEXTURE_3D: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
checkNotNull(l_tu).mBinding3d = texture;
break;
}
case GLenum::GL_TEXTURE_BUFFER: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
checkNotNull(l_tu).mBindingBuffer = texture;
break;
}
case GLenum::GL_TEXTURE_CUBE_MAP: {
subMinRequiredVersion(observer, call, (GLint)(2L), (GLint)(0L));
checkNotNull(l_tu).mBindingCubeMap = texture;
break;
}
case GLenum::GL_TEXTURE_CUBE_MAP_ARRAY: {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
checkNotNull(l_tu).mBindingCubeMapArray = texture;
break;
}
default: {
subGlErrorInvalidEnum(observer, call, 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::GlBindTexture coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(texture, *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::glCompressedTexSubImage3D(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("glCompressedTexSubImage3D(%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.glCompressedTexSubImage3D == nullptr) {
GAPID_WARNING("Application called unsupported function glCompressedTexSubImage3D");
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.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
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::GlCompressedTexSubImage3D 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::glCopyTexSubImage3D(CallObserver* observer, uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
GAPID_DEBUG("glCopyTexSubImage3D(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", target, level, xoffset, yoffset, zoffset, x, y, width, height);
if (mImports.glCopyTexSubImage3D == nullptr) {
GAPID_WARNING("Application called unsupported function glCopyTexSubImage3D");
return;
}
bool called = false;
auto call = [this, observer, &called, target, level, xoffset, yoffset, zoffset, x, y, width, height] {
called = true;
observer->observeReads();
mImports.glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
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::GlCopyTexSubImage3D 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::glDeleteSamplers(CallObserver* observer, GLsizei count, SamplerId* samplers) {
GAPID_DEBUG("glDeleteSamplers(%" PRId32 ", %p)", count, samplers);
if (mImports.glDeleteSamplers == nullptr) {
GAPID_WARNING("Application called unsupported function glDeleteSamplers");
return;
}
bool called = false;
auto call = [this, observer, &called, count, samplers] {
called = true;
observer->observeReads();
mImports.glDeleteSamplers(count, samplers);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
Slice<SamplerId> l_s = slice(samplers, (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) {
SamplerId l_id = observer->read(l_s, (uint64_t)(l_i));
if ((l_id) != ((SamplerId)(0UL))) {
checkNotNull(l_ctx).mInstances.mSamplers.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::GlDeleteSamplers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, *observer->getScratch()), toEncoder< gapic::coder::gles::SamplerId__CP >(samplers, *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::glSamplerParameterIuiv(CallObserver* observer, SamplerId sampler, uint32_t pname, GLuint* param) {
GAPID_DEBUG("glSamplerParameterIuiv(%" PRIu32 ", %u, %p)", sampler, pname, param);
if (mImports.glSamplerParameterIuiv == nullptr) {
GAPID_WARNING("Application called unsupported function glSamplerParameterIuiv");
return;
}
bool called = false;
auto call = [this, observer, &called, sampler, pname, param] {
called = true;
observer->observeReads();
mImports.glSamplerParameterIuiv(sampler, pname, param);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(2L));
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::GlSamplerParameterIuiv 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::glTexParameterf(CallObserver* observer, uint32_t target, uint32_t parameter, GLfloat value) {
GAPID_DEBUG("glTexParameterf(%u, %u, %f)", target, parameter, value);
if (mImports.glTexParameterf == nullptr) {
GAPID_WARNING("Application called unsupported function glTexParameterf");
return;
}
bool called = false;
auto call = [this, observer, &called, target, parameter, value] {
called = true;
observer->observeReads();
mImports.glTexParameterf(target, parameter, value);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
if ((parameter) == (GLenum::GL_TEXTURE_BORDER_COLOR)) {
subGlErrorInvalidEnum(observer, call, parameter);
}
Vec1f l_params = {value};
subTexParameterv_Vec1f(observer, call, target, parameter, 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::GlTexParameterf coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, parameter, toEncoder< float >(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::glBindTransformFeedback(CallObserver* observer, uint32_t target, TransformFeedbackId id) {
GAPID_DEBUG("glBindTransformFeedback(%u, %" PRIu32 ")", target, id);
if (mImports.glBindTransformFeedback == nullptr) {
GAPID_WARNING("Application called unsupported function glBindTransformFeedback");
return;
}
bool called = false;
auto call = [this, observer, &called, target, id] {
called = true;
observer->observeReads();
mImports.glBindTransformFeedback(target, id);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(0L));
switch (target) {
case GLenum::GL_TRANSFORM_FEEDBACK: {
break;
}
default: {
subGlErrorInvalidEnum(observer, call, target);
}
}
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
if (!(checkNotNull(l_ctx).mInstances.mTransformFeedbacks.count(id) > 0)) {
checkNotNull(l_ctx).mInstances.mTransformFeedbacks[id] = std::shared_ptr<TransformFeedback>(new TransformFeedback(GLuintToBufferBinding(), GLbooleanLabels::GL_FALSE, GLbooleanLabels::GL_FALSE, ""));
}
checkNotNull(l_ctx).mBoundTransformFeedback = 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::GlBindTransformFeedback coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(id, *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::glGenTransformFeedbacks(CallObserver* observer, GLsizei n, TransformFeedbackId* ids) {
GAPID_DEBUG("glGenTransformFeedbacks(%" PRId32 ", %p)", n, ids);
if (mImports.glGenTransformFeedbacks == nullptr) {
GAPID_WARNING("Application called unsupported function glGenTransformFeedbacks");
return;
}
bool called = false;
auto call = [this, observer, &called, n, ids] {
called = true;
observer->observeReads();
mImports.glGenTransformFeedbacks(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);
call();
for (GLsizei l_i = (GLsizei)(0L); l_i < n; ++l_i) {
TransformFeedbackId l_id = (TransformFeedbackId)(slice(ids, (uint64_t)((GLsizei)(0L)), (uint64_t)(n))[(uint64_t)(l_i)]);
checkNotNull(l_ctx).mInstances.mTransformFeedbacks[l_id] = std::shared_ptr<TransformFeedback>(new TransformFeedback(GLuintToBufferBinding(), GLbooleanLabels::GL_FALSE, GLbooleanLabels::GL_FALSE, ""));
observer->write<TransformFeedbackId>(l_tfs, (uint64_t)(l_i), l_id);
}
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGenTransformFeedbacks coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, *observer->getScratch()), toEncoder< gapic::coder::gles::TransformFeedbackId__P >(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);
}
void GlesSpy::glEnableVertexAttribArray(CallObserver* observer, AttributeLocation location) {
GAPID_DEBUG("glEnableVertexAttribArray(%" PRIu32 ")", location);
if (mImports.glEnableVertexAttribArray == nullptr) {
GAPID_WARNING("Application called unsupported function glEnableVertexAttribArray");
return;
}
bool called = false;
auto call = [this, observer, &called, location] {
called = true;
observer->observeReads();
mImports.glEnableVertexAttribArray(location);
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 ((location) >= ((AttributeLocation)(checkNotNull(l_ctx).mConstants.mMaxVertexAttribs))) {
subGlErrorInvalidValue(observer, call);
}
std::shared_ptr<VertexArray> l_vao = findOrZero(checkNotNull(l_ctx).mInstances.mVertexArrays, checkNotNull(l_ctx).mBoundVertexArray);
checkNotNull(findOrZero(checkNotNull(l_vao).mVertexAttributeArrays, location)).mEnabled = GLbooleanLabels::GL_TRUE;
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::GlEnableVertexAttribArray coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, *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::glGetVertexAttribIiv(CallObserver* observer, AttributeLocation index, uint32_t pname, GLint* params) {
GAPID_DEBUG("glGetVertexAttribIiv(%" PRIu32 ", %u, %p)", index, pname, params);
if (mImports.glGetVertexAttribIiv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetVertexAttribIiv");
return;
}
bool called = false;
auto call = [this, observer, &called, index, pname, params] {
called = true;
observer->observeReads();
mImports.glGetVertexAttribIiv(index, pname, params);
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);
if ((index) >= ((AttributeLocation)(checkNotNull(l_ctx).mConstants.mMaxVertexAttribs))) {
subGlErrorInvalidValue(observer, call);
}
call();
if ((pname) == (GLenum::GL_CURRENT_VERTEX_ATTRIB)) {
observer->write(slice(params, 0ULL, 4ULL));
} else {
uint64_t l__res_0 = subGetVertexAttrib(observer, call, l_ctx, index, pname);
observer->write<GLint>(slice(params, 0ULL, 1ULL), 0ULL, (GLint)(l__res_0));
}
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlGetVertexAttribIiv coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), pname, toEncoder< gapic::coder::gles::GLint__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glVertexAttrib4fv(CallObserver* observer, AttributeLocation location, GLfloat* value) {
GAPID_DEBUG("glVertexAttrib4fv(%" PRIu32 ", %p)", location, value);
if (mImports.glVertexAttrib4fv == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttrib4fv");
return;
}
bool called = false;
auto call = [this, observer, &called, location, value] {
called = true;
observer->observeReads();
mImports.glVertexAttrib4fv(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, 4ULL);
Vec4f l_vec = {observer->read(l_v, 0ULL), observer->read(l_v, 1ULL), observer->read(l_v, 2ULL), observer->read(l_v, 3ULL)};
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::GlVertexAttrib4fv 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::glVertexAttribIFormat(CallObserver* observer, AttributeLocation index, GLint size, uint32_t type, GLuint relativeoffset) {
GAPID_DEBUG("glVertexAttribIFormat(%" PRIu32 ", %" PRId32 ", %u, %" PRIu32 ")", index, size, type, relativeoffset);
if (mImports.glVertexAttribIFormat == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttribIFormat");
return;
}
bool called = false;
auto call = [this, observer, &called, index, size, type, relativeoffset] {
called = true;
observer->observeReads();
mImports.glVertexAttribIFormat(index, size, type, relativeoffset);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(3L), (GLint)(1L));
std::shared_ptr<Context> l_ctx = subGetContext(observer, call);
if ((checkNotNull(l_ctx).mBoundVertexArray) == ((VertexArrayId)(0UL))) {
subGlErrorInvalidOperation(observer, call);
}
subVertexAttribFormat(observer, call, l_ctx, index, size, type, (GLboolean)(0U), relativeoffset, true);
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::GlVertexAttribIFormat coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, *observer->getScratch()), toEncoder< int32_t >(size, *observer->getScratch()), type, toEncoder< uint32_t >(relativeoffset, *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::glVertexAttribIPointer(CallObserver* observer, AttributeLocation location, GLint size, uint32_t type, GLsizei stride, VertexPointer data) {
GAPID_DEBUG("glVertexAttribIPointer(%" PRIu32 ", %" PRId32 ", %u, %" PRId32 ", %p)", location, size, type, stride, data);
if (mImports.glVertexAttribIPointer == nullptr) {
GAPID_WARNING("Application called unsupported function glVertexAttribIPointer");
return;
}
bool called = false;
auto call = [this, observer, &called, location, size, type, stride, data] {
called = true;
observer->observeReads();
mImports.glVertexAttribIPointer(location, size, type, stride, data);
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);
subVertexAttribPointer(observer, call, l_ctx, location, size, type, (GLboolean)(0U), stride, data, true);
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::GlVertexAttribIPointer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, *observer->getScratch()), toEncoder< int32_t >(size, *observer->getScratch()), type, 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);
}
void GlesSpy::glXSwapBuffers(CallObserver* observer, void* display, GLXDrawable drawable) {
GAPID_DEBUG("glXSwapBuffers(%p, %p)", display, drawable);
if (mImports.glXSwapBuffers == nullptr) {
GAPID_WARNING("Application called unsupported function glXSwapBuffers");
return;
}
bool called = false;
auto call = [this, observer, &called, display, drawable] {
called = true;
observer->observeReads();
mImports.glXSwapBuffers(display, drawable);
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::GlXSwapBuffers coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__P >(display, *observer->getScratch()), toEncoder< gapic::coder::gles::GLXDrawable >(drawable, *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);
}
HGLRC GlesSpy::wglCreateContext(CallObserver* observer, HDC hdc) {
GAPID_DEBUG("wglCreateContext(%p)", hdc);
if (mImports.wglCreateContext == nullptr) {
GAPID_WARNING("Application called unsupported function wglCreateContext");
return nullptr;
}
HGLRC result = nullptr;
bool called = false;
auto call = [this, observer, &called, &result, hdc] {
called = true;
observer->observeReads();
result = mImports.wglCreateContext(hdc);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
auto l_context = result;
std::shared_ptr<Context> l__res_0 = subCreateContext(observer, call);
this->WGLContexts[l_context] = l__res_0;
break;
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::WglCreateContext coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::HDC >(hdc, *observer->getScratch()), toEncoder< gapic::coder::gles::HGLRC >(result, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
return result;
}
void GlesSpy::glAlphaFuncx(CallObserver* observer, uint32_t func, GLfixed ref) {
GAPID_DEBUG("glAlphaFuncx(%u, %" PRId32 ")", func, ref);
if (mImports.glAlphaFuncx == nullptr) {
GAPID_WARNING("Application called unsupported function glAlphaFuncx");
return;
}
bool called = false;
auto call = [this, observer, &called, func, ref] {
called = true;
observer->observeReads();
mImports.glAlphaFuncx(func, ref);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlAlphaFuncx 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);
}
uint32_t GlesSpy::glCheckFramebufferStatusOES(CallObserver* observer, uint32_t target) {
GAPID_DEBUG("glCheckFramebufferStatusOES(%u)", target);
if (mImports.glCheckFramebufferStatusOES == nullptr) {
GAPID_WARNING("Application called unsupported function glCheckFramebufferStatusOES");
return 0;
}
uint32_t result = 0;
bool called = false;
auto call = [this, observer, &called, &result, target] {
called = true;
observer->observeReads();
result = mImports.glCheckFramebufferStatusOES(target);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_framebuffer_object);
subErrorGLES10notSupported(observer, call);
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::GlCheckFramebufferStatusOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, 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::glClearDepthx(CallObserver* observer, GLfixed depth) {
GAPID_DEBUG("glClearDepthx(%" PRId32 ")", depth);
if (mImports.glClearDepthx == nullptr) {
GAPID_WARNING("Application called unsupported function glClearDepthx");
return;
}
bool called = false;
auto call = [this, observer, &called, depth] {
called = true;
observer->observeReads();
mImports.glClearDepthx(depth);
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::GlClearDepthx 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::glDepthRangex(CallObserver* observer, GLfixed n, GLfixed f) {
GAPID_DEBUG("glDepthRangex(%" PRId32 ", %" PRId32 ")", n, f);
if (mImports.glDepthRangex == nullptr) {
GAPID_WARNING("Application called unsupported function glDepthRangex");
return;
}
bool called = false;
auto call = [this, observer, &called, n, f] {
called = true;
observer->observeReads();
mImports.glDepthRangex(n, f);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlDepthRangex 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::glDrawTexxOES(CallObserver* observer, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
GAPID_DEBUG("glDrawTexxOES(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, z, width, height);
if (mImports.glDrawTexxOES == nullptr) {
GAPID_WARNING("Application called unsupported function glDrawTexxOES");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, z, width, height] {
called = true;
observer->observeReads();
mImports.glDrawTexxOES(x, y, z, width, height);
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::GlDrawTexxOES 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()), 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);
onPostDrawCall();
}
void GlesSpy::glFramebufferRenderbufferOES(CallObserver* observer, uint32_t target, uint32_t attachment, uint32_t renderbuffertarget, GLuint renderbuffer) {
GAPID_DEBUG("glFramebufferRenderbufferOES(%u, %u, %u, %" PRIu32 ")", target, attachment, renderbuffertarget, renderbuffer);
if (mImports.glFramebufferRenderbufferOES == nullptr) {
GAPID_WARNING("Application called unsupported function glFramebufferRenderbufferOES");
return;
}
bool called = false;
auto call = [this, observer, &called, target, attachment, renderbuffertarget, renderbuffer] {
called = true;
observer->observeReads();
mImports.glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subRequiresExtension(observer, call, ExtensionId::GL_OES_framebuffer_object);
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlFramebufferRenderbufferOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), target, attachment, renderbuffertarget, toEncoder< uint32_t >(renderbuffer, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glGetClipPlanef(CallObserver* observer, uint32_t plane, GLfloat* equation) {
GAPID_DEBUG("glGetClipPlanef(%u, %p)", plane, equation);
if (mImports.glGetClipPlanef == nullptr) {
GAPID_WARNING("Application called unsupported function glGetClipPlanef");
return;
}
bool called = false;
auto call = [this, observer, &called, plane, equation] {
called = true;
observer->observeReads();
mImports.glGetClipPlanef(plane, equation);
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::GlGetClipPlanef 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::glGetTexEnvxv(CallObserver* observer, uint32_t target, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glGetTexEnvxv(%u, %u, %p)", target, pname, params);
if (mImports.glGetTexEnvxv == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexEnvxv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexEnvxv(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::GlGetTexEnvxv 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::glGetTexGenfvOES(CallObserver* observer, uint32_t coord, uint32_t pname, GLfloat* params) {
GAPID_DEBUG("glGetTexGenfvOES(%u, %u, %p)", coord, pname, params);
if (mImports.glGetTexGenfvOES == nullptr) {
GAPID_WARNING("Application called unsupported function glGetTexGenfvOES");
return;
}
bool called = false;
auto call = [this, observer, &called, coord, pname, params] {
called = true;
observer->observeReads();
mImports.glGetTexGenfvOES(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::GlGetTexGenfvOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), coord, pname, toEncoder< gapic::coder::gles::GLfloat__P >(params, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glLightf(CallObserver* observer, uint32_t light, uint32_t pname, GLfloat param) {
GAPID_DEBUG("glLightf(%u, %u, %f)", light, pname, param);
if (mImports.glLightf == nullptr) {
GAPID_WARNING("Application called unsupported function glLightf");
return;
}
bool called = false;
auto call = [this, observer, &called, light, pname, param] {
called = true;
observer->observeReads();
mImports.glLightf(light, 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::GlLightf coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), light, 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::glLightxv(CallObserver* observer, uint32_t light, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glLightxv(%u, %u, %p)", light, pname, params);
if (mImports.glLightxv == nullptr) {
GAPID_WARNING("Application called unsupported function glLightxv");
return;
}
bool called = false;
auto call = [this, observer, &called, light, pname, params] {
called = true;
observer->observeReads();
mImports.glLightxv(light, pname, params);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlLightxv 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::glLoadIdentity(CallObserver* observer) {
GAPID_DEBUG("glLoadIdentity()");
if (mImports.glLoadIdentity == nullptr) {
GAPID_WARNING("Application called unsupported function glLoadIdentity");
return;
}
bool called = false;
auto call = [this, observer, &called] {
called = true;
observer->observeReads();
mImports.glLoadIdentity();
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::GlLoadIdentity coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glMatrixMode(CallObserver* observer, uint32_t mode) {
GAPID_DEBUG("glMatrixMode(%u)", mode);
if (mImports.glMatrixMode == nullptr) {
GAPID_WARNING("Application called unsupported function glMatrixMode");
return;
}
bool called = false;
auto call = [this, observer, &called, mode] {
called = true;
observer->observeReads();
mImports.glMatrixMode(mode);
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::GlMatrixMode coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glOrthox(CallObserver* observer, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) {
GAPID_DEBUG("glOrthox(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", l, r, b, t, n, f);
if (mImports.glOrthox == nullptr) {
GAPID_WARNING("Application called unsupported function glOrthox");
return;
}
bool called = false;
auto call = [this, observer, &called, l, r, b, t, n, f] {
called = true;
observer->observeReads();
mImports.glOrthox(l, r, b, t, n, f);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlOrthox 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::glPointSizexOES(CallObserver* observer, GLfixed size) {
GAPID_DEBUG("glPointSizexOES(%" PRId32 ")", size);
if (mImports.glPointSizexOES == nullptr) {
GAPID_WARNING("Application called unsupported function glPointSizexOES");
return;
}
bool called = false;
auto call = [this, observer, &called, size] {
called = true;
observer->observeReads();
mImports.glPointSizexOES(size);
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::GlPointSizexOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(size, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glRotatexOES(CallObserver* observer, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
GAPID_DEBUG("glRotatexOES(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", angle, x, y, z);
if (mImports.glRotatexOES == nullptr) {
GAPID_WARNING("Application called unsupported function glRotatexOES");
return;
}
bool called = false;
auto call = [this, observer, &called, angle, x, y, z] {
called = true;
observer->observeReads();
mImports.glRotatexOES(angle, 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::GlRotatexOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(angle, *observer->getScratch()), 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::glScalex(CallObserver* observer, GLfixed x, GLfixed y, GLfixed z) {
GAPID_DEBUG("glScalex(%" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, z);
if (mImports.glScalex == nullptr) {
GAPID_WARNING("Application called unsupported function glScalex");
return;
}
bool called = false;
auto call = [this, observer, &called, x, y, z] {
called = true;
observer->observeReads();
mImports.glScalex(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::GlScalex 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::glShadeModel(CallObserver* observer, uint32_t mode) {
GAPID_DEBUG("glShadeModel(%u)", mode);
if (mImports.glShadeModel == nullptr) {
GAPID_WARNING("Application called unsupported function glShadeModel");
return;
}
bool called = false;
auto call = [this, observer, &called, mode] {
called = true;
observer->observeReads();
mImports.glShadeModel(mode);
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::GlShadeModel coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), mode);
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::glTexGenfOES(CallObserver* observer, uint32_t coord, uint32_t pname, GLfloat param) {
GAPID_DEBUG("glTexGenfOES(%u, %u, %f)", coord, pname, param);
if (mImports.glTexGenfOES == nullptr) {
GAPID_WARNING("Application called unsupported function glTexGenfOES");
return;
}
bool called = false;
auto call = [this, observer, &called, coord, pname, param] {
called = true;
observer->observeReads();
mImports.glTexGenfOES(coord, pname, param);
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::GlTexGenfOES coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), coord, 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::glTexParameterxv(CallObserver* observer, uint32_t target, uint32_t pname, GLfixed* params) {
GAPID_DEBUG("glTexParameterxv(%u, %u, %p)", target, pname, params);
if (mImports.glTexParameterxv == nullptr) {
GAPID_WARNING("Application called unsupported function glTexParameterxv");
return;
}
bool called = false;
auto call = [this, observer, &called, target, pname, params] {
called = true;
observer->observeReads();
mImports.glTexParameterxv(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::GlTexParameterxv 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::glTexCoordPointerBounds(CallObserver* observer, GLint size, uint32_t type, GLsizei stride, void* pointer, GLsizei count) {
GAPID_DEBUG("glTexCoordPointerBounds(%" PRId32 ", %u, %" PRId32 ", %p, %" PRId32 ")", size, type, stride, pointer, count);
if (mImports.glTexCoordPointerBounds == nullptr) {
GAPID_WARNING("Application called unsupported function glTexCoordPointerBounds");
return;
}
bool called = false;
auto call = [this, observer, &called, size, type, stride, pointer, count] {
called = true;
observer->observeReads();
mImports.glTexCoordPointerBounds(size, type, stride, pointer, count);
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
subMinRequiredVersion(observer, call, (GLint)(1L), (GLint)(0L));
subErrorGLES10notSupported(observer, call);
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::GlTexCoordPointerBounds coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(size, *observer->getScratch()), type, toEncoder< int32_t >(stride, *observer->getScratch()), toEncoder< gapic::coder::gles::Void__CP >(pointer, *observer->getScratch()), toEncoder< int32_t >(count, *observer->getScratch()));
coder.mextras.append(observer->getExtras());
if (counter_at_end > counter_at_begin + 1 ||
counter_at_begin != mExpectedNextCommandStartCounterValue) {
coder.mextras.append(&counter_value_encodable);
}
mExpectedNextCommandStartCounterValue = counter_at_end + 1;
mEncoder->Variant(&coder);
}
void GlesSpy::startTimer(CallObserver* observer, uint8_t index) {
GAPID_DEBUG("startTimer(%" PRIu8 ")", index);
bool called = false;
auto call = [this, observer, &called, index] {
called = true;
observer->observeReads();
onPostFence(observer);
};
uint64_t counter_at_begin = mCommandStartEndCounter++;
try {
do {
call();
} while(false);
} catch (gapii::AbortException& e) {
if (!called) {
call(); // abort() was called before the fence.
}
handleAbort(observer, e);
}
uint64_t counter_at_end = mCommandStartEndCounter++;
gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end);
observer->observeWrites();
gapic::coder::gles::StartTimer coder(observer->getScratch()->vector<gapic::Encodable*>(kMaxExtras), index);
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