| /* |
| * 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::glBlendBarrierKHR() { |
| GAPID_DEBUG("glBlendBarrierKHR()"); |
| |
| if (mImports.glBlendBarrierKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendBarrierKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glBlendBarrierKHR(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_blend_equation_advanced); |
| subBlendBarrier(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlendBarrierKHR coder(mScratch.vector<gapic::Encodable*>(kMaxExtras)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glEnableiEXT(uint32_t target, GLuint index) { |
| GAPID_DEBUG("glEnableiEXT(%u, %" PRIu32 ")", target, index); |
| |
| if (mImports.glEnableiEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glEnableiEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, index] { |
| called = true; |
| observeReads(); |
| mImports.glEnableiEXT(target, index); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_draw_buffers_indexed); |
| subEnablei(call, target, index); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlEnableiEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glFramebufferTextureEXT(uint32_t target, uint32_t attachment, TextureId texture, GLint level) { |
| GAPID_DEBUG("glFramebufferTextureEXT(%u, %u, %" PRIu32 ", %" PRId32 ")", target, attachment, texture, level); |
| |
| if (mImports.glFramebufferTextureEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferTextureEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, attachment, texture, level] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferTextureEXT(target, attachment, texture, level); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_geometry_shader); |
| subFramebufferTexture(call, target, attachment, texture, level); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlFramebufferTextureEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, attachment, toEncoder< uint32_t >(texture, mScratch), toEncoder< int32_t >(level, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetSamplerParameterIuivEXT(SamplerId sampler, uint32_t pname, GLuint* params) { |
| GAPID_DEBUG("glGetSamplerParameterIuivEXT(%" PRIu32 ", %u, %p)", sampler, pname, params); |
| |
| if (mImports.glGetSamplerParameterIuivEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetSamplerParameterIuivEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sampler, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetSamplerParameterIuivEXT(sampler, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_texture_border_clamp); |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| call(); |
| subGetSamplerParameterIuiv(call, sampler, pname, params); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetSamplerParameterIuivEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, mScratch), pname, toEncoder< gapic::coder::gles::GLuint__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glMinSampleShadingOES(GLfloat value) { |
| GAPID_DEBUG("glMinSampleShadingOES(%f)", value); |
| |
| if (mImports.glMinSampleShadingOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMinSampleShadingOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, value] { |
| called = true; |
| observeReads(); |
| mImports.glMinSampleShadingOES(value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_sample_shading); |
| subMinSampleShading(call, value); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMinSampleShadingOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPushDebugGroupKHR(uint32_t source, GLuint id, GLsizei length, GLchar* message) { |
| GAPID_DEBUG("glPushDebugGroupKHR(%u, %" PRIu32 ", %" PRId32 ", %p)", source, id, length, message); |
| |
| if (mImports.glPushDebugGroupKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPushDebugGroupKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, source, id, length, message] { |
| called = true; |
| observeReads(); |
| mImports.glPushDebugGroupKHR(source, id, length, message); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_debug); |
| subPushDebugGroup(call, source, id, length, message); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPushDebugGroupKHR coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), source, toEncoder< uint32_t >(id, mScratch), toEncoder< int32_t >(length, mScratch), toEncoder< gapic::coder::gles::GLchar__CP >(message, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glTexStorage3DMultisampleOES(uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) { |
| GAPID_DEBUG("glTexStorage3DMultisampleOES(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ")", target, samples, internalformat, width, height, depth, fixedsamplelocations); |
| |
| if (mImports.glTexStorage3DMultisampleOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexStorage3DMultisampleOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, samples, internalformat, width, height, depth, fixedsamplelocations] { |
| called = true; |
| observeReads(); |
| mImports.glTexStorage3DMultisampleOES(target, samples, internalformat, width, height, depth, fixedsamplelocations); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_storage_multisample_2d_array); |
| subTexStorage3DMultisample(call, target, samples, internalformat, width, height, depth, fixedsamplelocations); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexStorage3DMultisampleOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, mScratch), internalformat, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(depth, mScratch), toEncoder< uint8_t >(fixedsamplelocations, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetQueryObjectuiv(QueryId query, uint32_t parameter, GLuint* value) { |
| GAPID_DEBUG("glGetQueryObjectuiv(%" PRIu32 ", %u, %p)", query, parameter, value); |
| |
| if (mImports.glGetQueryObjectuiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetQueryObjectuiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, query, parameter, value] { |
| called = true; |
| observeReads(); |
| mImports.glGetQueryObjectuiv(query, parameter, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| switch (parameter) { |
| case GLenum::GL_QUERY_RESULT: // fall-through... |
| case GLenum::GL_QUERY_RESULT_AVAILABLE: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, parameter); |
| } |
| } |
| call(); |
| write(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(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetQueryObjectuiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, mScratch), parameter, toEncoder< gapic::coder::gles::GLuint__P >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| GLboolean GlesSpy::glUnmapBuffer(uint32_t target) { |
| GAPID_DEBUG("glUnmapBuffer(%u)", target); |
| |
| if (mImports.glUnmapBuffer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUnmapBuffer"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, target] { |
| called = true; |
| observeReads(); |
| result = mImports.glUnmapBuffer(target); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subUnmapBuffer(call, target); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUnmapBuffer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glDebugMessageCallback(GLDEBUGPROC callback, void* userParam) { |
| GAPID_DEBUG("glDebugMessageCallback(%p, %p)", callback, userParam); |
| |
| if (mImports.glDebugMessageCallback == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDebugMessageCallback"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, callback, userParam] { |
| called = true; |
| observeReads(); |
| mImports.glDebugMessageCallback(callback, userParam); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subDebugMessageCallback(call, callback, userParam); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDebugMessageCallback coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLDEBUGPROC >(callback, mScratch), toEncoder< gapic::coder::gles::Void__CP >(userParam, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetPointerv(uint32_t pname, void** params) { |
| GAPID_DEBUG("glGetPointerv(%u, %p)", pname, params); |
| |
| if (mImports.glGetPointerv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPointerv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetPointerv(pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| call(); |
| subGetPointerv(call, pname, params); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetPointerv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< gapic::coder::gles::Void__P__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPopDebugGroup() { |
| GAPID_DEBUG("glPopDebugGroup()"); |
| |
| if (mImports.glPopDebugGroup == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPopDebugGroup"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glPopDebugGroup(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subPopDebugGroup(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPopDebugGroup coder(mScratch.vector<gapic::Encodable*>(kMaxExtras)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glDrawElementsIndirect(uint32_t draw_mode, uint32_t indices_type, void* indirect) { |
| GAPID_DEBUG("glDrawElementsIndirect(%u, %u, %p)", draw_mode, indices_type, indirect); |
| |
| if (mImports.glDrawElementsIndirect == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawElementsIndirect"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, draw_mode, indices_type, indirect] { |
| called = true; |
| observeReads(); |
| mImports.glDrawElementsIndirect(draw_mode, indices_type, indirect); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subCheckPrimitiveType(call, draw_mode); |
| subCheckIndicesType(call, indices_type); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidOperationIf(call, (checkNotNull(l_ctx).mBoundVertexArray) == ((VertexArrayId)(0UL))); |
| subGlErrorInvalidOperationIf(call, (findOrZero(checkNotNull(l_ctx).mBoundBuffers, GLenum::GL_DRAW_INDIRECT_BUFFER)) == ((BufferId)(0UL))); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDrawElementsIndirect coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), draw_mode, indices_type, toEncoder< gapic::coder::gles::Void__CP >(indirect, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| onPostDrawCall(); |
| |
| } |
| |
| void GlesSpy::glBlendEquationiOES(DrawBufferIndex buf, uint32_t mode) { |
| GAPID_DEBUG("glBlendEquationiOES(%" PRIu32 ", %u)", buf, mode); |
| |
| if (mImports.glBlendEquationiOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendEquationiOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, buf, mode] { |
| called = true; |
| observeReads(); |
| mImports.glBlendEquationiOES(buf, mode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_draw_buffers_indexed); |
| subBlendEquationi(call, buf, mode); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlendEquationiOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buf, mScratch), mode); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glBlendFunciOES(DrawBufferIndex buf, uint32_t src, uint32_t dst) { |
| GAPID_DEBUG("glBlendFunciOES(%" PRIu32 ", %u, %u)", buf, src, dst); |
| |
| if (mImports.glBlendFunciOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendFunciOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, buf, src, dst] { |
| called = true; |
| observeReads(); |
| mImports.glBlendFunciOES(buf, src, dst); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_draw_buffers_indexed); |
| subBlendFunci(call, buf, src, dst); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlendFunciOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(buf, mScratch), src, dst); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glBlendParameteriNV(uint32_t pname, GLint value) { |
| GAPID_DEBUG("glBlendParameteriNV(%u, %" PRId32 ")", pname, value); |
| |
| if (mImports.glBlendParameteriNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendParameteriNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glBlendParameteriNV(pname, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_blend_equation_advanced); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlendParameteriNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< int32_t >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, uint32_t mask, uint32_t filter) { |
| GAPID_DEBUG("glBlitFramebufferANGLE(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u)", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| |
| if (mImports.glBlitFramebufferANGLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlitFramebufferANGLE"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter] { |
| called = true; |
| observeReads(); |
| mImports.glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_ANGLE_framebuffer_blit); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlitFramebufferANGLE coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(srcX0, mScratch), toEncoder< int32_t >(srcY0, mScratch), toEncoder< int32_t >(srcX1, mScratch), toEncoder< int32_t >(srcY1, mScratch), toEncoder< int32_t >(dstX0, mScratch), toEncoder< int32_t >(dstY0, mScratch), toEncoder< int32_t >(dstX1, mScratch), toEncoder< int32_t >(dstY1, mScratch), mask, filter); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glCopyImageSubDataOES(GLuint srcName, uint32_t srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, uint32_t dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) { |
| GAPID_DEBUG("glCopyImageSubDataOES(%" PRIu32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); |
| |
| if (mImports.glCopyImageSubDataOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCopyImageSubDataOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth] { |
| called = true; |
| observeReads(); |
| mImports.glCopyImageSubDataOES(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_copy_image); |
| subCopyImageSubData(call, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCopyImageSubDataOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(srcName, mScratch), srcTarget, toEncoder< int32_t >(srcLevel, mScratch), toEncoder< int32_t >(srcX, mScratch), toEncoder< int32_t >(srcY, mScratch), toEncoder< int32_t >(srcZ, mScratch), toEncoder< uint32_t >(dstName, mScratch), dstTarget, toEncoder< int32_t >(dstLevel, mScratch), toEncoder< int32_t >(dstX, mScratch), toEncoder< int32_t >(dstY, mScratch), toEncoder< int32_t >(dstZ, mScratch), toEncoder< int32_t >(srcWidth, mScratch), toEncoder< int32_t >(srcHeight, mScratch), toEncoder< int32_t >(srcDepth, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glCopyTextureLevelsAPPLE(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount) { |
| GAPID_DEBUG("glCopyTextureLevelsAPPLE(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %" PRId32 ")", destinationTexture, sourceTexture, sourceBaseLevel, sourceLevelCount); |
| |
| if (mImports.glCopyTextureLevelsAPPLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCopyTextureLevelsAPPLE"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, destinationTexture, sourceTexture, sourceBaseLevel, sourceLevelCount] { |
| called = true; |
| observeReads(); |
| mImports.glCopyTextureLevelsAPPLE(destinationTexture, sourceTexture, sourceBaseLevel, sourceLevelCount); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_APPLE_copy_texture_levels); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCopyTextureLevelsAPPLE coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(destinationTexture, mScratch), toEncoder< uint32_t >(sourceTexture, mScratch), toEncoder< int32_t >(sourceBaseLevel, mScratch), toEncoder< int32_t >(sourceLevelCount, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glCoverFillPathNV(GLuint path, uint32_t coverMode) { |
| GAPID_DEBUG("glCoverFillPathNV(%" PRIu32 ", %u)", path, coverMode); |
| |
| if (mImports.glCoverFillPathNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCoverFillPathNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, coverMode] { |
| called = true; |
| observeReads(); |
| mImports.glCoverFillPathNV(path, coverMode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCoverFillPathNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), coverMode); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glCoverStrokePathInstancedNV(GLsizei numPaths, uint32_t pathNameType, void* paths, GLuint pathBase, uint32_t coverMode, uint32_t transformType, GLfloat* transformValues) { |
| GAPID_DEBUG("glCoverStrokePathInstancedNV(%" PRId32 ", %u, %p, %" PRIu32 ", %u, %u, %p)", numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues); |
| |
| if (mImports.glCoverStrokePathInstancedNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCoverStrokePathInstancedNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues] { |
| called = true; |
| observeReads(); |
| mImports.glCoverStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCoverStrokePathInstancedNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(numPaths, mScratch), pathNameType, toEncoder< gapic::coder::gles::Void__CP >(paths, mScratch), toEncoder< uint32_t >(pathBase, mScratch), coverMode, transformType, toEncoder< gapic::coder::gles::GLfloat__CP >(transformValues, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glDrawBuffersIndexedEXT(GLint n, uint32_t* location, GLint* indices) { |
| GAPID_DEBUG("glDrawBuffersIndexedEXT(%" PRId32 ", %p, %p)", n, location, indices); |
| |
| if (mImports.glDrawBuffersIndexedEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawBuffersIndexedEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, location, indices] { |
| called = true; |
| observeReads(); |
| mImports.glDrawBuffersIndexedEXT(n, location, indices); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_multiview_draw_buffers); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDrawBuffersIndexedEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< gapic::coder::gles::GLenum__CP >(location, mScratch), toEncoder< gapic::coder::gles::GLint__CP >(indices, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glExtGetTexturesQCOM(TextureId* textures, GLint maxTextures, GLint* numTextures) { |
| GAPID_DEBUG("glExtGetTexturesQCOM(%p, %" PRId32 ", %p)", textures, maxTextures, numTextures); |
| |
| if (mImports.glExtGetTexturesQCOM == nullptr) { |
| GAPID_WARNING("Application called unsupported function glExtGetTexturesQCOM"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, textures, maxTextures, numTextures] { |
| called = true; |
| observeReads(); |
| mImports.glExtGetTexturesQCOM(textures, maxTextures, numTextures); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_QCOM_extended_get); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlExtGetTexturesQCOM coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::TextureId__P >(textures, mScratch), toEncoder< int32_t >(maxTextures, mScratch), toEncoder< gapic::coder::gles::GLint__P >(numTextures, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetNextPerfQueryIdINTEL(GLuint queryId, GLuint* nextQueryId) { |
| GAPID_DEBUG("glGetNextPerfQueryIdINTEL(%" PRIu32 ", %p)", queryId, nextQueryId); |
| |
| if (mImports.glGetNextPerfQueryIdINTEL == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetNextPerfQueryIdINTEL"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, queryId, nextQueryId] { |
| called = true; |
| observeReads(); |
| mImports.glGetNextPerfQueryIdINTEL(queryId, nextQueryId); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_INTEL_performance_query); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetNextPerfQueryIdINTEL coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(queryId, mScratch), toEncoder< gapic::coder::gles::GLuint__P >(nextQueryId, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetPathCommandsNV(GLuint path, GLubyte* commands) { |
| GAPID_DEBUG("glGetPathCommandsNV(%" PRIu32 ", %p)", path, commands); |
| |
| if (mImports.glGetPathCommandsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPathCommandsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, commands] { |
| called = true; |
| observeReads(); |
| mImports.glGetPathCommandsNV(path, commands); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetPathCommandsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< gapic::coder::gles::GLubyte__P >(commands, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetPathCoordsNV(GLuint path, GLfloat* coords) { |
| GAPID_DEBUG("glGetPathCoordsNV(%" PRIu32 ", %p)", path, coords); |
| |
| if (mImports.glGetPathCoordsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPathCoordsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, coords] { |
| called = true; |
| observeReads(); |
| mImports.glGetPathCoordsNV(path, coords); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetPathCoordsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< gapic::coder::gles::GLfloat__P >(coords, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetPerfMonitorCounterDataAMD(GLuint monitor, uint32_t pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten) { |
| GAPID_DEBUG("glGetPerfMonitorCounterDataAMD(%" PRIu32 ", %u, %" PRId32 ", %p, %p)", monitor, pname, dataSize, data, bytesWritten); |
| |
| if (mImports.glGetPerfMonitorCounterDataAMD == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPerfMonitorCounterDataAMD"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, monitor, pname, dataSize, data, bytesWritten] { |
| called = true; |
| observeReads(); |
| mImports.glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_AMD_performance_monitor); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetPerfMonitorCounterDataAMD coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(monitor, mScratch), pname, toEncoder< int32_t >(dataSize, mScratch), toEncoder< gapic::coder::gles::GLuint__P >(data, mScratch), toEncoder< gapic::coder::gles::GLint__P >(bytesWritten, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, uint32_t pname, void* data) { |
| GAPID_DEBUG("glGetPerfMonitorCounterInfoAMD(%" PRIu32 ", %" PRIu32 ", %u, %p)", group, counter, pname, data); |
| |
| if (mImports.glGetPerfMonitorCounterInfoAMD == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPerfMonitorCounterInfoAMD"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, group, counter, pname, data] { |
| called = true; |
| observeReads(); |
| mImports.glGetPerfMonitorCounterInfoAMD(group, counter, pname, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_AMD_performance_monitor); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetPerfMonitorCounterInfoAMD coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(group, mScratch), toEncoder< uint32_t >(counter, mScratch), pname, toEncoder< gapic::coder::gles::Void__P >(data, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetQueryObjecti64vEXT(QueryId query, uint32_t parameter, GLint64* value) { |
| GAPID_DEBUG("glGetQueryObjecti64vEXT(%" PRIu32 ", %u, %p)", query, parameter, value); |
| |
| if (mImports.glGetQueryObjecti64vEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetQueryObjecti64vEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, query, parameter, value] { |
| called = true; |
| observeReads(); |
| mImports.glGetQueryObjecti64vEXT(query, parameter, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_disjoint_timer_query); |
| call(); |
| write(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(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetQueryObjecti64vEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, mScratch), parameter, toEncoder< gapic::coder::gles::GLint64__P >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetTexParameterIivOES(uint32_t target, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glGetTexParameterIivOES(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glGetTexParameterIivOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTexParameterIivOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetTexParameterIivOES(target, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_border_clamp); |
| call(); |
| subGetTexParameterIiv(call, target, pname, params); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetTexParameterIivOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLint__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| GLuint64 GlesSpy::glGetTextureHandleNV(TextureId texture) { |
| GAPID_DEBUG("glGetTextureHandleNV(%" PRIu32 ")", texture); |
| |
| if (mImports.glGetTextureHandleNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTextureHandleNV"); |
| return 0; |
| } |
| |
| GLuint64 result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, texture] { |
| called = true; |
| observeReads(); |
| result = mImports.glGetTextureHandleNV(texture); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_bindless_texture); |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetTextureHandleNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, mScratch), toEncoder< uint64_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glInterpolatePathsNV(GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight) { |
| GAPID_DEBUG("glInterpolatePathsNV(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %f)", resultPath, pathA, pathB, weight); |
| |
| if (mImports.glInterpolatePathsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glInterpolatePathsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, resultPath, pathA, pathB, weight] { |
| called = true; |
| observeReads(); |
| mImports.glInterpolatePathsNV(resultPath, pathA, pathB, weight); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlInterpolatePathsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(resultPath, mScratch), toEncoder< uint32_t >(pathA, mScratch), toEncoder< uint32_t >(pathB, mScratch), toEncoder< float >(weight, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| GLboolean GlesSpy::glIsEnablediOES(uint32_t target, GLuint index) { |
| GAPID_DEBUG("glIsEnablediOES(%u, %" PRIu32 ")", target, index); |
| |
| if (mImports.glIsEnablediOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsEnablediOES"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, target, index] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsEnablediOES(target, index); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_draw_buffers_indexed); |
| uint32_t l_IsEnabledi_67_capability = target; |
| GLuint l_IsEnabledi_67_index = index; |
| GLboolean l_IsEnabledi_67_result = subGetCapability(call, l_IsEnabledi_67_capability, l_IsEnabledi_67_index); |
| call(); |
| if (__builtin_expect(shouldComputeExpectedReturn(), false)) { |
| setExpectedReturn<GLboolean>(l_IsEnabledi_67_result); |
| } |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsEnablediOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(index, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| GLboolean GlesSpy::glIsFenceNV(GLuint fence) { |
| GAPID_DEBUG("glIsFenceNV(%" PRIu32 ")", fence); |
| |
| if (mImports.glIsFenceNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsFenceNV"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, fence] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsFenceNV(fence); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_fence); |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsFenceNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(fence, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| GLboolean GlesSpy::glIsProgramPipelineEXT(PipelineId pipeline) { |
| GAPID_DEBUG("glIsProgramPipelineEXT(%" PRIu32 ")", pipeline); |
| |
| if (mImports.glIsProgramPipelineEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsProgramPipelineEXT"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, pipeline] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsProgramPipelineEXT(pipeline); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsProgramPipelineEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| GLboolean GlesSpy::glIsSyncAPPLE(GLsync sync) { |
| GAPID_DEBUG("glIsSyncAPPLE(%p)", sync); |
| |
| if (mImports.glIsSyncAPPLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsSyncAPPLE"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, sync] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsSyncAPPLE(sync); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_APPLE_sync); |
| GLsync l_IsSync_68_sync = sync; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| GLboolean l_IsSync_68_result = (GLboolean)(checkNotNull(l_ctx).mInstances.mSyncObjects.count(l_IsSync_68_sync) > 0); |
| call(); |
| if (__builtin_expect(shouldComputeExpectedReturn(), false)) { |
| setExpectedReturn<GLboolean>(l_IsSync_68_result); |
| } |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsSyncAPPLE coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLsync >(sync, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| GLboolean GlesSpy::glIsTextureHandleResidentNV(GLuint64 handle) { |
| GAPID_DEBUG("glIsTextureHandleResidentNV(%" PRIu64 ")", handle); |
| |
| if (mImports.glIsTextureHandleResidentNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsTextureHandleResidentNV"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, handle] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsTextureHandleResidentNV(handle); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_bindless_texture); |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsTextureHandleResidentNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint64_t >(handle, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void* GlesSpy::glMapBufferOES(uint32_t target, uint32_t access) { |
| GAPID_DEBUG("glMapBufferOES(%u, %u)", target, access); |
| |
| if (mImports.glMapBufferOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMapBufferOES"); |
| return nullptr; |
| } |
| |
| void* result = nullptr; |
| bool called = false; |
| auto call = [this, &called, &result, target, access] { |
| called = true; |
| observeReads(); |
| result = mImports.glMapBufferOES(target, access); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_mapbuffer); |
| std::shared_ptr<Buffer> l_b = subGetBoundBufferOrError(call, target); |
| uint32_t l_accessBits = /* switch(access) */ |
| /* case GLenum::GL_READ_ONLY: */(((access) == (GLenum::GL_READ_ONLY))) ? (GLbitfield::GL_MAP_READ_BIT) : |
| /* case GLenum::GL_WRITE_ONLY: */(((access) == (GLenum::GL_WRITE_ONLY))) ? (GLbitfield::GL_MAP_WRITE_BIT) : |
| /* case GLenum::GL_READ_WRITE: */(((access) == (GLenum::GL_READ_WRITE))) ? ((GLbitfield::GL_MAP_READ_BIT) | (GLbitfield::GL_MAP_WRITE_BIT)) : |
| /* default: */ 0; |
| call(); |
| auto l_ptr = result; |
| subMapBufferRange(call, target, (GLintptr)(0L), checkNotNull(l_b).mSize, l_accessBits, (uint8_t*)(l_ptr)); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMapBufferOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, access, toEncoder< gapic::coder::gles::Void__P >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glMultiDrawElementsEXT(uint32_t mode, GLsizei* count, uint32_t type, void** indices, GLsizei primcount) { |
| GAPID_DEBUG("glMultiDrawElementsEXT(%u, %p, %u, %p, %" PRId32 ")", mode, count, type, indices, primcount); |
| |
| if (mImports.glMultiDrawElementsEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMultiDrawElementsEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, count, type, indices, primcount] { |
| called = true; |
| observeReads(); |
| mImports.glMultiDrawElementsEXT(mode, count, type, indices, primcount); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_multi_draw_arrays); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMultiDrawElementsEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< gapic::coder::gles::GLsizei__CP >(count, mScratch), type, toEncoder< gapic::coder::gles::Void__CP__CP >(indices, mScratch), toEncoder< int32_t >(primcount, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPatchParameteriOES(uint32_t pname, GLint value) { |
| GAPID_DEBUG("glPatchParameteriOES(%u, %" PRId32 ")", pname, value); |
| |
| if (mImports.glPatchParameteriOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPatchParameteriOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glPatchParameteriOES(pname, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_tessellation_shader); |
| subPatchParameteri(call, pname, value); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPatchParameteriOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< int32_t >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPathParameterivNV(GLuint path, uint32_t pname, GLint* value) { |
| GAPID_DEBUG("glPathParameterivNV(%" PRIu32 ", %u, %p)", path, pname, value); |
| |
| if (mImports.glPathParameterivNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathParameterivNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glPathParameterivNV(path, pname, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPathParameterivNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), pname, toEncoder< gapic::coder::gles::GLint__CP >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPathSubCommandsNV(GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, GLubyte* commands, GLsizei numCoords, uint32_t coordType, void* coords) { |
| GAPID_DEBUG("glPathSubCommandsNV(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %p, %" PRId32 ", %u, %p)", path, commandStart, commandsToDelete, numCommands, commands, numCoords, coordType, coords); |
| |
| if (mImports.glPathSubCommandsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathSubCommandsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, commandStart, commandsToDelete, numCommands, commands, numCoords, coordType, coords] { |
| called = true; |
| observeReads(); |
| mImports.glPathSubCommandsNV(path, commandStart, commandsToDelete, numCommands, commands, numCoords, coordType, coords); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPathSubCommandsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< int32_t >(commandStart, mScratch), toEncoder< int32_t >(commandsToDelete, mScratch), toEncoder< int32_t >(numCommands, mScratch), toEncoder< gapic::coder::gles::GLubyte__CP >(commands, mScratch), toEncoder< int32_t >(numCoords, mScratch), coordType, toEncoder< gapic::coder::gles::Void__CP >(coords, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPathSubCoordsNV(GLuint path, GLsizei coordStart, GLsizei numCoords, uint32_t coordType, void* coords) { |
| GAPID_DEBUG("glPathSubCoordsNV(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %u, %p)", path, coordStart, numCoords, coordType, coords); |
| |
| if (mImports.glPathSubCoordsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathSubCoordsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, coordStart, numCoords, coordType, coords] { |
| called = true; |
| observeReads(); |
| mImports.glPathSubCoordsNV(path, coordStart, numCoords, coordType, coords); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPathSubCoordsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< int32_t >(coordStart, mScratch), toEncoder< int32_t >(numCoords, mScratch), coordType, toEncoder< gapic::coder::gles::Void__CP >(coords, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramPathFragmentInputGenNV(ProgramId program, GLint location, uint32_t genMode, GLint components, GLfloat* coeffs) { |
| GAPID_DEBUG("glProgramPathFragmentInputGenNV(%" PRIu32 ", %" PRId32 ", %u, %" PRId32 ", %p)", program, location, genMode, components, coeffs); |
| |
| if (mImports.glProgramPathFragmentInputGenNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramPathFragmentInputGenNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, genMode, components, coeffs] { |
| called = true; |
| observeReads(); |
| mImports.glProgramPathFragmentInputGenNV(program, location, genMode, components, coeffs); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramPathFragmentInputGenNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), genMode, toEncoder< int32_t >(components, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(coeffs, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform1iEXT(ProgramId program, UniformLocation location, GLint v0) { |
| GAPID_DEBUG("glProgramUniform1iEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ")", program, location, v0); |
| |
| if (mImports.glProgramUniform1iEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform1iEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, v0] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform1iEXT(program, location, v0); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| subProgramUniform1i(call, program, location, v0); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniform1iEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(v0, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform4fEXT(ProgramId program, UniformLocation location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { |
| GAPID_DEBUG("glProgramUniform4fEXT(%" PRIu32 ", %" PRId32 ", %f, %f, %f, %f)", program, location, v0, v1, v2, v3); |
| |
| if (mImports.glProgramUniform4fEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform4fEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, v0, v1, v2, v3] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform4fEXT(program, location, v0, v1, v2, v3); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| subProgramUniform4f(call, program, location, v0, v1, v2, v3); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniform4fEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< float >(v0, mScratch), toEncoder< float >(v1, mScratch), toEncoder< float >(v2, mScratch), toEncoder< float >(v3, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform4uiEXT(ProgramId program, UniformLocation location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) { |
| GAPID_DEBUG("glProgramUniform4uiEXT(%" PRIu32 ", %" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, location, v0, v1, v2, v3); |
| |
| if (mImports.glProgramUniform4uiEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform4uiEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, v0, v1, v2, v3] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform4uiEXT(program, location, v0, v1, v2, v3); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| subProgramUniform4ui(call, program, location, v0, v1, v2, v3); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniform4uiEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< uint32_t >(v0, mScratch), toEncoder< uint32_t >(v1, mScratch), toEncoder< uint32_t >(v2, mScratch), toEncoder< uint32_t >(v3, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniformMatrix3x4fvEXT(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) { |
| GAPID_DEBUG("glProgramUniformMatrix3x4fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value); |
| |
| if (mImports.glProgramUniformMatrix3x4fvEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix3x4fvEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix3x4fvEXT(program, location, count, transpose, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniformMatrix3x4fv(call, program, location, count, transpose, value); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniformMatrix3x4fvEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< uint8_t >(transpose, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniformMatrix4x3fvEXT(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) { |
| GAPID_DEBUG("glProgramUniformMatrix4x3fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value); |
| |
| if (mImports.glProgramUniformMatrix4x3fvEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix4x3fvEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix4x3fvEXT(program, location, count, transpose, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniformMatrix4x3fv(call, program, location, count, transpose, value); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniformMatrix4x3fvEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< uint8_t >(transpose, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glRenderbufferStorageMultisampleANGLE(uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glRenderbufferStorageMultisampleANGLE(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height); |
| |
| if (mImports.glRenderbufferStorageMultisampleANGLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleANGLE"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, samples, internalformat, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_ANGLE_framebuffer_multisample); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlRenderbufferStorageMultisampleANGLE coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, mScratch), internalformat, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glRenderbufferStorageMultisampleEXT(uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glRenderbufferStorageMultisampleEXT(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height); |
| |
| if (mImports.glRenderbufferStorageMultisampleEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, samples, internalformat, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_multisampled_render_to_texture); |
| subRenderbufferStorageMultisample(call, target, samples, internalformat, width, height); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlRenderbufferStorageMultisampleEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, mScratch), internalformat, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glRenderbufferStorageMultisampleIMG(uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glRenderbufferStorageMultisampleIMG(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height); |
| |
| if (mImports.glRenderbufferStorageMultisampleIMG == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleIMG"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, samples, internalformat, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_IMG_multisampled_render_to_texture); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlRenderbufferStorageMultisampleIMG coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(samples, mScratch), internalformat, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glSetFenceNV(GLuint fence, uint32_t condition) { |
| GAPID_DEBUG("glSetFenceNV(%" PRIu32 ", %u)", fence, condition); |
| |
| if (mImports.glSetFenceNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSetFenceNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, fence, condition] { |
| called = true; |
| observeReads(); |
| mImports.glSetFenceNV(fence, condition); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_fence); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlSetFenceNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(fence, mScratch), condition); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUseProgramStagesEXT(PipelineId pipeline, uint32_t stages, ProgramId program) { |
| GAPID_DEBUG("glUseProgramStagesEXT(%" PRIu32 ", %u, %" PRIu32 ")", pipeline, stages, program); |
| |
| if (mImports.glUseProgramStagesEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUseProgramStagesEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pipeline, stages, program] { |
| called = true; |
| observeReads(); |
| mImports.glUseProgramStagesEXT(pipeline, stages, program); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUseProgramStagesEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, mScratch), stages, toEncoder< uint32_t >(program, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glBlendEquation(uint32_t equation) { |
| GAPID_DEBUG("glBlendEquation(%u)", equation); |
| |
| if (mImports.glBlendEquation == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendEquation"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, equation] { |
| called = true; |
| observeReads(); |
| mImports.glBlendEquation(equation); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetBlendEquation(call, (DrawBufferIndex)(0UL), checkNotNull(l_ctx).mConstants.mMaxDrawBuffers, equation, equation); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlendEquation coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), equation); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glBlendFunc(uint32_t src_factor, uint32_t dst_factor) { |
| GAPID_DEBUG("glBlendFunc(%u, %u)", src_factor, dst_factor); |
| |
| if (mImports.glBlendFunc == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendFunc"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, src_factor, dst_factor] { |
| called = true; |
| observeReads(); |
| mImports.glBlendFunc(src_factor, dst_factor); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetBlendFunc(call, (DrawBufferIndex)(0UL), checkNotNull(l_ctx).mConstants.mMaxDrawBuffers, src_factor, dst_factor, src_factor, dst_factor); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlendFunc coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), src_factor, dst_factor); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glSampleMaski(GLuint maskNumber, uint32_t mask) { |
| GAPID_DEBUG("glSampleMaski(%" PRIu32 ", %u)", maskNumber, mask); |
| |
| if (mImports.glSampleMaski == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSampleMaski"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, maskNumber, mask] { |
| called = true; |
| observeReads(); |
| mImports.glSampleMaski(maskNumber, mask); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| checkNotNull(l_ctx).mRasterization.mSampleMaskValue[maskNumber] = mask; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlSampleMaski coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(maskNumber, mScratch), mask); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glBindRenderbuffer(uint32_t target, RenderbufferId renderbuffer) { |
| GAPID_DEBUG("glBindRenderbuffer(%u, %" PRIu32 ")", target, renderbuffer); |
| |
| if (mImports.glBindRenderbuffer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBindRenderbuffer"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, renderbuffer] { |
| called = true; |
| observeReads(); |
| mImports.glBindRenderbuffer(target, renderbuffer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_RENDERBUFFER: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| if (!(checkNotNull(l_ctx).mInstances.mRenderbuffers.count(renderbuffer) > 0)) { |
| checkNotNull(l_ctx).mInstances.mRenderbuffers[renderbuffer] = std::shared_ptr<Renderbuffer>(new Renderbuffer(Slice<uint8_t>(), 0, (GLsizei)(0L), (GLsizei)(0L), "")); |
| } |
| checkNotNull(l_ctx).mBoundRenderbuffers[target] = renderbuffer; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBindRenderbuffer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(renderbuffer, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glDepthMask(GLboolean enabled) { |
| GAPID_DEBUG("glDepthMask(%" PRIu8 ")", enabled); |
| |
| if (mImports.glDepthMask == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDepthMask"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, enabled] { |
| called = true; |
| observeReads(); |
| mImports.glDepthMask(enabled); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| checkNotNull(l_ctx).mFramebuffer.mDepthWritemask = enabled; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDepthMask coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint8_t >(enabled, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glFramebufferParameteri(uint32_t target, uint32_t pname, GLint param) { |
| GAPID_DEBUG("glFramebufferParameteri(%u, %u, %" PRId32 ")", target, pname, param); |
| |
| if (mImports.glFramebufferParameteri == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferParameteri"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferParameteri(target, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| std::shared_ptr<Framebuffer> l_framebuffer = subGetBoundFramebufferOrErrorInvalidEnum(call, target); |
| bool l__res_0 = subIsDefaultFramebuffer(call, l_framebuffer); |
| subGlErrorInvalidOperationIf(call, l__res_0); |
| switch (pname) { |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: { |
| checkNotNull(l_framebuffer).mDefaultFixedSampleLocations = (GLboolean)(param); |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_HEIGHT: { |
| checkNotNull(l_framebuffer).mDefaultHeight = param; |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_SAMPLES: { |
| checkNotNull(l_framebuffer).mDefaultSamples = param; |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_WIDTH: { |
| checkNotNull(l_framebuffer).mDefaultWidth = param; |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_LAYERS: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| checkNotNull(l_framebuffer).mDefaultLayers = param; |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, pname); |
| } |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlFramebufferParameteri coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< int32_t >(param, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGenRenderbuffers(GLsizei count, RenderbufferId* renderbuffers) { |
| GAPID_DEBUG("glGenRenderbuffers(%" PRId32 ", %p)", count, renderbuffers); |
| |
| if (mImports.glGenRenderbuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenRenderbuffers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, renderbuffers] { |
| called = true; |
| observeReads(); |
| mImports.glGenRenderbuffers(count, renderbuffers); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| subGlErrorInvalidValueIf(call, (count) < ((GLsizei)(0L))); |
| Slice<RenderbufferId> l_r = slice(renderbuffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) { |
| RenderbufferId l_id = (RenderbufferId)(slice(renderbuffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]); |
| checkNotNull(l_ctx).mInstances.mRenderbuffers[l_id] = std::shared_ptr<Renderbuffer>(new Renderbuffer(Slice<uint8_t>(), 0, (GLsizei)(0L), (GLsizei)(0L), "")); |
| write(l_r, (uint64_t)(l_i), l_id); |
| } |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGenRenderbuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::RenderbufferId__P >(renderbuffers, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetFramebufferParameteriv(uint32_t target, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glGetFramebufferParameteriv(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glGetFramebufferParameteriv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetFramebufferParameteriv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetFramebufferParameteriv(target, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| switch (pname) { |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_HEIGHT: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_SAMPLES: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_WIDTH: { |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_DEFAULT_LAYERS: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, pname); |
| } |
| } |
| std::shared_ptr<Framebuffer> l_framebuffer = subGetBoundFramebufferOrErrorInvalidEnum(call, target); |
| bool l__res_0 = subIsDefaultFramebuffer(call, l_framebuffer); |
| subGlErrorInvalidOperationIf(call, l__res_0); |
| call(); |
| write(slice(params, 0ULL, 1ULL), 0ULL, /* switch(pname) */ |
| /* case GLenum::GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: */(((pname) == (GLenum::GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS))) ? ((GLint)(checkNotNull(l_framebuffer).mDefaultFixedSampleLocations)) : |
| /* case GLenum::GL_FRAMEBUFFER_DEFAULT_HEIGHT: */(((pname) == (GLenum::GL_FRAMEBUFFER_DEFAULT_HEIGHT))) ? (checkNotNull(l_framebuffer).mDefaultHeight) : |
| /* case GLenum::GL_FRAMEBUFFER_DEFAULT_SAMPLES: */(((pname) == (GLenum::GL_FRAMEBUFFER_DEFAULT_SAMPLES))) ? (checkNotNull(l_framebuffer).mDefaultSamples) : |
| /* case GLenum::GL_FRAMEBUFFER_DEFAULT_WIDTH: */(((pname) == (GLenum::GL_FRAMEBUFFER_DEFAULT_WIDTH))) ? (checkNotNull(l_framebuffer).mDefaultWidth) : |
| /* case GLenum::GL_FRAMEBUFFER_DEFAULT_LAYERS: */(((pname) == (GLenum::GL_FRAMEBUFFER_DEFAULT_LAYERS))) ? (checkNotNull(l_framebuffer).mDefaultLayers) : |
| /* default: */ 0); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetFramebufferParameteriv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLint__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glStencilMaskSeparate(uint32_t face, GLuint mask) { |
| GAPID_DEBUG("glStencilMaskSeparate(%u, %" PRIu32 ")", face, mask); |
| |
| if (mImports.glStencilMaskSeparate == nullptr) { |
| GAPID_WARNING("Application called unsupported function glStencilMaskSeparate"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, face, mask] { |
| called = true; |
| observeReads(); |
| mImports.glStencilMaskSeparate(face, mask); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| switch (face) { |
| case GLenum::GL_BACK: { |
| checkNotNull(l_ctx).mFramebuffer.mStencilBackWritemask = mask; |
| break; |
| } |
| case GLenum::GL_FRONT: { |
| checkNotNull(l_ctx).mFramebuffer.mStencilWritemask = mask; |
| break; |
| } |
| case GLenum::GL_FRONT_AND_BACK: { |
| checkNotNull(l_ctx).mFramebuffer.mStencilWritemask = mask; |
| checkNotNull(l_ctx).mFramebuffer.mStencilBackWritemask = mask; |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, face); |
| } |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlStencilMaskSeparate coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), face, toEncoder< uint32_t >(mask, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glHint(uint32_t target, uint32_t mode) { |
| GAPID_DEBUG("glHint(%u, %u)", target, mode); |
| |
| if (mImports.glHint == nullptr) { |
| GAPID_WARNING("Application called unsupported function glHint"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, mode] { |
| called = true; |
| observeReads(); |
| mImports.glHint(target, mode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (mode) { |
| case GLenum::GL_DONT_CARE: // fall-through... |
| case GLenum::GL_FASTEST: // fall-through... |
| case GLenum::GL_NICEST: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, mode); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| switch (target) { |
| case GLenum::GL_GENERATE_MIPMAP_HINT: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| checkNotNull(l_ctx).mMiscellaneous.mGenerateMipmapHint = mode; |
| break; |
| } |
| case GLenum::GL_FRAGMENT_SHADER_DERIVATIVE_HINT: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| checkNotNull(l_ctx).mMiscellaneous.mFragmentShaderDerivativeHint = mode; |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlHint coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, mode); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetProgramPipelineiv(PipelineId pipeline, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glGetProgramPipelineiv(%" PRIu32 ", %u, %p)", pipeline, pname, params); |
| |
| if (mImports.glGetProgramPipelineiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetProgramPipelineiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pipeline, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetProgramPipelineiv(pipeline, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| switch (pname) { |
| case GLenum::GL_ACTIVE_PROGRAM: // fall-through... |
| case GLenum::GL_COMPUTE_SHADER: // fall-through... |
| case GLenum::GL_FRAGMENT_SHADER: // fall-through... |
| case GLenum::GL_INFO_LOG_LENGTH: // fall-through... |
| case GLenum::GL_VALIDATE_STATUS: // fall-through... |
| case GLenum::GL_VERTEX_SHADER: { |
| break; |
| } |
| case GLenum::GL_GEOMETRY_SHADER: // fall-through... |
| case GLenum::GL_TESS_CONTROL_SHADER: // fall-through... |
| case GLenum::GL_TESS_EVALUATION_SHADER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, pname); |
| } |
| } |
| call(); |
| write(slice(params, 0ULL, 1ULL), 0ULL, slice(params, 0ULL, 1ULL)[0ULL]); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetProgramPipelineiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, mScratch), pname, toEncoder< gapic::coder::gles::GLint__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetShaderInfoLog(ShaderId shader, GLsizei buffer_length, GLsizei* string_length_written, GLchar* info) { |
| GAPID_DEBUG("glGetShaderInfoLog(%" PRIu32 ", %" PRId32 ", %p, %p)", shader, buffer_length, string_length_written, info); |
| |
| if (mImports.glGetShaderInfoLog == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetShaderInfoLog"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, shader, buffer_length, string_length_written, info] { |
| called = true; |
| observeReads(); |
| mImports.glGetShaderInfoLog(shader, buffer_length, string_length_written, info); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckShader(call, l_ctx, shader); |
| subGlErrorInvalidValueIf(call, (buffer_length) < ((GLsizei)(0L))); |
| GLsizei l_writeString_78_buffer_size = buffer_length; |
| GLsizei* l_writeString_78_buffer_bytes_written = string_length_written; |
| GLchar* l_writeString_78_buffer = info; |
| call(); |
| if (((l_writeString_78_buffer) != (nullptr)) && ((l_writeString_78_buffer_size) > ((GLsizei)(0L)))) { |
| GLsizei l_buffer_size2 = l_writeString_78_buffer_size; |
| if ((l_writeString_78_buffer_bytes_written) != (nullptr)) { |
| GLsizei l_length = (GLsizei)(slice(string_length_written, 0ULL, 1ULL)[0ULL]); |
| write(slice(l_writeString_78_buffer_bytes_written, 0ULL, 1ULL), 0ULL, l_length); |
| write(slice(l_writeString_78_buffer, (uint64_t)((GLsizei)(0L)), (uint64_t)((l_length) + ((GLsizei)(1L))))); |
| } else { |
| write(slice(l_writeString_78_buffer, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_buffer_size2))); |
| } |
| } |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetShaderInfoLog coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, mScratch), toEncoder< int32_t >(buffer_length, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(string_length_written, mScratch), toEncoder< gapic::coder::gles::GLchar__P >(info, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetUniformIndices(ProgramId program, GLsizei uniformCount, GLchar** uniformNames, UniformIndex* uniformIndices) { |
| GAPID_DEBUG("glGetUniformIndices(%" PRIu32 ", %" PRId32 ", %p, %p)", program, uniformCount, uniformNames, uniformIndices); |
| |
| if (mImports.glGetUniformIndices == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetUniformIndices"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, uniformCount, uniformNames, uniformIndices] { |
| called = true; |
| observeReads(); |
| mImports.glGetUniformIndices(program, uniformCount, uniformNames, uniformIndices); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<GLchar*> l_names = slice(uniformNames, (uint64_t)((GLsizei)(0L)), (uint64_t)(uniformCount)); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < uniformCount; ++l_i) { |
| (void)string((char*)(read(l_names, (uint64_t)(l_i)))); |
| } |
| call(); |
| write(slice(uniformIndices, (uint64_t)((GLsizei)(0L)), (uint64_t)(uniformCount))); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetUniformIndices coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(uniformCount, mScratch), toEncoder< gapic::coder::gles::GLchar__CP__CP >(uniformNames, mScratch), toEncoder< gapic::coder::gles::UniformIndex__P >(uniformIndices, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| GLboolean GlesSpy::glIsShader(ShaderId shader) { |
| GAPID_DEBUG("glIsShader(%" PRIu32 ")", shader); |
| |
| if (mImports.glIsShader == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsShader"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, shader] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsShader(shader); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| if (__builtin_expect(shouldComputeExpectedReturn(), false)) { |
| setExpectedReturn<GLboolean>((GLboolean)(checkNotNull(l_ctx).mInstances.mShaders.count(shader) > 0)); |
| } |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsShader coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glProgramBinary(ProgramId program, uint32_t binaryFormat, void* binary, GLsizei length) { |
| GAPID_DEBUG("glProgramBinary(%" PRIu32 ", %u, %p, %" PRId32 ")", program, binaryFormat, binary, length); |
| |
| if (mImports.glProgramBinary == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramBinary"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, binaryFormat, binary, length] { |
| called = true; |
| observeReads(); |
| mImports.glProgramBinary(program, binaryFormat, binary, length); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subProgramBinary(call, program, binaryFormat, binary, length); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramBinary coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), binaryFormat, toEncoder< gapic::coder::gles::Void__CP >(binary, mScratch), toEncoder< int32_t >(length, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform1uiv(ProgramId program, UniformLocation location, GLsizei count, GLuint* values) { |
| GAPID_DEBUG("glProgramUniform1uiv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values); |
| |
| if (mImports.glProgramUniform1uiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform1uiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform1uiv(program, location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniform1uiv(call, program, location, count, values); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniform1uiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::GLuint__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform2i(ProgramId program, UniformLocation location, GLint value0, GLint value1) { |
| GAPID_DEBUG("glProgramUniform2i(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", program, location, value0, value1); |
| |
| if (mImports.glProgramUniform2i == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform2i"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, value0, value1] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform2i(program, location, value0, value1); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| call(); |
| subProgramUniform2i(call, program, location, value0, value1); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniform2i coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(value0, mScratch), toEncoder< int32_t >(value1, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform3f(ProgramId program, UniformLocation location, GLfloat value0, GLfloat value1, GLfloat value2) { |
| GAPID_DEBUG("glProgramUniform3f(%" PRIu32 ", %" PRId32 ", %f, %f, %f)", program, location, value0, value1, value2); |
| |
| if (mImports.glProgramUniform3f == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform3f"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, value0, value1, value2] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform3f(program, location, value0, value1, value2); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| call(); |
| subProgramUniform3f(call, program, location, value0, value1, value2); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniform3f coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< float >(value0, mScratch), toEncoder< float >(value1, mScratch), toEncoder< float >(value2, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniformMatrix2x4fv(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glProgramUniformMatrix2x4fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values); |
| |
| if (mImports.glProgramUniformMatrix2x4fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix2x4fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix2x4fv(program, location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniformMatrix2x4fv(call, program, location, count, transpose, values); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniformMatrix2x4fv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< uint8_t >(transpose, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniformMatrix4x2fv(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glProgramUniformMatrix4x2fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values); |
| |
| if (mImports.glProgramUniformMatrix4x2fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix4x2fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix4x2fv(program, location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniformMatrix4x2fv(call, program, location, count, transpose, values); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlProgramUniformMatrix4x2fv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< uint8_t >(transpose, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUniform1ui(UniformLocation location, GLuint value0) { |
| GAPID_DEBUG("glUniform1ui(%" PRId32 ", %" PRIu32 ")", location, value0); |
| |
| if (mImports.glUniform1ui == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform1ui"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value0] { |
| called = true; |
| observeReads(); |
| mImports.glUniform1ui(location, value0); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<GLuint> l_v = make<GLuint>(1ULL); |
| call(); |
| write(l_v, 0ULL, value0); |
| UniformLocation l_Uniformv_88_location = location; |
| Slice<GLuint> l_Uniformv_88_values = l_v; |
| uint32_t l_Uniformv_88_type = GLenum::GL_UNSIGNED_INT; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_88_location, l_Uniformv_88_values.as<uint8_t>(), l_Uniformv_88_type); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUniform1ui coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< uint32_t >(value0, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUniform2iv(UniformLocation location, GLsizei count, GLint* values) { |
| GAPID_DEBUG("glUniform2iv(%" PRId32 ", %" PRId32 ", %p)", location, count, values); |
| |
| if (mImports.glUniform2iv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform2iv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniform2iv(location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<Vec2i> l_v = slice((Vec2i*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| UniformLocation l_Uniformv_93_location = location; |
| Slice<Vec2i> l_Uniformv_93_values = l_v; |
| uint32_t l_Uniformv_93_type = GLenum::GL_INT_VEC2; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_93_location, l_Uniformv_93_values.as<uint8_t>(), l_Uniformv_93_type); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUniform2iv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::GLint__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUniform3fv(UniformLocation location, GLsizei count, GLfloat* values) { |
| GAPID_DEBUG("glUniform3fv(%" PRId32 ", %" PRId32 ", %p)", location, count, values); |
| |
| if (mImports.glUniform3fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform3fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniform3fv(location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<Vec3f> l_v = slice((Vec3f*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| UniformLocation l_Uniformv_97_location = location; |
| Slice<Vec3f> l_Uniformv_97_values = l_v; |
| uint32_t l_Uniformv_97_type = GLenum::GL_FLOAT_VEC3; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_97_location, l_Uniformv_97_values.as<uint8_t>(), l_Uniformv_97_type); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUniform3fv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUniformMatrix2fv(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glUniformMatrix2fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values); |
| |
| if (mImports.glUniformMatrix2fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix2fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix2fv(location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<Mat2f> l_v = slice((Mat2f*)(values), (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| UniformLocation l_UniformMatrixv_108_location = location; |
| GLboolean l_UniformMatrixv_108_transpose = transpose; |
| Slice<Mat2f> l_UniformMatrixv_108_values = l_v; |
| uint32_t l_UniformMatrixv_108_type = GLenum::GL_FLOAT_MAT2; |
| (void)l_UniformMatrixv_108_transpose; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_UniformMatrixv_108_location, l_UniformMatrixv_108_values.as<uint8_t>(), l_UniformMatrixv_108_type); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUniformMatrix2fv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< uint8_t >(transpose, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPolygonOffset(GLfloat scale_factor, GLfloat units) { |
| GAPID_DEBUG("glPolygonOffset(%f, %f)", scale_factor, units); |
| |
| if (mImports.glPolygonOffset == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPolygonOffset"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, scale_factor, units] { |
| called = true; |
| observeReads(); |
| mImports.glPolygonOffset(scale_factor, units); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| checkNotNull(l_ctx).mRasterization.mPolygonOffsetUnits = units; |
| checkNotNull(l_ctx).mRasterization.mPolygonOffsetFactor = scale_factor; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPolygonOffset coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(scale_factor, mScratch), toEncoder< float >(units, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| GLboolean GlesSpy::glIsEnabled(uint32_t capability) { |
| GAPID_DEBUG("glIsEnabled(%u)", capability); |
| |
| if (mImports.glIsEnabled == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsEnabled"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, capability] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsEnabled(capability); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| GLboolean l__res_0 = subGetCapability(call, capability, (GLuint)(0UL)); |
| call(); |
| if (__builtin_expect(shouldComputeExpectedReturn(), false)) { |
| setExpectedReturn<GLboolean>(l__res_0); |
| } |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlIsEnabled coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), capability, toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glGetSamplerParameterIiv(SamplerId sampler, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glGetSamplerParameterIiv(%" PRIu32 ", %u, %p)", sampler, pname, params); |
| |
| if (mImports.glGetSamplerParameterIiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetSamplerParameterIiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sampler, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetSamplerParameterIiv(sampler, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| call(); |
| subGetSamplerParameterIiv(call, sampler, pname, params); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetSamplerParameterIiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, mScratch), pname, toEncoder< gapic::coder::gles::GLint__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glTexImage3D(uint32_t target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, uint32_t format, uint32_t type, TexturePointer data) { |
| GAPID_DEBUG("glTexImage3D(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %p)", target, level, internalformat, width, height, depth, border, format, type, data); |
| |
| if (mImports.glTexImage3D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexImage3D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, internalformat, width, height, depth, border, format, type, data] { |
| called = true; |
| observeReads(); |
| mImports.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subTexImage3D(call, target, level, internalformat, width, height, depth, border, format, type, data); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexImage3D coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, mScratch), toEncoder< int32_t >(internalformat, mScratch), toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(depth, mScratch), toEncoder< int32_t >(border, mScratch), format, type, toEncoder< gapic::coder::gles::TexturePointer >(data, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glTexParameterIuiv(uint32_t target, uint32_t pname, GLuint* params) { |
| GAPID_DEBUG("glTexParameterIuiv(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glTexParameterIuiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexParameterIuiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glTexParameterIuiv(target, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subTexParameterIuiv(call, target, pname, params); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexParameterIuiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLuint__CP >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glTexSubImage3D(uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, uint32_t format, uint32_t type, TexturePointer data) { |
| GAPID_DEBUG("glTexSubImage3D(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %p)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); |
| |
| if (mImports.glTexSubImage3D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexSubImage3D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data] { |
| called = true; |
| observeReads(); |
| mImports.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subTexSubImage3D(call, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexSubImage3D coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, mScratch), toEncoder< int32_t >(xoffset, mScratch), toEncoder< int32_t >(yoffset, mScratch), toEncoder< int32_t >(zoffset, mScratch), toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(depth, mScratch), format, type, toEncoder< gapic::coder::gles::TexturePointer >(data, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetTransformFeedbackVarying(ProgramId program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, uint32_t* type, GLchar* name) { |
| GAPID_DEBUG("glGetTransformFeedbackVarying(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p, %p, %p, %p)", program, index, bufSize, length, size, type, name); |
| |
| if (mImports.glGetTransformFeedbackVarying == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTransformFeedbackVarying"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, index, bufSize, length, size, type, name] { |
| called = true; |
| observeReads(); |
| mImports.glGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| GLsizei l_writeString_128_buffer_size = bufSize; |
| GLsizei* l_writeString_128_buffer_bytes_written = length; |
| GLchar* l_writeString_128_buffer = name; |
| call(); |
| if (((l_writeString_128_buffer) != (nullptr)) && ((l_writeString_128_buffer_size) > ((GLsizei)(0L)))) { |
| GLsizei l_buffer_size2 = l_writeString_128_buffer_size; |
| if ((l_writeString_128_buffer_bytes_written) != (nullptr)) { |
| GLsizei l_length = (GLsizei)(slice(length, 0ULL, 1ULL)[0ULL]); |
| write(slice(l_writeString_128_buffer_bytes_written, 0ULL, 1ULL), 0ULL, l_length); |
| write(slice(l_writeString_128_buffer, (uint64_t)((GLsizei)(0L)), (uint64_t)((l_length) + ((GLsizei)(1L))))); |
| } else { |
| write(slice(l_writeString_128_buffer, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_buffer_size2))); |
| } |
| } |
| write(slice(size, 0ULL, 1ULL), 0ULL, slice(size, 0ULL, 1ULL)[0ULL]); |
| write(slice(type, 0ULL, 1ULL), 0ULL, slice(type, 0ULL, 1ULL)[0ULL]); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetTransformFeedbackVarying coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< uint32_t >(index, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(length, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(size, mScratch), toEncoder< gapic::coder::gles::GLenum__P >(type, mScratch), toEncoder< gapic::coder::gles::GLchar__P >(name, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPauseTransformFeedback() { |
| GAPID_DEBUG("glPauseTransformFeedback()"); |
| |
| if (mImports.glPauseTransformFeedback == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPauseTransformFeedback"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glPauseTransformFeedback(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| std::shared_ptr<TransformFeedback> l__res_0 = subGetBoundTransformFeedback(call); |
| checkNotNull(l__res_0).mPaused = (GLboolean)(1U); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPauseTransformFeedback coder(mScratch.vector<gapic::Encodable*>(kMaxExtras)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetVertexAttribiv(AttributeLocation index, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glGetVertexAttribiv(%" PRIu32 ", %u, %p)", index, pname, params); |
| |
| if (mImports.glGetVertexAttribiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetVertexAttribiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetVertexAttribiv(index, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidValueIf(call, (index) >= (checkNotNull(l_ctx).mConstants.mMaxVertexAttribs)); |
| call(); |
| if ((pname) == (GLenum::GL_CURRENT_VERTEX_ATTRIB)) { |
| write(slice(params, 0ULL, 4ULL)); |
| } else { |
| uint64_t l__res_0 = subGetVertexAttrib(call, l_ctx, index, pname); |
| write(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(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetVertexAttribiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), pname, toEncoder< gapic::coder::gles::GLint__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glVertexAttrib1fv(AttributeLocation location, GLfloat* value) { |
| GAPID_DEBUG("glVertexAttrib1fv(%" PRIu32 ", %p)", location, value); |
| |
| if (mImports.glVertexAttrib1fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttrib1fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttrib1fv(location, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<GLfloat> l_v = slice(value, 0ULL, 1ULL); |
| Vec4f l_vec = {read(l_v, 0ULL), (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(1.f)}; |
| call(); |
| subVertexAttribF(call, location, l_vec); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlVertexAttrib1fv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(value, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glVertexAttribFormat(AttributeLocation index, GLint size, uint32_t type, GLboolean normalized, GLuint relativeoffset) { |
| GAPID_DEBUG("glVertexAttribFormat(%" PRIu32 ", %" PRId32 ", %u, %" PRIu8 ", %" PRIu32 ")", index, size, type, normalized, relativeoffset); |
| |
| if (mImports.glVertexAttribFormat == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttribFormat"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, size, type, normalized, relativeoffset] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttribFormat(index, size, type, normalized, relativeoffset); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidOperationIf(call, (checkNotNull(l_ctx).mBoundVertexArray) == ((VertexArrayId)(0UL))); |
| subVertexAttribFormat(call, l_ctx, index, size, type, normalized, relativeoffset, false); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlVertexAttribFormat coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), toEncoder< int32_t >(size, mScratch), type, toEncoder< uint8_t >(normalized, mScratch), toEncoder< uint32_t >(relativeoffset, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glVertexAttribI4uiv(AttributeLocation index, GLuint* values) { |
| GAPID_DEBUG("glVertexAttribI4uiv(%" PRIu32 ", %p)", index, values); |
| |
| if (mImports.glVertexAttribI4uiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttribI4uiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, values] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttribI4uiv(index, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<GLuint> l_v = slice(values, 0ULL, 4ULL); |
| Vec4i l_vec = {(GLint)(read(l_v, 0ULL)), (GLint)(read(l_v, 1ULL)), (GLint)(read(l_v, 2ULL)), (GLint)(read(l_v, 3ULL))}; |
| call(); |
| subVertexAttribI(call, index, l_vec); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlVertexAttribI4uiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), toEncoder< gapic::coder::gles::GLuint__CP >(values, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| CGLError GlesSpy::CGLSetCurrentContext(CGLContextObj ctx) { |
| GAPID_DEBUG("CGLSetCurrentContext(%p)", ctx); |
| |
| if (mImports.CGLSetCurrentContext == nullptr) { |
| GAPID_WARNING("Application called unsupported function CGLSetCurrentContext"); |
| return 0; |
| } |
| |
| CGLError result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, ctx] { |
| called = true; |
| observeReads(); |
| result = mImports.CGLSetCurrentContext(ctx); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subSetContext(call, findOrZero(this->CGLContexts, ctx)); |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::CGLSetCurrentContext coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::CGLContextObj >(ctx, mScratch), toEncoder< int >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glClearColorxOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) { |
| GAPID_DEBUG("glClearColorxOES(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", red, green, blue, alpha); |
| |
| if (mImports.glClearColorxOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClearColorxOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, red, green, blue, alpha] { |
| called = true; |
| observeReads(); |
| mImports.glClearColorxOES(red, green, blue, alpha); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlClearColorxOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(red, mScratch), toEncoder< int32_t >(green, mScratch), toEncoder< int32_t >(blue, mScratch), toEncoder< int32_t >(alpha, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glClipPlanefIMG(uint32_t p, GLfloat* eqn) { |
| GAPID_DEBUG("glClipPlanefIMG(%u, %p)", p, eqn); |
| |
| if (mImports.glClipPlanefIMG == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClipPlanefIMG"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, p, eqn] { |
| called = true; |
| observeReads(); |
| mImports.glClipPlanefIMG(p, eqn); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_IMG_user_clip_plane); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlClipPlanefIMG coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), p, toEncoder< gapic::coder::gles::GLfloat__CP >(eqn, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glClipPlanexOES(uint32_t plane, GLfixed* equation) { |
| GAPID_DEBUG("glClipPlanexOES(%u, %p)", plane, equation); |
| |
| if (mImports.glClipPlanexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClipPlanexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, plane, equation] { |
| called = true; |
| observeReads(); |
| mImports.glClipPlanexOES(plane, equation); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlClipPlanexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), plane, toEncoder< gapic::coder::gles::GLfixed__CP >(equation, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glFogxOES(uint32_t pname, GLfixed param) { |
| GAPID_DEBUG("glFogxOES(%u, %" PRId32 ")", pname, param); |
| |
| if (mImports.glFogxOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFogxOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glFogxOES(pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlFogxOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< int32_t >(param, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glFrustumfOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) { |
| GAPID_DEBUG("glFrustumfOES(%f, %f, %f, %f, %f, %f)", l, r, b, t, n, f); |
| |
| if (mImports.glFrustumfOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFrustumfOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, l, r, b, t, n, f] { |
| called = true; |
| observeReads(); |
| mImports.glFrustumfOES(l, r, b, t, n, f); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_single_precision); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlFrustumfOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(l, mScratch), toEncoder< float >(r, mScratch), toEncoder< float >(b, mScratch), toEncoder< float >(t, mScratch), toEncoder< float >(n, mScratch), toEncoder< float >(f, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetFixedvOES(uint32_t pname, GLfixed* params) { |
| GAPID_DEBUG("glGetFixedvOES(%u, %p)", pname, params); |
| |
| if (mImports.glGetFixedvOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetFixedvOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetFixedvOES(pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetFixedvOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< gapic::coder::gles::GLfixed__P >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glLightModelfv(uint32_t pname, GLfloat* params) { |
| GAPID_DEBUG("glLightModelfv(%u, %p)", pname, params); |
| |
| if (mImports.glLightModelfv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLightModelfv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glLightModelfv(pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlLightModelfv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< gapic::coder::gles::GLfloat__CP >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glLoadMatrixf(GLfloat* m) { |
| GAPID_DEBUG("glLoadMatrixf(%p)", m); |
| |
| if (mImports.glLoadMatrixf == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLoadMatrixf"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, m] { |
| called = true; |
| observeReads(); |
| mImports.glLoadMatrixf(m); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlLoadMatrixf coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLfloat__CP >(m, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glLogicOp(uint32_t opcode) { |
| GAPID_DEBUG("glLogicOp(%u)", opcode); |
| |
| if (mImports.glLogicOp == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLogicOp"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, opcode] { |
| called = true; |
| observeReads(); |
| mImports.glLogicOp(opcode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlLogicOp coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), opcode); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glMaterialfv(uint32_t face, uint32_t pname, GLfloat* params) { |
| GAPID_DEBUG("glMaterialfv(%u, %u, %p)", face, pname, params); |
| |
| if (mImports.glMaterialfv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMaterialfv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, face, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glMaterialfv(face, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMaterialfv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), face, pname, toEncoder< gapic::coder::gles::GLfloat__CP >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glMultMatrixx(GLfixed* m) { |
| GAPID_DEBUG("glMultMatrixx(%p)", m); |
| |
| if (mImports.glMultMatrixx == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMultMatrixx"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, m] { |
| called = true; |
| observeReads(); |
| mImports.glMultMatrixx(m); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMultMatrixx coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLfixed__CP >(m, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glMultiTexCoord4f(uint32_t target, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { |
| GAPID_DEBUG("glMultiTexCoord4f(%u, %f, %f, %f, %f)", target, v0, v1, v2, v3); |
| |
| if (mImports.glMultiTexCoord4f == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMultiTexCoord4f"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, v0, v1, v2, v3] { |
| called = true; |
| observeReads(); |
| mImports.glMultiTexCoord4f(target, v0, v1, v2, v3); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMultiTexCoord4f coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< float >(v0, mScratch), toEncoder< float >(v1, mScratch), toEncoder< float >(v2, mScratch), toEncoder< float >(v3, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz) { |
| GAPID_DEBUG("glNormal3xOES(%" PRId32 ", %" PRId32 ", %" PRId32 ")", nx, ny, nz); |
| |
| if (mImports.glNormal3xOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glNormal3xOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, nx, ny, nz] { |
| called = true; |
| observeReads(); |
| mImports.glNormal3xOES(nx, ny, nz); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlNormal3xOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(nx, mScratch), toEncoder< int32_t >(ny, mScratch), toEncoder< int32_t >(nz, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPointParameterfv(uint32_t pname, GLfloat* params) { |
| GAPID_DEBUG("glPointParameterfv(%u, %p)", pname, params); |
| |
| if (mImports.glPointParameterfv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPointParameterfv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glPointParameterfv(pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPointParameterfv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), pname, toEncoder< gapic::coder::gles::GLfloat__CP >(params, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glSampleCoveragexOES(GLclampx value, GLboolean invert) { |
| GAPID_DEBUG("glSampleCoveragexOES(%" PRId32 ", %" PRIu8 ")", value, invert); |
| |
| if (mImports.glSampleCoveragexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSampleCoveragexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, value, invert] { |
| called = true; |
| observeReads(); |
| mImports.glSampleCoveragexOES(value, invert); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlSampleCoveragexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(value, mScratch), toEncoder< uint8_t >(invert, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glTexEnvxOES(uint32_t target, uint32_t pname, GLfixed param) { |
| GAPID_DEBUG("glTexEnvxOES(%u, %u, %" PRId32 ")", target, pname, param); |
| |
| if (mImports.glTexEnvxOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexEnvxOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glTexEnvxOES(target, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexEnvxOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< int32_t >(param, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glTexGeniOES(uint32_t coord, uint32_t pname, GLint param) { |
| GAPID_DEBUG("glTexGeniOES(%u, %u, %" PRId32 ")", coord, pname, param); |
| |
| if (mImports.glTexGeniOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexGeniOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, coord, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glTexGeniOES(coord, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_cube_map); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexGeniOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), coord, pname, toEncoder< int32_t >(param, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glNormalPointerBounds(uint32_t type, GLsizei stride, void* pointer, GLsizei count) { |
| GAPID_DEBUG("glNormalPointerBounds(%u, %" PRId32 ", %p, %" PRId32 ")", type, stride, pointer, count); |
| |
| if (mImports.glNormalPointerBounds == nullptr) { |
| GAPID_WARNING("Application called unsupported function glNormalPointerBounds"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, type, stride, pointer, count] { |
| called = true; |
| observeReads(); |
| mImports.glNormalPointerBounds(type, stride, pointer, count); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlNormalPointerBounds coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), type, toEncoder< int32_t >(stride, mScratch), toEncoder< gapic::coder::gles::Void__CP >(pointer, mScratch), toEncoder< int32_t >(count, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| } // namespace gapii |