| /* |
| * Copyright 2015, The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| * |
| * THIS FILE WAS GENERATED BY apic. DO NOT EDIT. |
| */ |
| |
| |
| #include "abort_exception.h" |
| #include "gles_imports.h" |
| #include "gles_types.h" |
| |
| #include "gles_spy.h" |
| |
| #include <gapic/log.h> |
| #include <gapic/coder/memory.h> |
| #include <gapic/coder/atom.h> |
| #include <gapic/coder/gles.h> |
| |
| #define __STDC_FORMAT_MACROS |
| #include <inttypes.h> |
| |
| #include <stdint.h> |
| |
| #include <memory> |
| #include <string> |
| |
| namespace gapii { |
| |
| void GlesSpy::glDebugMessageControlKHR(uint32_t source, uint32_t type, uint32_t severity, GLsizei count, GLuint* ids, GLboolean enabled) { |
| GAPID_DEBUG("glDebugMessageControlKHR(%u, %u, %u, %" PRId32 ", %p, %" PRIu8 ")", source, type, severity, count, ids, enabled); |
| |
| if (mImports.glDebugMessageControlKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDebugMessageControlKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, source, type, severity, count, ids, enabled] { |
| called = true; |
| observeReads(); |
| mImports.glDebugMessageControlKHR(source, type, severity, count, ids, enabled); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_debug); |
| subDebugMessageControl(call, source, type, severity, count, ids, 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::GlDebugMessageControlKHR coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), source, type, severity, toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::GLuint__CP >(ids, mScratch), 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::glGetObjectLabelKHR(uint32_t identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label) { |
| GAPID_DEBUG("glGetObjectLabelKHR(%u, %" PRIu32 ", %" PRId32 ", %p, %p)", identifier, name, bufSize, length, label); |
| |
| if (mImports.glGetObjectLabelKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetObjectLabelKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, identifier, name, bufSize, length, label] { |
| called = true; |
| observeReads(); |
| mImports.glGetObjectLabelKHR(identifier, name, bufSize, length, label); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_debug); |
| call(); |
| subGetObjectLabel(call, identifier, name, bufSize, length, label); |
| } 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::GlGetObjectLabelKHR coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), identifier, toEncoder< uint32_t >(name, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(length, mScratch), toEncoder< gapic::coder::gles::GLchar__P >(label, 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::glObjectPtrLabelKHR(void* ptr, GLsizei length, GLchar* label) { |
| GAPID_DEBUG("glObjectPtrLabelKHR(%p, %" PRId32 ", %p)", ptr, length, label); |
| |
| if (mImports.glObjectPtrLabelKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glObjectPtrLabelKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, ptr, length, label] { |
| called = true; |
| observeReads(); |
| mImports.glObjectPtrLabelKHR(ptr, length, label); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_debug); |
| subObjectPtrLabel(call, ptr, length, label); |
| 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::GlObjectPtrLabelKHR coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__CP >(ptr, mScratch), toEncoder< int32_t >(length, mScratch), toEncoder< gapic::coder::gles::GLchar__CP >(label, 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::glGenQueries(GLsizei count, QueryId* queries) { |
| GAPID_DEBUG("glGenQueries(%" PRId32 ", %p)", count, queries); |
| |
| if (mImports.glGenQueries == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenQueries"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, queries] { |
| called = true; |
| observeReads(); |
| mImports.glGenQueries(count, queries); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<QueryId> l_q = slice(queries, (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) { |
| QueryId l_id = (QueryId)(slice(queries, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]); |
| checkNotNull(l_ctx).mInstances.mQueries[l_id] = std::shared_ptr<Query>(new Query("")); |
| write(l_q, (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::GlGenQueries coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::QueryId__P >(queries, 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::glDeleteBuffers(GLsizei count, BufferId* buffers) { |
| GAPID_DEBUG("glDeleteBuffers(%" PRId32 ", %p)", count, buffers); |
| |
| if (mImports.glDeleteBuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeleteBuffers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, buffers] { |
| called = true; |
| observeReads(); |
| mImports.glDeleteBuffers(count, buffers); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subGlErrorInvalidValueIf(call, (count) < ((GLsizei)(0L))); |
| Slice<BufferId> l_b = slice(buffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) { |
| BufferId l_id = read(l_b, (uint64_t)(l_i)); |
| if ((l_id) != ((BufferId)(0UL))) { |
| checkNotNull(l_ctx).mInstances.mBuffers.erase(l_id); |
| } |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDeleteBuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::BufferId__CP >(buffers, 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::glDrawArraysIndirect(uint32_t draw_mode, void* indirect) { |
| GAPID_DEBUG("glDrawArraysIndirect(%u, %p)", draw_mode, indirect); |
| |
| if (mImports.glDrawArraysIndirect == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawArraysIndirect"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, draw_mode, indirect] { |
| called = true; |
| observeReads(); |
| mImports.glDrawArraysIndirect(draw_mode, indirect); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subCheckPrimitiveType(call, draw_mode); |
| 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::GlDrawArraysIndirect coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), draw_mode, 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::glDrawRangeElements(uint32_t draw_mode, GLuint start, GLuint end, GLsizei indices_count, uint32_t indices_type, IndicesPointer indices) { |
| GAPID_DEBUG("glDrawRangeElements(%u, %" PRIu32 ", %" PRIu32 ", %" PRId32 ", %u, %p)", draw_mode, start, end, indices_count, indices_type, indices); |
| |
| if (mImports.glDrawRangeElements == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawRangeElements"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, draw_mode, start, end, indices_count, indices_type, indices] { |
| called = true; |
| observeReads(); |
| mImports.glDrawRangeElements(draw_mode, start, end, indices_count, indices_type, indices); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subGlErrorInvalidValueIf(call, (end) < (start)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subDrawElements(call, l_ctx, draw_mode, indices_count, indices_type, indices, (GLsizei)(1L), (GLint)(0L)); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDrawRangeElements coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), draw_mode, toEncoder< uint32_t >(start, mScratch), toEncoder< uint32_t >(end, mScratch), toEncoder< int32_t >(indices_count, mScratch), indices_type, toEncoder< gapic::coder::gles::IndicesPointer >(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); |
| onPostDrawCall(); |
| |
| } |
| |
| void GlesSpy::glPrimitiveBoundingBox(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) { |
| GAPID_DEBUG("glPrimitiveBoundingBox(%f, %f, %f, %f, %f, %f, %f, %f)", minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); |
| |
| if (mImports.glPrimitiveBoundingBox == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPrimitiveBoundingBox"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW] { |
| called = true; |
| observeReads(); |
| mImports.glPrimitiveBoundingBox(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subPrimitiveBoundingBox(call, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPrimitiveBoundingBox coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(minX, mScratch), toEncoder< float >(minY, mScratch), toEncoder< float >(minZ, mScratch), toEncoder< float >(minW, mScratch), toEncoder< float >(maxX, mScratch), toEncoder< float >(maxY, mScratch), toEncoder< float >(maxZ, mScratch), toEncoder< float >(maxW, 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::glBeginQueryEXT(uint32_t target, QueryId query) { |
| GAPID_DEBUG("glBeginQueryEXT(%u, %" PRIu32 ")", target, query); |
| |
| if (mImports.glBeginQueryEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBeginQueryEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, query] { |
| called = true; |
| observeReads(); |
| mImports.glBeginQueryEXT(target, query); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension2(call, ExtensionId::GL_EXT_disjoint_timer_query, ExtensionId::GL_EXT_occlusion_query_boolean); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBeginQueryEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(query, 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::glBlendBarrierNV() { |
| GAPID_DEBUG("glBlendBarrierNV()"); |
| |
| if (mImports.glBlendBarrierNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendBarrierNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glBlendBarrierNV(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_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::GlBlendBarrierNV 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::glBlitFramebufferNV(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, uint32_t mask, uint32_t filter) { |
| GAPID_DEBUG("glBlitFramebufferNV(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u)", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| |
| if (mImports.glBlitFramebufferNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlitFramebufferNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter] { |
| called = true; |
| observeReads(); |
| mImports.glBlitFramebufferNV(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_framebuffer_blit); |
| subBlitFramebuffer(call, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBlitFramebufferNV 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::glCoverageMaskNV(GLboolean mask) { |
| GAPID_DEBUG("glCoverageMaskNV(%" PRIu8 ")", mask); |
| |
| if (mImports.glCoverageMaskNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCoverageMaskNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mask] { |
| called = true; |
| observeReads(); |
| mImports.glCoverageMaskNV(mask); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_coverage_sample); |
| 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::GlCoverageMaskNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint8_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::glDrawArraysInstancedBaseInstanceEXT(uint32_t mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance) { |
| GAPID_DEBUG("glDrawArraysInstancedBaseInstanceEXT(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu32 ")", mode, first, count, instancecount, baseinstance); |
| |
| if (mImports.glDrawArraysInstancedBaseInstanceEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawArraysInstancedBaseInstanceEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, first, count, instancecount, baseinstance] { |
| called = true; |
| observeReads(); |
| mImports.glDrawArraysInstancedBaseInstanceEXT(mode, first, count, instancecount, baseinstance); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_base_instance); |
| 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::GlDrawArraysInstancedBaseInstanceEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< int32_t >(first, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< int32_t >(instancecount, mScratch), toEncoder< uint32_t >(baseinstance, 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::glDrawElementsInstancedBaseVertexEXT(uint32_t mode, GLsizei count, uint32_t type, IndicesPointer indices, GLsizei instancecount, GLint basevertex) { |
| GAPID_DEBUG("glDrawElementsInstancedBaseVertexEXT(%u, %" PRId32 ", %u, %p, %" PRId32 ", %" PRId32 ")", mode, count, type, indices, instancecount, basevertex); |
| |
| if (mImports.glDrawElementsInstancedBaseVertexEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawElementsInstancedBaseVertexEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, count, type, indices, instancecount, basevertex] { |
| called = true; |
| observeReads(); |
| mImports.glDrawElementsInstancedBaseVertexEXT(mode, count, type, indices, instancecount, basevertex); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_draw_elements_base_vertex); |
| subDrawElementsInstancedBaseVertex(call, mode, count, type, indices, instancecount, basevertex); |
| 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::GlDrawElementsInstancedBaseVertexEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< int32_t >(count, mScratch), type, toEncoder< gapic::coder::gles::IndicesPointer >(indices, mScratch), toEncoder< int32_t >(instancecount, mScratch), toEncoder< int32_t >(basevertex, 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::glDrawRangeElementsBaseVertexOES(uint32_t mode, GLuint start, GLuint end, GLsizei count, uint32_t type, IndicesPointer indices, GLint basevertex) { |
| GAPID_DEBUG("glDrawRangeElementsBaseVertexOES(%u, %" PRIu32 ", %" PRIu32 ", %" PRId32 ", %u, %p, %" PRId32 ")", mode, start, end, count, type, indices, basevertex); |
| |
| if (mImports.glDrawRangeElementsBaseVertexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawRangeElementsBaseVertexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, start, end, count, type, indices, basevertex] { |
| called = true; |
| observeReads(); |
| mImports.glDrawRangeElementsBaseVertexOES(mode, start, end, count, type, indices, basevertex); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_draw_elements_base_vertex); |
| subDrawRangeElementsBaseVertex(call, mode, start, end, count, type, indices, basevertex); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDrawRangeElementsBaseVertexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< uint32_t >(start, mScratch), toEncoder< uint32_t >(end, mScratch), toEncoder< int32_t >(count, mScratch), type, toEncoder< gapic::coder::gles::IndicesPointer >(indices, mScratch), toEncoder< int32_t >(basevertex, 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::glEnableDriverControlQCOM(GLuint driverControl) { |
| GAPID_DEBUG("glEnableDriverControlQCOM(%" PRIu32 ")", driverControl); |
| |
| if (mImports.glEnableDriverControlQCOM == nullptr) { |
| GAPID_WARNING("Application called unsupported function glEnableDriverControlQCOM"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, driverControl] { |
| called = true; |
| observeReads(); |
| mImports.glEnableDriverControlQCOM(driverControl); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_QCOM_driver_control); |
| 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::GlEnableDriverControlQCOM coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(driverControl, 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::glEnableiNV(uint32_t target, GLuint index) { |
| GAPID_DEBUG("glEnableiNV(%u, %" PRIu32 ")", target, index); |
| |
| if (mImports.glEnableiNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glEnableiNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, index] { |
| called = true; |
| observeReads(); |
| mImports.glEnableiNV(target, index); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_viewport_array); |
| 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::GlEnableiNV 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::glEndQueryEXT(uint32_t target) { |
| GAPID_DEBUG("glEndQueryEXT(%u)", target); |
| |
| if (mImports.glEndQueryEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glEndQueryEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target] { |
| called = true; |
| observeReads(); |
| mImports.glEndQueryEXT(target); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension2(call, ExtensionId::GL_EXT_disjoint_timer_query, ExtensionId::GL_EXT_occlusion_query_boolean); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlEndQueryEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target); |
| 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::glFramebufferTexture2DMultisampleEXT(uint32_t target, uint32_t attachment, uint32_t textarget, TextureId texture, GLint level, GLsizei samples) { |
| GAPID_DEBUG("glFramebufferTexture2DMultisampleEXT(%u, %u, %u, %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, attachment, textarget, texture, level, samples); |
| |
| if (mImports.glFramebufferTexture2DMultisampleEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferTexture2DMultisampleEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, attachment, textarget, texture, level, samples] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_multisampled_render_to_texture); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlFramebufferTexture2DMultisampleEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, attachment, textarget, toEncoder< uint32_t >(texture, mScratch), toEncoder< int32_t >(level, mScratch), toEncoder< int32_t >(samples, 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::glFramebufferTexture3DOES(uint32_t target, uint32_t attachment, uint32_t textarget, TextureId texture, GLint level, GLint zoffset) { |
| GAPID_DEBUG("glFramebufferTexture3DOES(%u, %u, %u, %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, attachment, textarget, texture, level, zoffset); |
| |
| if (mImports.glFramebufferTexture3DOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferTexture3DOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, attachment, textarget, texture, level, zoffset] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_3D); |
| 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::GlFramebufferTexture3DOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, attachment, textarget, toEncoder< uint32_t >(texture, mScratch), toEncoder< int32_t >(level, mScratch), toEncoder< int32_t >(zoffset, 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::glGetFirstPerfQueryIdINTEL(GLuint* queryId) { |
| GAPID_DEBUG("glGetFirstPerfQueryIdINTEL(%p)", queryId); |
| |
| if (mImports.glGetFirstPerfQueryIdINTEL == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetFirstPerfQueryIdINTEL"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, queryId] { |
| called = true; |
| observeReads(); |
| mImports.glGetFirstPerfQueryIdINTEL(queryId); |
| }; |
| |
| |
| 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::GlGetFirstPerfQueryIdINTEL coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLuint__P >(queryId, 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::glGetObjectLabelEXT(uint32_t type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar* label) { |
| GAPID_DEBUG("glGetObjectLabelEXT(%u, %" PRIu32 ", %" PRId32 ", %p, %p)", type, object, bufSize, length, label); |
| |
| if (mImports.glGetObjectLabelEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetObjectLabelEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, type, object, bufSize, length, label] { |
| called = true; |
| observeReads(); |
| mImports.glGetObjectLabelEXT(type, object, bufSize, length, label); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_debug_label); |
| switch (type) { |
| case GLenum::GL_TEXTURE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER: // fall-through... |
| case GLenum::GL_RENDERBUFFER: // fall-through... |
| case GLenum::GL_BUFFER_OBJECT_EXT: // fall-through... |
| case GLenum::GL_SHADER_OBJECT_EXT: // fall-through... |
| case GLenum::GL_PROGRAM_OBJECT_EXT: // fall-through... |
| case GLenum::GL_VERTEX_ARRAY_OBJECT_EXT: // fall-through... |
| case GLenum::GL_QUERY_OBJECT_EXT: // fall-through... |
| case GLenum::GL_SAMPLER: // fall-through... |
| case GLenum::GL_TRANSFORM_FEEDBACK: // fall-through... |
| case GLenum::GL_PROGRAM_PIPELINE_OBJECT_EXT: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, type); |
| } |
| } |
| (void)object; |
| GLsizei l_writeString_62_buffer_size = bufSize; |
| GLsizei* l_writeString_62_buffer_bytes_written = length; |
| GLchar* l_writeString_62_buffer = label; |
| call(); |
| if (((l_writeString_62_buffer) != (nullptr)) && ((l_writeString_62_buffer_size) > ((GLsizei)(0L)))) { |
| GLsizei l_buffer_size2 = l_writeString_62_buffer_size; |
| if ((l_writeString_62_buffer_bytes_written) != (nullptr)) { |
| GLsizei l_length = (GLsizei)(slice(length, 0ULL, 1ULL)[0ULL]); |
| write(slice(l_writeString_62_buffer_bytes_written, 0ULL, 1ULL), 0ULL, l_length); |
| write(slice(l_writeString_62_buffer, (uint64_t)((GLsizei)(0L)), (uint64_t)((l_length) + ((GLsizei)(1L))))); |
| } else { |
| write(slice(l_writeString_62_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::GlGetObjectLabelEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), type, toEncoder< uint32_t >(object, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(length, mScratch), toEncoder< gapic::coder::gles::GLchar__P >(label, 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::glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString) { |
| GAPID_DEBUG("glGetPerfMonitorCounterStringAMD(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p, %p)", group, counter, bufSize, length, counterString); |
| |
| if (mImports.glGetPerfMonitorCounterStringAMD == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPerfMonitorCounterStringAMD"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, group, counter, bufSize, length, counterString] { |
| called = true; |
| observeReads(); |
| mImports.glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString); |
| }; |
| |
| |
| 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::GlGetPerfMonitorCounterStringAMD coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(group, mScratch), toEncoder< uint32_t >(counter, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(length, mScratch), toEncoder< gapic::coder::gles::GLchar__P >(counterString, 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::glGetPerfQueryIdByNameINTEL(GLchar* queryName, GLuint* queryId) { |
| GAPID_DEBUG("glGetPerfQueryIdByNameINTEL(%p, %p)", queryName, queryId); |
| |
| if (mImports.glGetPerfQueryIdByNameINTEL == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPerfQueryIdByNameINTEL"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, queryName, queryId] { |
| called = true; |
| observeReads(); |
| mImports.glGetPerfQueryIdByNameINTEL(queryName, queryId); |
| }; |
| |
| |
| 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::GlGetPerfQueryIdByNameINTEL coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLchar__P >(queryName, mScratch), toEncoder< gapic::coder::gles::GLuint__P >(queryId, 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::glGetProgramBinaryOES(ProgramId program, GLsizei buffer_size, GLsizei* bytes_written, uint32_t* binary_format, void* binary) { |
| GAPID_DEBUG("glGetProgramBinaryOES(%" PRIu32 ", %" PRId32 ", %p, %p, %p)", program, buffer_size, bytes_written, binary_format, binary); |
| |
| if (mImports.glGetProgramBinaryOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetProgramBinaryOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, buffer_size, bytes_written, binary_format, binary] { |
| called = true; |
| observeReads(); |
| mImports.glGetProgramBinaryOES(program, buffer_size, bytes_written, binary_format, binary); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_get_program_binary); |
| ProgramId l_GetProgramBinary_63_program = program; |
| GLsizei l_GetProgramBinary_63_bufSize = buffer_size; |
| GLsizei* l_GetProgramBinary_63_length = bytes_written; |
| uint32_t* l_GetProgramBinary_63_binaryFormat = binary_format; |
| void* l_GetProgramBinary_63_binary = binary; |
| (void)l_GetProgramBinary_63_program; |
| call(); |
| if ((l_GetProgramBinary_63_length) != (nullptr)) { |
| GLsizei l_l = (GLsizei)(slice(bytes_written, 0ULL, 1ULL)[0ULL]); |
| write(slice(l_GetProgramBinary_63_length, 0ULL, 1ULL), 0ULL, l_l); |
| write(slice(l_GetProgramBinary_63_binary, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_l))); |
| } else { |
| write(slice(l_GetProgramBinary_63_binary, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_GetProgramBinary_63_bufSize))); |
| } |
| write(slice(l_GetProgramBinary_63_binaryFormat, 0ULL, 1ULL), 0ULL, slice(binary_format, 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::GlGetProgramBinaryOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(buffer_size, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(bytes_written, mScratch), toEncoder< gapic::coder::gles::GLenum__P >(binary_format, mScratch), toEncoder< gapic::coder::gles::Void__P >(binary, 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::glGetQueryObjectui64vEXT(QueryId query, uint32_t parameter, GLuint64* value) { |
| GAPID_DEBUG("glGetQueryObjectui64vEXT(%" PRIu32 ", %u, %p)", query, parameter, value); |
| |
| if (mImports.glGetQueryObjectui64vEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetQueryObjectui64vEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, query, parameter, value] { |
| called = true; |
| observeReads(); |
| mImports.glGetQueryObjectui64vEXT(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::GlGetQueryObjectui64vEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(query, mScratch), parameter, toEncoder< gapic::coder::gles::GLuint64__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::glGetTexParameterIuivOES(uint32_t target, uint32_t pname, GLuint* params) { |
| GAPID_DEBUG("glGetTexParameterIuivOES(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glGetTexParameterIuivOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTexParameterIuivOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetTexParameterIuivOES(target, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_border_clamp); |
| call(); |
| subGetTexParameterIuiv(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::GlGetTexParameterIuivOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, 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); |
| |
| } |
| |
| GLboolean GlesSpy::glIsPointInStrokePathNV(GLuint path, GLfloat x, GLfloat y) { |
| GAPID_DEBUG("glIsPointInStrokePathNV(%" PRIu32 ", %f, %f)", path, x, y); |
| |
| if (mImports.glIsPointInStrokePathNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glIsPointInStrokePathNV"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, path, x, y] { |
| called = true; |
| observeReads(); |
| result = mImports.glIsPointInStrokePathNV(path, x, y); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| 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::GlIsPointInStrokePathNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< float >(x, mScratch), toEncoder< float >(y, 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::glMatrixLoadTranspose3x3fNV(uint32_t matrixMode, GLfloat* m) { |
| GAPID_DEBUG("glMatrixLoadTranspose3x3fNV(%u, %p)", matrixMode, m); |
| |
| if (mImports.glMatrixLoadTranspose3x3fNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMatrixLoadTranspose3x3fNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, matrixMode, m] { |
| called = true; |
| observeReads(); |
| mImports.glMatrixLoadTranspose3x3fNV(matrixMode, m); |
| }; |
| |
| |
| 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::GlMatrixLoadTranspose3x3fNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), matrixMode, 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::glMultiDrawArraysIndirectEXT(uint32_t mode, void* indirect, GLsizei drawcount, GLsizei stride) { |
| GAPID_DEBUG("glMultiDrawArraysIndirectEXT(%u, %p, %" PRId32 ", %" PRId32 ")", mode, indirect, drawcount, stride); |
| |
| if (mImports.glMultiDrawArraysIndirectEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMultiDrawArraysIndirectEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, indirect, drawcount, stride] { |
| called = true; |
| observeReads(); |
| mImports.glMultiDrawArraysIndirectEXT(mode, indirect, drawcount, stride); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_multi_draw_indirect); |
| 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::GlMultiDrawArraysIndirectEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< gapic::coder::gles::Void__CP >(indirect, mScratch), toEncoder< int32_t >(drawcount, mScratch), toEncoder< int32_t >(stride, 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::glNamedFramebufferSampleLocationsfvNV(FramebufferId framebuffer, GLuint start, GLsizei count, GLfloat* v) { |
| GAPID_DEBUG("glNamedFramebufferSampleLocationsfvNV(%" PRIu32 ", %" PRIu32 ", %" PRId32 ", %p)", framebuffer, start, count, v); |
| |
| if (mImports.glNamedFramebufferSampleLocationsfvNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glNamedFramebufferSampleLocationsfvNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, framebuffer, start, count, v] { |
| called = true; |
| observeReads(); |
| mImports.glNamedFramebufferSampleLocationsfvNV(framebuffer, start, count, v); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_sample_locations); |
| 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::GlNamedFramebufferSampleLocationsfvNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(framebuffer, mScratch), toEncoder< uint32_t >(start, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::GLfloat__CP >(v, 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); |
| |
| } |
| |
| uint32_t GlesSpy::glPathGlyphIndexRangeNV(uint32_t fontTarget, void* fontName, uint32_t fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount) { |
| GAPID_DEBUG("glPathGlyphIndexRangeNV(%u, %p, %u, %" PRIu32 ", %f, %" PRIu32 ")", fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount); |
| |
| if (mImports.glPathGlyphIndexRangeNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathGlyphIndexRangeNV"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount] { |
| called = true; |
| observeReads(); |
| result = mImports.glPathGlyphIndexRangeNV(fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| 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::GlPathGlyphIndexRangeNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), fontTarget, toEncoder< gapic::coder::gles::Void__CP >(fontName, mScratch), fontStyle, toEncoder< uint32_t >(pathParameterTemplate, mScratch), toEncoder< float >(emScale, mScratch), toEncoder< uint32_t >(baseAndCount, mScratch), result); |
| 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::glPathParameterfvNV(GLuint path, uint32_t pname, GLfloat* value) { |
| GAPID_DEBUG("glPathParameterfvNV(%" PRIu32 ", %u, %p)", path, pname, value); |
| |
| if (mImports.glPathParameterfvNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathParameterfvNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glPathParameterfvNV(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::GlPathParameterfvNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), pname, 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::glPathStringNV(GLuint path, uint32_t format, GLsizei length, void* pathString) { |
| GAPID_DEBUG("glPathStringNV(%" PRIu32 ", %u, %" PRId32 ", %p)", path, format, length, pathString); |
| |
| if (mImports.glPathStringNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathStringNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, format, length, pathString] { |
| called = true; |
| observeReads(); |
| mImports.glPathStringNV(path, format, length, pathString); |
| }; |
| |
| |
| 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::GlPathStringNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), format, toEncoder< int32_t >(length, mScratch), toEncoder< gapic::coder::gles::Void__CP >(pathString, 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::glProgramUniform1fEXT(ProgramId program, UniformLocation location, GLfloat v0) { |
| GAPID_DEBUG("glProgramUniform1fEXT(%" PRIu32 ", %" PRId32 ", %f)", program, location, v0); |
| |
| if (mImports.glProgramUniform1fEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform1fEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, v0] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform1fEXT(program, location, v0); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| subProgramUniform1f(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::GlProgramUniform1fEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< float >(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::glProgramUniform3uiEXT(ProgramId program, UniformLocation location, GLuint v0, GLuint v1, GLuint v2) { |
| GAPID_DEBUG("glProgramUniform3uiEXT(%" PRIu32 ", %" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, location, v0, v1, v2); |
| |
| if (mImports.glProgramUniform3uiEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform3uiEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, v0, v1, v2] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform3uiEXT(program, location, v0, v1, v2); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| subProgramUniform3ui(call, program, location, v0, v1, v2); |
| } 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::GlProgramUniform3uiEXT 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)); |
| 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::glProgramUniform4iEXT(ProgramId program, UniformLocation location, GLint v0, GLint v1, GLint v2, GLint v3) { |
| GAPID_DEBUG("glProgramUniform4iEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", program, location, v0, v1, v2, v3); |
| |
| if (mImports.glProgramUniform4iEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform4iEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, v0, v1, v2, v3] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform4iEXT(program, location, v0, v1, v2, v3); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| call(); |
| subProgramUniform4i(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::GlProgramUniform4iEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(v0, mScratch), toEncoder< int32_t >(v1, mScratch), toEncoder< int32_t >(v2, mScratch), toEncoder< int32_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::glProgramUniformMatrix4fvEXT(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) { |
| GAPID_DEBUG("glProgramUniformMatrix4fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value); |
| |
| if (mImports.glProgramUniformMatrix4fvEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix4fvEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix4fvEXT(program, location, count, transpose, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniformMatrix4fv(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::GlProgramUniformMatrix4fvEXT 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::glReadBufferIndexedEXT(uint32_t src, GLint index) { |
| GAPID_DEBUG("glReadBufferIndexedEXT(%u, %" PRId32 ")", src, index); |
| |
| if (mImports.glReadBufferIndexedEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glReadBufferIndexedEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, src, index] { |
| called = true; |
| observeReads(); |
| mImports.glReadBufferIndexedEXT(src, index); |
| }; |
| |
| |
| 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::GlReadBufferIndexedEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), src, toEncoder< int32_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::glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, uint32_t format, uint32_t type, GLsizei bufSize, void* data) { |
| GAPID_DEBUG("glReadnPixelsEXT(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %" PRId32 ", %p)", x, y, width, height, format, type, bufSize, data); |
| |
| if (mImports.glReadnPixelsEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glReadnPixelsEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, x, y, width, height, format, type, bufSize, data] { |
| called = true; |
| observeReads(); |
| mImports.glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_robustness); |
| call(); |
| subReadnPixels(call, x, y, width, height, format, type, bufSize, data); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlReadnPixelsEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, mScratch), toEncoder< int32_t >(y, mScratch), toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), format, type, toEncoder< int32_t >(bufSize, mScratch), 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::glReadnPixelsKHR(GLint x, GLint y, GLsizei width, GLsizei height, uint32_t format, uint32_t type, GLsizei bufSize, void* data) { |
| GAPID_DEBUG("glReadnPixelsKHR(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %" PRId32 ", %p)", x, y, width, height, format, type, bufSize, data); |
| |
| if (mImports.glReadnPixelsKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glReadnPixelsKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, x, y, width, height, format, type, bufSize, data] { |
| called = true; |
| observeReads(); |
| mImports.glReadnPixelsKHR(x, y, width, height, format, type, bufSize, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_robustness); |
| call(); |
| subReadnPixels(call, x, y, width, height, format, type, bufSize, data); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlReadnPixelsKHR coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, mScratch), toEncoder< int32_t >(y, mScratch), toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), format, type, toEncoder< int32_t >(bufSize, mScratch), 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::glRenderbufferStorageMultisampleAPPLE(uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glRenderbufferStorageMultisampleAPPLE(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height); |
| |
| if (mImports.glRenderbufferStorageMultisampleAPPLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleAPPLE"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, samples, internalformat, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glRenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_APPLE_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::GlRenderbufferStorageMultisampleAPPLE 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::glRenderbufferStorageMultisampleNV(uint32_t target, GLsizei samples, uint32_t internalformat, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glRenderbufferStorageMultisampleNV(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", target, samples, internalformat, width, height); |
| |
| if (mImports.glRenderbufferStorageMultisampleNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRenderbufferStorageMultisampleNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, samples, internalformat, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glRenderbufferStorageMultisampleNV(target, samples, internalformat, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_framebuffer_multisample); |
| 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::GlRenderbufferStorageMultisampleNV 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::glResolveMultisampleFramebufferAPPLE() { |
| GAPID_DEBUG("glResolveMultisampleFramebufferAPPLE()"); |
| |
| if (mImports.glResolveMultisampleFramebufferAPPLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glResolveMultisampleFramebufferAPPLE"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glResolveMultisampleFramebufferAPPLE(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_APPLE_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::GlResolveMultisampleFramebufferAPPLE 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::glSamplerParameterIivOES(SamplerId sampler, uint32_t pname, GLint* param) { |
| GAPID_DEBUG("glSamplerParameterIivOES(%" PRIu32 ", %u, %p)", sampler, pname, param); |
| |
| if (mImports.glSamplerParameterIivOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSamplerParameterIivOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sampler, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glSamplerParameterIivOES(sampler, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_border_clamp); |
| subSamplerParameterIiv(call, sampler, pname, param); |
| 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::GlSamplerParameterIivOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, mScratch), pname, toEncoder< gapic::coder::gles::GLint__CP >(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::glStencilThenCoverStrokePathInstancedNV(GLsizei numPaths, uint32_t pathNameType, void* paths, GLuint pathBase, GLint reference, GLuint mask, uint32_t coverMode, uint32_t transformType, GLfloat* transformValues) { |
| GAPID_DEBUG("glStencilThenCoverStrokePathInstancedNV(%" PRId32 ", %u, %p, %" PRIu32 ", %" PRId32 ", %" PRIu32 ", %u, %u, %p)", numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues); |
| |
| if (mImports.glStencilThenCoverStrokePathInstancedNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glStencilThenCoverStrokePathInstancedNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues] { |
| called = true; |
| observeReads(); |
| mImports.glStencilThenCoverStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase, reference, mask, 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::GlStencilThenCoverStrokePathInstancedNV 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), toEncoder< int32_t >(reference, mScratch), toEncoder< uint32_t >(mask, 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::glTexPageCommitmentEXT(uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) { |
| GAPID_DEBUG("glTexPageCommitmentEXT(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ")", target, level, xoffset, yoffset, zoffset, width, height, depth, commit); |
| |
| if (mImports.glTexPageCommitmentEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexPageCommitmentEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, commit] { |
| called = true; |
| observeReads(); |
| mImports.glTexPageCommitmentEXT(target, level, xoffset, yoffset, zoffset, width, height, depth, commit); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_sparse_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::GlTexPageCommitmentEXT 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), toEncoder< uint8_t >(commit, 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::glUniformHandleui64NV(UniformLocation location, GLuint64 value) { |
| GAPID_DEBUG("glUniformHandleui64NV(%" PRId32 ", %" PRIu64 ")", location, value); |
| |
| if (mImports.glUniformHandleui64NV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformHandleui64NV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value] { |
| called = true; |
| observeReads(); |
| mImports.glUniformHandleui64NV(location, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_bindless_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::GlUniformHandleui64NV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< uint64_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::glStencilOpSeparate(uint32_t face, uint32_t stencil_fail, uint32_t stencil_pass_depth_fail, uint32_t stencil_pass_depth_pass) { |
| GAPID_DEBUG("glStencilOpSeparate(%u, %u, %u, %u)", face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass); |
| |
| if (mImports.glStencilOpSeparate == nullptr) { |
| GAPID_WARNING("Application called unsupported function glStencilOpSeparate"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass] { |
| called = true; |
| observeReads(); |
| mImports.glStencilOpSeparate(face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| subStencilOpSeparate(call, face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlStencilOpSeparate coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), face, stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass); |
| 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::glBindFramebuffer(uint32_t target, FramebufferId framebuffer) { |
| GAPID_DEBUG("glBindFramebuffer(%u, %" PRIu32 ")", target, framebuffer); |
| |
| if (mImports.glBindFramebuffer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBindFramebuffer"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, framebuffer] { |
| called = true; |
| observeReads(); |
| mImports.glBindFramebuffer(target, framebuffer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_FRAMEBUFFER: { |
| break; |
| } |
| case GLenum::GL_DRAW_FRAMEBUFFER: // fall-through... |
| case GLenum::GL_READ_FRAMEBUFFER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| if (!(checkNotNull(l_ctx).mInstances.mFramebuffers.count(framebuffer) > 0)) { |
| checkNotNull(l_ctx).mInstances.mFramebuffers[framebuffer] = std::shared_ptr<Framebuffer>(new Framebuffer(GLenumToFramebufferAttachment(), GLintToGLenum(), 0, (GLint)(0L), (GLint)(0L), (GLint)(0L), (GLint)(0L), GLbooleanLabels::GL_FALSE, "")); |
| } |
| if ((target) == (GLenum::GL_FRAMEBUFFER)) { |
| checkNotNull(l_ctx).mBoundFramebuffers[GLenum::GL_READ_FRAMEBUFFER] = framebuffer; |
| checkNotNull(l_ctx).mBoundFramebuffers[GLenum::GL_DRAW_FRAMEBUFFER] = framebuffer; |
| } else { |
| checkNotNull(l_ctx).mBoundFramebuffers[target] = framebuffer; |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBindFramebuffer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(framebuffer, 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::glColorMaski(DrawBufferIndex index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) { |
| GAPID_DEBUG("glColorMaski(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", index, r, g, b, a); |
| |
| if (mImports.glColorMaski == nullptr) { |
| GAPID_WARNING("Application called unsupported function glColorMaski"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, r, g, b, a] { |
| called = true; |
| observeReads(); |
| mImports.glColorMaski(index, r, g, b, a); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subColorMaski(call, index, r, g, b, a); |
| 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::GlColorMaski coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), toEncoder< uint8_t >(r, mScratch), toEncoder< uint8_t >(g, mScratch), toEncoder< uint8_t >(b, mScratch), toEncoder< uint8_t >(a, 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::glGenFramebuffers(GLsizei count, FramebufferId* framebuffers) { |
| GAPID_DEBUG("glGenFramebuffers(%" PRId32 ", %p)", count, framebuffers); |
| |
| if (mImports.glGenFramebuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenFramebuffers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, framebuffers] { |
| called = true; |
| observeReads(); |
| mImports.glGenFramebuffers(count, framebuffers); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| subGlErrorInvalidValueIf(call, (count) < ((GLsizei)(0L))); |
| Slice<FramebufferId> l_f = slice(framebuffers, (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) { |
| FramebufferId l_id = (FramebufferId)(slice(framebuffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]); |
| checkNotNull(l_ctx).mInstances.mFramebuffers[l_id] = std::shared_ptr<Framebuffer>(new Framebuffer(GLenumToFramebufferAttachment(), GLintToGLenum(), 0, (GLint)(0L), (GLint)(0L), (GLint)(0L), (GLint)(0L), GLbooleanLabels::GL_FALSE, "")); |
| write(l_f, (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::GlGenFramebuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::FramebufferId__P >(framebuffers, 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::glGetFramebufferAttachmentParameteriv(uint32_t framebuffer_target, uint32_t attachment, uint32_t parameter, GLint* value) { |
| GAPID_DEBUG("glGetFramebufferAttachmentParameteriv(%u, %u, %u, %p)", framebuffer_target, attachment, parameter, value); |
| |
| if (mImports.glGetFramebufferAttachmentParameteriv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetFramebufferAttachmentParameteriv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, framebuffer_target, attachment, parameter, value] { |
| called = true; |
| observeReads(); |
| mImports.glGetFramebufferAttachmentParameteriv(framebuffer_target, attachment, parameter, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| switch (attachment) { |
| case GLenum::GL_COLOR_ATTACHMENT0: // fall-through... |
| case GLenum::GL_DEPTH_ATTACHMENT: // fall-through... |
| case GLenum::GL_STENCIL_ATTACHMENT: { |
| break; |
| } |
| case GLenum::GL_BACK: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT1: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT10: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT11: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT12: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT13: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT14: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT15: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT2: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT3: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT4: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT5: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT6: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT7: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT8: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT9: // fall-through... |
| case GLenum::GL_DEPTH: // fall-through... |
| case GLenum::GL_DEPTH_STENCIL_ATTACHMENT: // fall-through... |
| case GLenum::GL_STENCIL: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, attachment); |
| } |
| } |
| switch (parameter) { |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: { |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: // fall-through... |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| case GLenum::GL_FRAMEBUFFER_ATTACHMENT_LAYERED: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, parameter); |
| } |
| } |
| std::shared_ptr<Framebuffer> l_framebuffer = subGetBoundFramebufferOrErrorInvalidEnum(call, framebuffer_target); |
| FramebufferAttachment l_a = findOrZero(checkNotNull(l_framebuffer).mAttachments, attachment); |
| subGlErrorInvalidOperationIf(call, ((l_a.mObjectType) == (GLenum::GL_NONE)) && (((parameter) != (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)) && ((parameter) != (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)))); |
| call(); |
| write(slice(value, 0ULL, 1ULL), 0ULL, /* switch(parameter) */ |
| /* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE))) ? ((GLint)(l_a.mObjectType)) : |
| /* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME))) ? ((GLint)(l_a.mObjectName)) : |
| /* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL))) ? (l_a.mTextureLevel) : |
| /* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE))) ? ((GLint)(l_a.mTextureCubeMapFace)) : |
| /* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_LAYERED: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_LAYERED))) ? ((GLint)(l_a.mLayered)) : |
| /* case GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: */(((parameter) == (GLenum::GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER))) ? (l_a.mTextureLayer) : |
| /* default: */ 0); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetFramebufferAttachmentParameteriv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), framebuffer_target, attachment, parameter, toEncoder< gapic::coder::gles::GLint__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::glReadBuffer(uint32_t src) { |
| GAPID_DEBUG("glReadBuffer(%u)", src); |
| |
| if (mImports.glReadBuffer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glReadBuffer"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, src] { |
| called = true; |
| observeReads(); |
| mImports.glReadBuffer(src); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| switch (src) { |
| case GLenum::GL_BACK: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT0: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT1: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT10: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT11: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT12: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT13: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT14: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT15: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT2: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT3: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT4: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT5: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT6: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT7: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT8: // fall-through... |
| case GLenum::GL_COLOR_ATTACHMENT9: // fall-through... |
| case GLenum::GL_NONE: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, src); |
| } |
| } |
| std::shared_ptr<Framebuffer> l_framebuffer = subGetBoundFramebufferOrErrorInvalidEnum(call, GLenum::GL_READ_FRAMEBUFFER); |
| checkNotNull(l_framebuffer).mReadBuffer = src; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlReadBuffer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), src); |
| 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::glFlush() { |
| GAPID_DEBUG("glFlush()"); |
| |
| if (mImports.glFlush == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFlush"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glFlush(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| 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::GlFlush 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); |
| |
| } |
| |
| uint32_t GlesSpy::glGetGraphicsResetStatus() { |
| GAPID_DEBUG("glGetGraphicsResetStatus()"); |
| |
| if (mImports.glGetGraphicsResetStatus == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetGraphicsResetStatus"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result] { |
| called = true; |
| observeReads(); |
| result = mImports.glGetGraphicsResetStatus(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| call(); |
| uint32_t l_GetGraphicsResetStatus_69_result = 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::GlGetGraphicsResetStatus coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), result); |
| 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::glDeleteShader(ShaderId shader) { |
| GAPID_DEBUG("glDeleteShader(%" PRIu32 ")", shader); |
| |
| if (mImports.glDeleteShader == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeleteShader"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, shader] { |
| called = true; |
| observeReads(); |
| mImports.glDeleteShader(shader); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| if ((shader) != ((ShaderId)(0UL))) { |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckShader(call, l_ctx, shader); |
| if (checkNotNull(l_ctx).mInstances.mShaders.count(shader) > 0) { |
| std::shared_ptr<Shader> l_s = findOrZero(checkNotNull(l_ctx).mInstances.mShaders, shader); |
| checkNotNull(l_s).mDeletable = true; |
| checkNotNull(l_ctx).mInstances.mShaders.erase(shader); |
| } |
| } |
| 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::GlDeleteShader coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, 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::glGetAttachedShaders(ProgramId program, GLsizei buffer_length, GLsizei* shaders_length_written, ShaderId* shaders) { |
| GAPID_DEBUG("glGetAttachedShaders(%" PRIu32 ", %" PRId32 ", %p, %p)", program, buffer_length, shaders_length_written, shaders); |
| |
| if (mImports.glGetAttachedShaders == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetAttachedShaders"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, buffer_length, shaders_length_written, shaders] { |
| called = true; |
| observeReads(); |
| mImports.glGetAttachedShaders(program, buffer_length, shaders_length_written, shaders); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckProgram(call, l_ctx, program); |
| subGlErrorInvalidValueIf(call, (buffer_length) < ((GLsizei)(0L))); |
| std::shared_ptr<Program> l_p = findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, program); |
| int32_t l_min_73_a = (int32_t)(buffer_length); |
| int32_t l_min_73_b = int32_t((checkNotNull(l_p).mShaders.size())); |
| int32_t l_min_73_result = /* switch((l_min_73_a) < (l_min_73_b)) */ |
| /* case true: */((((l_min_73_a) < (l_min_73_b)) == (true))) ? (l_min_73_a) : |
| /* case false: */((((l_min_73_a) < (l_min_73_b)) == (false))) ? (l_min_73_b) : |
| /* default: */ 0; |
| int32_t l_l = l_min_73_result; |
| call(); |
| write(slice(shaders, (uint64_t)(0L), (uint64_t)(l_l))); |
| if ((shaders_length_written) != (nullptr)) { |
| write(slice(shaders_length_written, 0ULL, 1ULL), 0ULL, (GLsizei)(l_l)); |
| } |
| } 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::GlGetAttachedShaders coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(buffer_length, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(shaders_length_written, mScratch), toEncoder< gapic::coder::gles::ShaderId__P >(shaders, 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::glGetProgramInfoLog(ProgramId program, GLsizei buffer_length, GLsizei* string_length_written, GLchar* info) { |
| GAPID_DEBUG("glGetProgramInfoLog(%" PRIu32 ", %" PRId32 ", %p, %p)", program, buffer_length, string_length_written, info); |
| |
| if (mImports.glGetProgramInfoLog == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetProgramInfoLog"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, buffer_length, string_length_written, info] { |
| called = true; |
| observeReads(); |
| mImports.glGetProgramInfoLog(program, 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); |
| subCheckProgram(call, l_ctx, program); |
| subGlErrorInvalidValueIf(call, (buffer_length) < ((GLsizei)(0L))); |
| GLsizei l_writeString_75_buffer_size = buffer_length; |
| GLsizei* l_writeString_75_buffer_bytes_written = string_length_written; |
| GLchar* l_writeString_75_buffer = info; |
| call(); |
| if (((l_writeString_75_buffer) != (nullptr)) && ((l_writeString_75_buffer_size) > ((GLsizei)(0L)))) { |
| GLsizei l_buffer_size2 = l_writeString_75_buffer_size; |
| if ((l_writeString_75_buffer_bytes_written) != (nullptr)) { |
| GLsizei l_length = (GLsizei)(slice(string_length_written, 0ULL, 1ULL)[0ULL]); |
| write(slice(l_writeString_75_buffer_bytes_written, 0ULL, 1ULL), 0ULL, l_length); |
| write(slice(l_writeString_75_buffer, (uint64_t)((GLsizei)(0L)), (uint64_t)((l_length) + ((GLsizei)(1L))))); |
| } else { |
| write(slice(l_writeString_75_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::GlGetProgramInfoLog coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, 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::glGetShaderiv(ShaderId shader, uint32_t parameter, GLint* value) { |
| GAPID_DEBUG("glGetShaderiv(%" PRIu32 ", %u, %p)", shader, parameter, value); |
| |
| if (mImports.glGetShaderiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetShaderiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, shader, parameter, value] { |
| called = true; |
| observeReads(); |
| mImports.glGetShaderiv(shader, parameter, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| switch (parameter) { |
| case GLenum::GL_COMPILE_STATUS: // fall-through... |
| case GLenum::GL_DELETE_STATUS: // fall-through... |
| case GLenum::GL_INFO_LOG_LENGTH: // fall-through... |
| case GLenum::GL_SHADER_SOURCE_LENGTH: // fall-through... |
| case GLenum::GL_SHADER_TYPE: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, parameter); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckShader(call, l_ctx, shader); |
| std::shared_ptr<Shader> l_s = findOrZero(checkNotNull(l_ctx).mInstances.mShaders, shader); |
| call(); |
| write(slice(value, 0ULL, 1ULL), 0ULL, /* switch(parameter) */ |
| /* case GLenum::GL_SHADER_TYPE: */(((parameter) == (GLenum::GL_SHADER_TYPE))) ? ((GLint)(checkNotNull(l_s).mType)) : |
| /* case GLenum::GL_DELETE_STATUS: */(((parameter) == (GLenum::GL_DELETE_STATUS))) ? (/* switch(checkNotNull(l_s).mDeletable) */ |
| /* case true: */(((checkNotNull(l_s).mDeletable) == (true))) ? ((GLint)(1L)) : |
| /* case false: */(((checkNotNull(l_s).mDeletable) == (false))) ? ((GLint)(0L)) : |
| /* default: */ 0) : |
| /* case GLenum::GL_COMPILE_STATUS: */(((parameter) == (GLenum::GL_COMPILE_STATUS))) ? (/* switch(checkNotNull(l_s).mCompiled) */ |
| /* case true: */(((checkNotNull(l_s).mCompiled) == (true))) ? ((GLint)(1L)) : |
| /* case false: */(((checkNotNull(l_s).mCompiled) == (false))) ? ((GLint)(0L)) : |
| /* default: */ 0) : |
| /* case GLenum::GL_INFO_LOG_LENGTH: */(((parameter) == (GLenum::GL_INFO_LOG_LENGTH))) ? ((GLint)(int32_t((checkNotNull(l_s).mInfoLog.count())))) : |
| /* case GLenum::GL_SHADER_SOURCE_LENGTH: */(((parameter) == (GLenum::GL_SHADER_SOURCE_LENGTH))) ? ((GLint)(int32_t((checkNotNull(l_s).mSource.size())))) : |
| /* default: */ 0); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetShaderiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, mScratch), parameter, toEncoder< gapic::coder::gles::GLint__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::glGetnUniformfv(ProgramId program, UniformLocation location, GLsizei bufSize, GLfloat* values) { |
| GAPID_DEBUG("glGetnUniformfv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, values); |
| |
| if (mImports.glGetnUniformfv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetnUniformfv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, bufSize, values] { |
| called = true; |
| observeReads(); |
| mImports.glGetnUniformfv(program, location, bufSize, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| ProgramId l_GetnUniformfv_83_program = program; |
| UniformLocation l_GetnUniformfv_83_location = location; |
| GLsizei l_GetnUniformfv_83_bufSize = bufSize; |
| GLfloat* l_GetnUniformfv_83_values = values; |
| (void)l_GetnUniformfv_83_program; |
| (void)l_GetnUniformfv_83_location; |
| call(); |
| write(slice((char*)(l_GetnUniformfv_83_values), (uint64_t)((GLsizei)(0L)), (uint64_t)(l_GetnUniformfv_83_bufSize))); |
| } 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::GlGetnUniformfv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLfloat__P >(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::glGetnUniformuiv(ProgramId program, UniformLocation location, GLsizei bufSize, GLuint* values) { |
| GAPID_DEBUG("glGetnUniformuiv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, values); |
| |
| if (mImports.glGetnUniformuiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetnUniformuiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, bufSize, values] { |
| called = true; |
| observeReads(); |
| mImports.glGetnUniformuiv(program, location, bufSize, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| call(); |
| subGetnUniformuiv(call, program, location, bufSize, values); |
| } 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::GlGetnUniformuiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLuint__P >(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::glProgramParameteri(ProgramId program, uint32_t pname, GLint value) { |
| GAPID_DEBUG("glProgramParameteri(%" PRIu32 ", %u, %" PRId32 ")", program, pname, value); |
| |
| if (mImports.glProgramParameteri == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramParameteri"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramParameteri(program, pname, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subProgramParameteri(call, program, 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::GlProgramParameteri coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), 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::glProgramUniform2fv(ProgramId program, UniformLocation location, GLsizei count, GLfloat* values) { |
| GAPID_DEBUG("glProgramUniform2fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values); |
| |
| if (mImports.glProgramUniform2fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform2fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform2fv(program, location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniform2fv(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::GlProgramUniform2fv 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::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::glProgramUniform2uiv(ProgramId program, UniformLocation location, GLsizei count, GLuint* values) { |
| GAPID_DEBUG("glProgramUniform2uiv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values); |
| |
| if (mImports.glProgramUniform2uiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform2uiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform2uiv(program, location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniform2uiv(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::GlProgramUniform2uiv 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::glProgramUniform3iv(ProgramId program, UniformLocation location, GLsizei count, GLint* values) { |
| GAPID_DEBUG("glProgramUniform3iv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values); |
| |
| if (mImports.glProgramUniform3iv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform3iv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform3iv(program, location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniform3iv(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::GlProgramUniform3iv 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::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::glProgramUniformMatrix3fv(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glProgramUniformMatrix3fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values); |
| |
| if (mImports.glProgramUniformMatrix3fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix3fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix3fv(program, location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniformMatrix3fv(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::GlProgramUniformMatrix3fv 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::glUniform1i(UniformLocation location, GLint value) { |
| GAPID_DEBUG("glUniform1i(%" PRId32 ", %" PRId32 ")", location, value); |
| |
| if (mImports.glUniform1i == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform1i"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value] { |
| called = true; |
| observeReads(); |
| mImports.glUniform1i(location, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<GLint> l_v = make<GLint>(1ULL); |
| call(); |
| write(l_v, 0ULL, value); |
| UniformLocation l_Uniformv_86_location = location; |
| Slice<GLint> l_Uniformv_86_values = l_v; |
| uint32_t l_Uniformv_86_type = GLenum::GL_INT; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_86_location, l_Uniformv_86_values.as<uint8_t>(), l_Uniformv_86_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::GlUniform1i coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), 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::glUniform4f(UniformLocation location, GLfloat value0, GLfloat value1, GLfloat value2, GLfloat value3) { |
| GAPID_DEBUG("glUniform4f(%" PRId32 ", %f, %f, %f, %f)", location, value0, value1, value2, value3); |
| |
| if (mImports.glUniform4f == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform4f"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value0, value1, value2, value3] { |
| called = true; |
| observeReads(); |
| mImports.glUniform4f(location, value0, value1, value2, value3); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<Vec4f> l_v = make<Vec4f>(1ULL); |
| call(); |
| write(l_v, 0ULL, {value0, value1, value2, value3}); |
| UniformLocation l_Uniformv_102_location = location; |
| Slice<Vec4f> l_Uniformv_102_values = l_v; |
| uint32_t l_Uniformv_102_type = GLenum::GL_FLOAT_VEC4; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_102_location, l_Uniformv_102_values.as<uint8_t>(), l_Uniformv_102_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::GlUniform4f coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< float >(value0, mScratch), toEncoder< float >(value1, mScratch), toEncoder< float >(value2, mScratch), toEncoder< float >(value3, 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::glUniform4ui(UniformLocation location, GLuint value0, GLuint value1, GLuint value2, GLuint value3) { |
| GAPID_DEBUG("glUniform4ui(%" PRId32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", location, value0, value1, value2, value3); |
| |
| if (mImports.glUniform4ui == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform4ui"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value0, value1, value2, value3] { |
| called = true; |
| observeReads(); |
| mImports.glUniform4ui(location, value0, value1, value2, value3); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<Vec4u> l_v = make<Vec4u>(1ULL); |
| call(); |
| write(l_v, 0ULL, {value0, value1, value2, value3}); |
| UniformLocation l_Uniformv_106_location = location; |
| Slice<Vec4u> l_Uniformv_106_values = l_v; |
| uint32_t l_Uniformv_106_type = GLenum::GL_UNSIGNED_INT_VEC4; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_106_location, l_Uniformv_106_values.as<uint8_t>(), l_Uniformv_106_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::GlUniform4ui coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< uint32_t >(value0, mScratch), toEncoder< uint32_t >(value1, mScratch), toEncoder< uint32_t >(value2, mScratch), toEncoder< uint32_t >(value3, 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::glUniformBlockBinding(ProgramId program, UniformBlockId uniform_block_index, GLuint uniform_block_binding) { |
| GAPID_DEBUG("glUniformBlockBinding(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", program, uniform_block_index, uniform_block_binding); |
| |
| if (mImports.glUniformBlockBinding == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformBlockBinding"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, uniform_block_index, uniform_block_binding] { |
| called = true; |
| observeReads(); |
| mImports.glUniformBlockBinding(program, uniform_block_index, uniform_block_binding); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| 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::GlUniformBlockBinding coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< uint32_t >(uniform_block_index, mScratch), toEncoder< uint32_t >(uniform_block_binding, 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::glUniformMatrix3x4fv(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glUniformMatrix3x4fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values); |
| |
| if (mImports.glUniformMatrix3x4fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix3x4fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix3x4fv(location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subUniformMatrix3x4fv(call, 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::GlUniformMatrix3x4fv 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::glUniformMatrix4x3fv(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glUniformMatrix4x3fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values); |
| |
| if (mImports.glUniformMatrix4x3fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix4x3fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix4x3fv(location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subUniformMatrix4x3fv(call, 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::GlUniformMatrix4x3fv 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::glValidateProgram(ProgramId program) { |
| GAPID_DEBUG("glValidateProgram(%" PRIu32 ")", program); |
| |
| if (mImports.glValidateProgram == nullptr) { |
| GAPID_WARNING("Application called unsupported function glValidateProgram"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program] { |
| called = true; |
| observeReads(); |
| mImports.glValidateProgram(program); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckProgram(call, l_ctx, program); |
| 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::GlValidateProgram coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), 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::glFrontFace(uint32_t orientation) { |
| GAPID_DEBUG("glFrontFace(%u)", orientation); |
| |
| if (mImports.glFrontFace == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFrontFace"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, orientation] { |
| called = true; |
| observeReads(); |
| mImports.glFrontFace(orientation); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (orientation) { |
| case GLenum::GL_CCW: // fall-through... |
| case GLenum::GL_CW: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, orientation); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| checkNotNull(l_ctx).mRasterization.mFrontFace = orientation; |
| 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::GlFrontFace coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), orientation); |
| 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::glLineWidth(GLfloat width) { |
| GAPID_DEBUG("glLineWidth(%f)", width); |
| |
| if (mImports.glLineWidth == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLineWidth"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, width] { |
| called = true; |
| observeReads(); |
| mImports.glLineWidth(width); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subGlErrorInvalidValueIf(call, (width) <= ((GLfloat)(0.f))); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| checkNotNull(l_ctx).mRasterization.mLineWidth = width; |
| 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::GlLineWidth coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(width, 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::glGetBooleani_v(uint32_t param, GLuint index, GLboolean* values) { |
| GAPID_DEBUG("glGetBooleani_v(%u, %" PRIu32 ", %p)", param, index, values); |
| |
| if (mImports.glGetBooleani_v == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetBooleani_v"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, param, index, values] { |
| called = true; |
| observeReads(); |
| mImports.glGetBooleani_v(param, index, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subGetStateVariable_GLboolean(call, param, true, index, values); |
| } 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::GlGetBooleani_v coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< uint32_t >(index, mScratch), toEncoder< gapic::coder::gles::GLboolean__P >(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::glGetInteger64v(uint32_t param, GLint64* values) { |
| GAPID_DEBUG("glGetInteger64v(%u, %p)", param, values); |
| |
| if (mImports.glGetInteger64v == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetInteger64v"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, param, values] { |
| called = true; |
| observeReads(); |
| mImports.glGetInteger64v(param, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subGetInteger64v(call, param, values); |
| } 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::GlGetInteger64v coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< gapic::coder::gles::GLint64__P >(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); |
| |
| } |
| |
| GLsync GlesSpy::glFenceSync(uint32_t condition, uint32_t syncFlags) { |
| GAPID_DEBUG("glFenceSync(%u, %u)", condition, syncFlags); |
| |
| if (mImports.glFenceSync == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFenceSync"); |
| return nullptr; |
| } |
| |
| GLsync result = nullptr; |
| bool called = false; |
| auto call = [this, &called, &result, condition, syncFlags] { |
| called = true; |
| observeReads(); |
| result = mImports.glFenceSync(condition, syncFlags); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| uint32_t l_FenceSync_113_condition = condition; |
| uint32_t l_FenceSync_113_syncFlags = syncFlags; |
| subGlErrorInvalidEnumIf(call, (l_FenceSync_113_condition) != (GLenum::GL_SYNC_GPU_COMMANDS_COMPLETE)); |
| subGlErrorInvalidValueIf(call, (l_FenceSync_113_syncFlags) != ((uint32_t)(0L))); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| GLsync l_o = (GLsync)(result); |
| if ((l_o) != (nullptr)) { |
| checkNotNull(l_ctx).mInstances.mSyncObjects[l_o] = std::shared_ptr<SyncObject>(new SyncObject()); |
| } |
| GLsync l_FenceSync_113_result = l_o; |
| if (__builtin_expect(shouldComputeExpectedReturn(), false)) { |
| setExpectedReturn<GLsync>(l_FenceSync_113_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::GlFenceSync coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), condition, syncFlags, toEncoder< gapic::coder::gles::GLsync >(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::glWaitSync(GLsync sync, uint32_t syncFlags, GLuint64 timeout) { |
| GAPID_DEBUG("glWaitSync(%p, %u, %" PRIu64 ")", sync, syncFlags, timeout); |
| |
| if (mImports.glWaitSync == nullptr) { |
| GAPID_WARNING("Application called unsupported function glWaitSync"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sync, syncFlags, timeout] { |
| called = true; |
| observeReads(); |
| mImports.glWaitSync(sync, syncFlags, timeout); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subWaitSync(call, sync, syncFlags, timeout); |
| 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::GlWaitSync coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLsync >(sync, mScratch), syncFlags, toEncoder< uint64_t >(timeout, 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::glBindTexture(uint32_t target, TextureId texture) { |
| GAPID_DEBUG("glBindTexture(%u, %" PRIu32 ")", target, texture); |
| |
| if (mImports.glBindTexture == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBindTexture"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, texture] { |
| called = true; |
| observeReads(); |
| mImports.glBindTexture(target, texture); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| if (!(checkNotNull(l_ctx).mInstances.mTextures.count(texture) > 0)) { |
| if ((target) == (GLenum::GL_TEXTURE_EXTERNAL_OES)) { |
| checkNotNull(l_ctx).mInstances.mTextures[texture] = std::shared_ptr<Texture>(new Texture(texture, TextureKind::UNDEFINED, 0, 0, GLintToImage(), GLintToCubemapLevel(), GLenum::GL_RED, GLenum::GL_GREEN, GLenum::GL_BLUE, GLenum::GL_ALPHA, std::move(Vec4f{(GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f)}), GLenum::GL_LINEAR, GLenum::GL_LINEAR, GLenum::GL_CLAMP_TO_EDGE, GLenum::GL_CLAMP_TO_EDGE, GLenum::GL_REPEAT, (GLfloat)(-1000.f), (GLfloat)(1000.f), (GLint)(0L), (GLint)(1000L), GLenum::GL_DEPTH_COMPONENT, GLenum::GL_NONE, GLenum::GL_LEQUAL, GLbooleanLabels::GL_FALSE, (GLuint)(0UL), "", (GLfloat)(1.f))); |
| } else { |
| checkNotNull(l_ctx).mInstances.mTextures[texture] = std::shared_ptr<Texture>(new Texture(texture, TextureKind::UNDEFINED, 0, 0, GLintToImage(), GLintToCubemapLevel(), GLenum::GL_RED, GLenum::GL_GREEN, GLenum::GL_BLUE, GLenum::GL_ALPHA, std::move(Vec4f{(GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(0.f)}), GLenum::GL_NEAREST_MIPMAP_LINEAR, GLenum::GL_LINEAR, GLenum::GL_REPEAT, GLenum::GL_REPEAT, GLenum::GL_REPEAT, (GLfloat)(-1000.f), (GLfloat)(1000.f), (GLint)(0L), (GLint)(1000L), GLenum::GL_DEPTH_COMPONENT, GLenum::GL_NONE, GLenum::GL_LEQUAL, GLbooleanLabels::GL_FALSE, (GLuint)(0UL), "", (GLfloat)(1.f))); |
| } |
| } |
| std::shared_ptr<TextureUnit> l_tu = findOrZero(checkNotNull(l_ctx).mTextureUnits, checkNotNull(l_ctx).mActiveTextureUnit); |
| switch (target) { |
| case GLenum::GL_TEXTURE_2D: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| checkNotNull(l_tu).mBinding2d = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_EXTERNAL_OES: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| checkNotNull(l_tu).mBindingExternalOes = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_2D_ARRAY: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| checkNotNull(l_tu).mBinding2dArray = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_2D_MULTISAMPLE: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| checkNotNull(l_tu).mBinding2dMultisample = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_2D_MULTISAMPLE_ARRAY: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| checkNotNull(l_tu).mBinding2dMultisampleArray = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_3D: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| checkNotNull(l_tu).mBinding3d = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_BUFFER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| checkNotNull(l_tu).mBindingBuffer = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_CUBE_MAP: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| checkNotNull(l_tu).mBindingCubeMap = texture; |
| break; |
| } |
| case GLenum::GL_TEXTURE_CUBE_MAP_ARRAY: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| checkNotNull(l_tu).mBindingCubeMapArray = texture; |
| 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::GlBindTexture coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(texture, 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::glCompressedTexSubImage3D(uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, uint32_t format, GLsizei image_size, TexturePointer data) { |
| GAPID_DEBUG("glCompressedTexSubImage3D(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %" PRId32 ", %p)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data); |
| |
| if (mImports.glCompressedTexSubImage3D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCompressedTexSubImage3D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data] { |
| called = true; |
| observeReads(); |
| mImports.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subCompressedTexSubImage3D(call, target, level, xoffset, yoffset, zoffset, width, height, depth, format, image_size, data); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCompressedTexSubImage3D 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, toEncoder< int32_t >(image_size, mScratch), 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::glCopyTexSubImage3D(uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glCopyTexSubImage3D(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", target, level, xoffset, yoffset, zoffset, x, y, width, height); |
| |
| if (mImports.glCopyTexSubImage3D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCopyTexSubImage3D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, xoffset, yoffset, zoffset, x, y, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subCopyTexSubImage3D(call, target, level, xoffset, yoffset, zoffset, x, y, width, height); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCopyTexSubImage3D 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 >(x, mScratch), toEncoder< int32_t >(y, mScratch), 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::glDeleteSamplers(GLsizei count, SamplerId* samplers) { |
| GAPID_DEBUG("glDeleteSamplers(%" PRId32 ", %p)", count, samplers); |
| |
| if (mImports.glDeleteSamplers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeleteSamplers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, samplers] { |
| called = true; |
| observeReads(); |
| mImports.glDeleteSamplers(count, samplers); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<SamplerId> l_s = slice(samplers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) { |
| SamplerId l_id = read(l_s, (uint64_t)(l_i)); |
| if ((l_id) != ((SamplerId)(0UL))) { |
| checkNotNull(l_ctx).mInstances.mSamplers.erase(l_id); |
| } |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDeleteSamplers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::SamplerId__CP >(samplers, 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::glSamplerParameterIuiv(SamplerId sampler, uint32_t pname, GLuint* param) { |
| GAPID_DEBUG("glSamplerParameterIuiv(%" PRIu32 ", %u, %p)", sampler, pname, param); |
| |
| if (mImports.glSamplerParameterIuiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSamplerParameterIuiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sampler, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glSamplerParameterIuiv(sampler, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subSamplerParameterIuiv(call, sampler, pname, param); |
| 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::GlSamplerParameterIuiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(sampler, mScratch), pname, toEncoder< gapic::coder::gles::GLuint__CP >(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::glTexParameterf(uint32_t target, uint32_t parameter, GLfloat value) { |
| GAPID_DEBUG("glTexParameterf(%u, %u, %f)", target, parameter, value); |
| |
| if (mImports.glTexParameterf == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexParameterf"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, parameter, value] { |
| called = true; |
| observeReads(); |
| mImports.glTexParameterf(target, parameter, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subGlErrorInvalidEnumIf(call, (parameter) == (GLenum::GL_TEXTURE_BORDER_COLOR)); |
| Vec1f l_params = {value}; |
| uint32_t l_TexParameterv_124_target = target; |
| uint32_t l_TexParameterv_124_pname = parameter; |
| Vec1f l_TexParameterv_124_params = l_params; |
| subGlErrorInvalidEnumIf(call, (l_TexParameterv_124_target) == (GLenum::GL_TEXTURE_BUFFER)); |
| std::shared_ptr<Texture> l_t = subGetBoundTextureOrErrorInvalidEnum(call, l_TexParameterv_124_target); |
| switch (l_TexParameterv_124_pname) { |
| case GLenum::GL_TEXTURE_MAG_FILTER: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| uint32_t l_magFilter = (uint32_t)(l_TexParameterv_124_params[0ULL]); |
| switch (l_magFilter) { |
| case GLenum::GL_NEAREST: // fall-through... |
| case GLenum::GL_LINEAR: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, l_magFilter); |
| } |
| } |
| checkNotNull(l_t).mMagFilter = l_magFilter; |
| break; |
| } |
| case GLenum::GL_TEXTURE_MIN_FILTER: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| uint32_t l_minFilter = (uint32_t)(l_TexParameterv_124_params[0ULL]); |
| switch (l_minFilter) { |
| case GLenum::GL_NEAREST: // fall-through... |
| case GLenum::GL_LINEAR: // fall-through... |
| case GLenum::GL_NEAREST_MIPMAP_NEAREST: // fall-through... |
| case GLenum::GL_LINEAR_MIPMAP_NEAREST: // fall-through... |
| case GLenum::GL_NEAREST_MIPMAP_LINEAR: // fall-through... |
| case GLenum::GL_LINEAR_MIPMAP_LINEAR: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, l_minFilter); |
| } |
| } |
| checkNotNull(l_t).mMinFilter = l_minFilter; |
| break; |
| } |
| case GLenum::GL_TEXTURE_WRAP_S: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| uint32_t l__res_0 = subCheckWrapParam(call, (uint32_t)(l_TexParameterv_124_params[0ULL])); |
| checkNotNull(l_t).mWrapS = l__res_0; |
| break; |
| } |
| case GLenum::GL_TEXTURE_WRAP_T: { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| uint32_t l__res_0 = subCheckWrapParam(call, (uint32_t)(l_TexParameterv_124_params[0ULL])); |
| checkNotNull(l_t).mWrapT = l__res_0; |
| break; |
| } |
| case GLenum::GL_TEXTURE_BASE_LEVEL: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| GLint l_baseLevel = (GLint)(l_TexParameterv_124_params[0ULL]); |
| subGlErrorInvalidValueIf(call, (l_baseLevel) < ((GLint)(0L))); |
| checkNotNull(l_t).mBaseLevel = l_baseLevel; |
| break; |
| } |
| case GLenum::GL_TEXTURE_COMPARE_FUNC: { |
| checkNotNull(l_t).mCompareFunc = (uint32_t)(l_TexParameterv_124_params[0ULL]); |
| break; |
| } |
| case GLenum::GL_TEXTURE_COMPARE_MODE: { |
| checkNotNull(l_t).mCompareMode = (uint32_t)(l_TexParameterv_124_params[0ULL]); |
| break; |
| } |
| case GLenum::GL_TEXTURE_MAX_LEVEL: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| GLint l_maxLevel = (GLint)(l_TexParameterv_124_params[0ULL]); |
| subGlErrorInvalidValueIf(call, (l_maxLevel) < ((GLint)(0L))); |
| checkNotNull(l_t).mMaxLevel = l_maxLevel; |
| break; |
| } |
| case GLenum::GL_TEXTURE_MAX_LOD: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| checkNotNull(l_t).mMaxLod = l_TexParameterv_124_params[0ULL]; |
| break; |
| } |
| case GLenum::GL_TEXTURE_MIN_LOD: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| checkNotNull(l_t).mMinLod = l_TexParameterv_124_params[0ULL]; |
| break; |
| } |
| case GLenum::GL_TEXTURE_SWIZZLE_A: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| uint32_t l__res_0 = subCheckSwizzleParam(call, (uint32_t)(l_TexParameterv_124_params[0ULL])); |
| checkNotNull(l_t).mSwizzleA = l__res_0; |
| break; |
| } |
| case GLenum::GL_TEXTURE_SWIZZLE_B: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| uint32_t l__res_0 = subCheckSwizzleParam(call, (uint32_t)(l_TexParameterv_124_params[0ULL])); |
| checkNotNull(l_t).mSwizzleB = l__res_0; |
| break; |
| } |
| case GLenum::GL_TEXTURE_SWIZZLE_G: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| uint32_t l__res_0 = subCheckSwizzleParam(call, (uint32_t)(l_TexParameterv_124_params[0ULL])); |
| checkNotNull(l_t).mSwizzleG = l__res_0; |
| break; |
| } |
| case GLenum::GL_TEXTURE_SWIZZLE_R: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| uint32_t l__res_0 = subCheckSwizzleParam(call, (uint32_t)(l_TexParameterv_124_params[0ULL])); |
| checkNotNull(l_t).mSwizzleR = l__res_0; |
| break; |
| } |
| case GLenum::GL_TEXTURE_WRAP_R: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| checkNotNull(l_t).mWrapR = (uint32_t)(l_TexParameterv_124_params[0ULL]); |
| break; |
| } |
| case GLenum::GL_DEPTH_STENCIL_TEXTURE_MODE: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| checkNotNull(l_t).mDepthStencilTextureMode = (uint32_t)(l_TexParameterv_124_params[0ULL]); |
| break; |
| } |
| case GLenum::GL_TEXTURE_BORDER_COLOR: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| case GLenum::GL_TEXTURE_MAX_ANISOTROPY_EXT: { |
| subRequiresExtension(call, ExtensionId::GL_EXT_texture_filter_anisotropic); |
| checkNotNull(l_t).mMaxAnisotropy = l_TexParameterv_124_params[0ULL]; |
| break; |
| } |
| case GLenum::GL_TEXTURE_SRGB_DECODE_EXT: { |
| subRequiresExtension(call, ExtensionId::GL_EXT_texture_sRGB_decode); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, l_TexParameterv_124_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::GlTexParameterf coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, parameter, 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::glBindTransformFeedback(uint32_t target, TransformFeedbackId id) { |
| GAPID_DEBUG("glBindTransformFeedback(%u, %" PRIu32 ")", target, id); |
| |
| if (mImports.glBindTransformFeedback == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBindTransformFeedback"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, id] { |
| called = true; |
| observeReads(); |
| mImports.glBindTransformFeedback(target, id); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_TRANSFORM_FEEDBACK: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| if (!(checkNotNull(l_ctx).mInstances.mTransformFeedbacks.count(id) > 0)) { |
| checkNotNull(l_ctx).mInstances.mTransformFeedbacks[id] = std::shared_ptr<TransformFeedback>(new TransformFeedback(GLuintToBufferBinding(), GLbooleanLabels::GL_FALSE, GLbooleanLabels::GL_FALSE, "")); |
| } |
| checkNotNull(l_ctx).mBoundTransformFeedback = id; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlBindTransformFeedback coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(id, 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::glGenTransformFeedbacks(GLsizei n, TransformFeedbackId* ids) { |
| GAPID_DEBUG("glGenTransformFeedbacks(%" PRId32 ", %p)", n, ids); |
| |
| if (mImports.glGenTransformFeedbacks == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenTransformFeedbacks"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, ids] { |
| called = true; |
| observeReads(); |
| mImports.glGenTransformFeedbacks(n, ids); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<TransformFeedbackId> l_tfs = slice(ids, (uint64_t)((GLsizei)(0L)), (uint64_t)(n)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < n; ++l_i) { |
| TransformFeedbackId l_id = (TransformFeedbackId)(slice(ids, (uint64_t)((GLsizei)(0L)), (uint64_t)(n))[(uint64_t)(l_i)]); |
| checkNotNull(l_ctx).mInstances.mTransformFeedbacks[l_id] = std::shared_ptr<TransformFeedback>(new TransformFeedback(GLuintToBufferBinding(), GLbooleanLabels::GL_FALSE, GLbooleanLabels::GL_FALSE, "")); |
| write(l_tfs, (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::GlGenTransformFeedbacks coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< gapic::coder::gles::TransformFeedbackId__P >(ids, 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::glEnableVertexAttribArray(AttributeLocation location) { |
| GAPID_DEBUG("glEnableVertexAttribArray(%" PRIu32 ")", location); |
| |
| if (mImports.glEnableVertexAttribArray == nullptr) { |
| GAPID_WARNING("Application called unsupported function glEnableVertexAttribArray"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location] { |
| called = true; |
| observeReads(); |
| mImports.glEnableVertexAttribArray(location); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidValueIf(call, (location) >= (checkNotNull(l_ctx).mConstants.mMaxVertexAttribs)); |
| std::shared_ptr<VertexArray> l_vao = findOrZero(checkNotNull(l_ctx).mInstances.mVertexArrays, checkNotNull(l_ctx).mBoundVertexArray); |
| checkNotNull(findOrZero(checkNotNull(l_vao).mVertexAttributeArrays, location)).mEnabled = GLbooleanLabels::GL_TRUE; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlEnableVertexAttribArray coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, 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::glGetVertexAttribIiv(AttributeLocation index, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glGetVertexAttribIiv(%" PRIu32 ", %u, %p)", index, pname, params); |
| |
| if (mImports.glGetVertexAttribIiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetVertexAttribIiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetVertexAttribIiv(index, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (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::GlGetVertexAttribIiv 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::glVertexAttrib4fv(AttributeLocation location, GLfloat* value) { |
| GAPID_DEBUG("glVertexAttrib4fv(%" PRIu32 ", %p)", location, value); |
| |
| if (mImports.glVertexAttrib4fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttrib4fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttrib4fv(location, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<GLfloat> l_v = slice(value, 0ULL, 4ULL); |
| Vec4f l_vec = {read(l_v, 0ULL), read(l_v, 1ULL), read(l_v, 2ULL), read(l_v, 3ULL)}; |
| 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::GlVertexAttrib4fv 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::glVertexAttribIFormat(AttributeLocation index, GLint size, uint32_t type, GLuint relativeoffset) { |
| GAPID_DEBUG("glVertexAttribIFormat(%" PRIu32 ", %" PRId32 ", %u, %" PRIu32 ")", index, size, type, relativeoffset); |
| |
| if (mImports.glVertexAttribIFormat == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttribIFormat"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, size, type, relativeoffset] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttribIFormat(index, size, type, 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, (GLboolean)(0U), relativeoffset, true); |
| 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::GlVertexAttribIFormat coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), toEncoder< int32_t >(size, mScratch), type, 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::glVertexAttribIPointer(AttributeLocation location, GLint size, uint32_t type, GLsizei stride, VertexPointer data) { |
| GAPID_DEBUG("glVertexAttribIPointer(%" PRIu32 ", %" PRId32 ", %u, %" PRId32 ", %p)", location, size, type, stride, data); |
| |
| if (mImports.glVertexAttribIPointer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttribIPointer"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, size, type, stride, data] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttribIPointer(location, size, type, stride, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subVertexAttribPointer(call, l_ctx, location, size, type, (GLboolean)(0U), stride, data, true); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlVertexAttribIPointer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, mScratch), toEncoder< int32_t >(size, mScratch), type, toEncoder< int32_t >(stride, mScratch), toEncoder< gapic::coder::gles::VertexPointer >(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); |
| |
| } |
| |
| EGLBoolean GlesSpy::eglQueryContext(EGLDisplay display, EGLContext context, EGLint attribute, EGLint* value) { |
| GAPID_DEBUG("eglQueryContext(%p, %p, %d, %p)", display, context, attribute, value); |
| |
| if (mImports.eglQueryContext == nullptr) { |
| GAPID_WARNING("Application called unsupported function eglQueryContext"); |
| return 0; |
| } |
| |
| EGLBoolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, display, context, attribute, value] { |
| called = true; |
| observeReads(); |
| result = mImports.eglQueryContext(display, context, attribute, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| write(slice(value, 0ULL, 1ULL), 0ULL, slice(value, 0ULL, 1ULL)[0ULL]); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::EglQueryContext coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, mScratch), toEncoder< gapic::coder::gles::EGLContext >(context, mScratch), toEncoder< int >(attribute, mScratch), toEncoder< gapic::coder::gles::EGLint__P >(value, 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::glXSwapBuffers(void* display, GLXDrawable drawable) { |
| GAPID_DEBUG("glXSwapBuffers(%p, %p)", display, drawable); |
| |
| if (mImports.glXSwapBuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glXSwapBuffers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, display, drawable] { |
| called = true; |
| observeReads(); |
| mImports.glXSwapBuffers(display, drawable); |
| }; |
| |
| onPreEndOfFrame(); |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlXSwapBuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__P >(display, mScratch), toEncoder< gapic::coder::gles::GLXDrawable >(drawable, 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); |
| |
| } |
| |
| HGLRC GlesSpy::wglCreateContext(HDC hdc) { |
| GAPID_DEBUG("wglCreateContext(%p)", hdc); |
| |
| if (mImports.wglCreateContext == nullptr) { |
| GAPID_WARNING("Application called unsupported function wglCreateContext"); |
| return nullptr; |
| } |
| |
| HGLRC result = nullptr; |
| bool called = false; |
| auto call = [this, &called, &result, hdc] { |
| called = true; |
| observeReads(); |
| result = mImports.wglCreateContext(hdc); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| auto l_context = result; |
| std::shared_ptr<Context> l__res_0 = subCreateContext(call); |
| this->WGLContexts[l_context] = l__res_0; |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::WglCreateContext coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::HDC >(hdc, mScratch), toEncoder< gapic::coder::gles::HGLRC >(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::glAlphaFuncx(uint32_t func, GLfixed ref) { |
| GAPID_DEBUG("glAlphaFuncx(%u, %" PRId32 ")", func, ref); |
| |
| if (mImports.glAlphaFuncx == nullptr) { |
| GAPID_WARNING("Application called unsupported function glAlphaFuncx"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, func, ref] { |
| called = true; |
| observeReads(); |
| mImports.glAlphaFuncx(func, ref); |
| }; |
| |
| |
| 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::GlAlphaFuncx coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), func, toEncoder< int32_t >(ref, 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); |
| |
| } |
| |
| uint32_t GlesSpy::glCheckFramebufferStatusOES(uint32_t target) { |
| GAPID_DEBUG("glCheckFramebufferStatusOES(%u)", target); |
| |
| if (mImports.glCheckFramebufferStatusOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCheckFramebufferStatusOES"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, target] { |
| called = true; |
| observeReads(); |
| result = mImports.glCheckFramebufferStatusOES(target); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_framebuffer_object); |
| subErrorGLES10notSupported(call); |
| 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::GlCheckFramebufferStatusOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, result); |
| 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::glClearDepthx(GLfixed depth) { |
| GAPID_DEBUG("glClearDepthx(%" PRId32 ")", depth); |
| |
| if (mImports.glClearDepthx == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClearDepthx"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, depth] { |
| called = true; |
| observeReads(); |
| mImports.glClearDepthx(depth); |
| }; |
| |
| |
| 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::GlClearDepthx coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(depth, 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::glDepthRangex(GLfixed n, GLfixed f) { |
| GAPID_DEBUG("glDepthRangex(%" PRId32 ", %" PRId32 ")", n, f); |
| |
| if (mImports.glDepthRangex == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDepthRangex"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, f] { |
| called = true; |
| observeReads(); |
| mImports.glDepthRangex(n, f); |
| }; |
| |
| |
| 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::GlDepthRangex coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< int32_t >(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::glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) { |
| GAPID_DEBUG("glDrawTexxOES(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, z, width, height); |
| |
| if (mImports.glDrawTexxOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawTexxOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, x, y, z, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glDrawTexxOES(x, y, z, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_draw_texture); |
| 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::GlDrawTexxOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, mScratch), toEncoder< int32_t >(y, mScratch), toEncoder< int32_t >(z, mScratch), 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); |
| onPostDrawCall(); |
| |
| } |
| |
| void GlesSpy::glFramebufferRenderbufferOES(uint32_t target, uint32_t attachment, uint32_t renderbuffertarget, GLuint renderbuffer) { |
| GAPID_DEBUG("glFramebufferRenderbufferOES(%u, %u, %u, %" PRIu32 ")", target, attachment, renderbuffertarget, renderbuffer); |
| |
| if (mImports.glFramebufferRenderbufferOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferRenderbufferOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, attachment, renderbuffertarget, renderbuffer] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_framebuffer_object); |
| 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::GlFramebufferRenderbufferOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, attachment, renderbuffertarget, 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::glGetClipPlanef(uint32_t plane, GLfloat* equation) { |
| GAPID_DEBUG("glGetClipPlanef(%u, %p)", plane, equation); |
| |
| if (mImports.glGetClipPlanef == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetClipPlanef"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, plane, equation] { |
| called = true; |
| observeReads(); |
| mImports.glGetClipPlanef(plane, equation); |
| }; |
| |
| |
| 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::GlGetClipPlanef coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), plane, toEncoder< gapic::coder::gles::GLfloat__P >(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::glGetTexEnvxv(uint32_t target, uint32_t pname, GLfixed* params) { |
| GAPID_DEBUG("glGetTexEnvxv(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glGetTexEnvxv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTexEnvxv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetTexEnvxv(target, 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::GlGetTexEnvxv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, 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::glGetTexGenfvOES(uint32_t coord, uint32_t pname, GLfloat* params) { |
| GAPID_DEBUG("glGetTexGenfvOES(%u, %u, %p)", coord, pname, params); |
| |
| if (mImports.glGetTexGenfvOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTexGenfvOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, coord, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetTexGenfvOES(coord, pname, params); |
| }; |
| |
| |
| 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::GlGetTexGenfvOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), coord, pname, toEncoder< gapic::coder::gles::GLfloat__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::glLightf(uint32_t light, uint32_t pname, GLfloat param) { |
| GAPID_DEBUG("glLightf(%u, %u, %f)", light, pname, param); |
| |
| if (mImports.glLightf == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLightf"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, light, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glLightf(light, pname, param); |
| }; |
| |
| |
| 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::GlLightf coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), light, pname, toEncoder< float >(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::glLightxv(uint32_t light, uint32_t pname, GLfixed* params) { |
| GAPID_DEBUG("glLightxv(%u, %u, %p)", light, pname, params); |
| |
| if (mImports.glLightxv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLightxv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, light, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glLightxv(light, 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::GlLightxv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), light, pname, toEncoder< gapic::coder::gles::GLfixed__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::glLoadIdentity() { |
| GAPID_DEBUG("glLoadIdentity()"); |
| |
| if (mImports.glLoadIdentity == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLoadIdentity"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glLoadIdentity(); |
| }; |
| |
| |
| 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::GlLoadIdentity 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::glMatrixMode(uint32_t mode) { |
| GAPID_DEBUG("glMatrixMode(%u)", mode); |
| |
| if (mImports.glMatrixMode == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMatrixMode"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode] { |
| called = true; |
| observeReads(); |
| mImports.glMatrixMode(mode); |
| }; |
| |
| |
| 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::GlMatrixMode coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), 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::glOrthox(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f) { |
| GAPID_DEBUG("glOrthox(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", l, r, b, t, n, f); |
| |
| if (mImports.glOrthox == nullptr) { |
| GAPID_WARNING("Application called unsupported function glOrthox"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, l, r, b, t, n, f] { |
| called = true; |
| observeReads(); |
| mImports.glOrthox(l, r, b, t, n, f); |
| }; |
| |
| |
| 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::GlOrthox coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(l, mScratch), toEncoder< int32_t >(r, mScratch), toEncoder< int32_t >(b, mScratch), toEncoder< int32_t >(t, mScratch), toEncoder< int32_t >(n, mScratch), toEncoder< int32_t >(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::glPointSizexOES(GLfixed size) { |
| GAPID_DEBUG("glPointSizexOES(%" PRId32 ")", size); |
| |
| if (mImports.glPointSizexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPointSizexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, size] { |
| called = true; |
| observeReads(); |
| mImports.glPointSizexOES(size); |
| }; |
| |
| |
| 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::GlPointSizexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(size, 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::glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) { |
| GAPID_DEBUG("glRotatexOES(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", angle, x, y, z); |
| |
| if (mImports.glRotatexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRotatexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, angle, x, y, z] { |
| called = true; |
| observeReads(); |
| mImports.glRotatexOES(angle, x, y, z); |
| }; |
| |
| |
| 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::GlRotatexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(angle, mScratch), toEncoder< int32_t >(x, mScratch), toEncoder< int32_t >(y, mScratch), toEncoder< int32_t >(z, 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::glScalex(GLfixed x, GLfixed y, GLfixed z) { |
| GAPID_DEBUG("glScalex(%" PRId32 ", %" PRId32 ", %" PRId32 ")", x, y, z); |
| |
| if (mImports.glScalex == nullptr) { |
| GAPID_WARNING("Application called unsupported function glScalex"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, x, y, z] { |
| called = true; |
| observeReads(); |
| mImports.glScalex(x, y, z); |
| }; |
| |
| |
| 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::GlScalex coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(x, mScratch), toEncoder< int32_t >(y, mScratch), toEncoder< int32_t >(z, 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::glShadeModel(uint32_t mode) { |
| GAPID_DEBUG("glShadeModel(%u)", mode); |
| |
| if (mImports.glShadeModel == nullptr) { |
| GAPID_WARNING("Application called unsupported function glShadeModel"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode] { |
| called = true; |
| observeReads(); |
| mImports.glShadeModel(mode); |
| }; |
| |
| |
| 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::GlShadeModel coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), 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::glTexGenfOES(uint32_t coord, uint32_t pname, GLfloat param) { |
| GAPID_DEBUG("glTexGenfOES(%u, %u, %f)", coord, pname, param); |
| |
| if (mImports.glTexGenfOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexGenfOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, coord, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glTexGenfOES(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::GlTexGenfOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), coord, pname, toEncoder< float >(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::glTexParameterxv(uint32_t target, uint32_t pname, GLfixed* params) { |
| GAPID_DEBUG("glTexParameterxv(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glTexParameterxv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexParameterxv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glTexParameterxv(target, 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::GlTexParameterxv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLfixed__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::glTexCoordPointerBounds(GLint size, uint32_t type, GLsizei stride, void* pointer, GLsizei count) { |
| GAPID_DEBUG("glTexCoordPointerBounds(%" PRId32 ", %u, %" PRId32 ", %p, %" PRId32 ")", size, type, stride, pointer, count); |
| |
| if (mImports.glTexCoordPointerBounds == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexCoordPointerBounds"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, size, type, stride, pointer, count] { |
| called = true; |
| observeReads(); |
| mImports.glTexCoordPointerBounds(size, 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::GlTexCoordPointerBounds coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(size, mScratch), 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); |
| |
| } |
| |
| void GlesSpy::startTimer(uint8_t index) { |
| GAPID_DEBUG("startTimer(%" PRIu8 ")", index); |
| |
| bool called = false; |
| auto call = [this, &called, index] { |
| called = true; |
| observeReads(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::StartTimer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), index); |
| 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 |