| /* |
| * 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::glColorMaskiEXT(DrawBufferIndex index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) { |
| GAPID_DEBUG("glColorMaskiEXT(%" PRIu32 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ")", index, r, g, b, a); |
| |
| if (mImports.glColorMaskiEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glColorMaskiEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, r, g, b, a] { |
| called = true; |
| observeReads(); |
| mImports.glColorMaskiEXT(index, r, g, b, a); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_draw_buffers_indexed); |
| 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::GlColorMaskiEXT 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::glPrimitiveBoundingBoxEXT(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) { |
| GAPID_DEBUG("glPrimitiveBoundingBoxEXT(%f, %f, %f, %f, %f, %f, %f, %f)", minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); |
| |
| if (mImports.glPrimitiveBoundingBoxEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPrimitiveBoundingBoxEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, minX, minY, minZ, minW, maxX, maxY, maxZ, maxW] { |
| called = true; |
| observeReads(); |
| mImports.glPrimitiveBoundingBoxEXT(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_primitive_bounding_box); |
| 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::GlPrimitiveBoundingBoxEXT 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::glSamplerParameterIuivEXT(SamplerId sampler, uint32_t pname, GLuint* param) { |
| GAPID_DEBUG("glSamplerParameterIuivEXT(%" PRIu32 ", %u, %p)", sampler, pname, param); |
| |
| if (mImports.glSamplerParameterIuivEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSamplerParameterIuivEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sampler, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glSamplerParameterIuivEXT(sampler, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_texture_border_clamp); |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| 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::GlSamplerParameterIuivEXT 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::glDeleteQueries(GLsizei count, QueryId* queries) { |
| GAPID_DEBUG("glDeleteQueries(%" PRId32 ", %p)", count, queries); |
| |
| if (mImports.glDeleteQueries == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeleteQueries"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, queries] { |
| called = true; |
| observeReads(); |
| mImports.glDeleteQueries(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); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) { |
| QueryId l_id = read(l_q, (uint64_t)(l_i)); |
| if ((l_id) != ((QueryId)(0UL))) { |
| checkNotNull(l_ctx).mInstances.mQueries.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::GlDeleteQueries coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::QueryId__CP >(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::glBindBuffer(uint32_t target, BufferId buffer) { |
| GAPID_DEBUG("glBindBuffer(%u, %" PRIu32 ")", target, buffer); |
| |
| if (mImports.glBindBuffer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBindBuffer"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, buffer] { |
| called = true; |
| observeReads(); |
| mImports.glBindBuffer(target, buffer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_ARRAY_BUFFER: // fall-through... |
| case GLenum::GL_ELEMENT_ARRAY_BUFFER: { |
| break; |
| } |
| case GLenum::GL_COPY_READ_BUFFER: // fall-through... |
| case GLenum::GL_COPY_WRITE_BUFFER: // fall-through... |
| case GLenum::GL_PIXEL_PACK_BUFFER: // fall-through... |
| case GLenum::GL_PIXEL_UNPACK_BUFFER: // fall-through... |
| case GLenum::GL_TRANSFORM_FEEDBACK_BUFFER: // fall-through... |
| case GLenum::GL_UNIFORM_BUFFER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| case GLenum::GL_ATOMIC_COUNTER_BUFFER: // fall-through... |
| case GLenum::GL_DISPATCH_INDIRECT_BUFFER: // fall-through... |
| case GLenum::GL_DRAW_INDIRECT_BUFFER: // fall-through... |
| case GLenum::GL_SHADER_STORAGE_BUFFER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| break; |
| } |
| case GLenum::GL_TEXTURE_BUFFER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| if (!(checkNotNull(l_ctx).mInstances.mBuffers.count(buffer) > 0)) { |
| checkNotNull(l_ctx).mInstances.mBuffers[buffer] = std::shared_ptr<Buffer>(new Buffer(Slice<uint8_t>(), Slice<uint8_t>(), (GLsizeiptr)(0L), GLenum::GL_STATIC_DRAW, 0, GLbooleanLabels::GL_FALSE, nullptr, (GLintptr)(0L), (GLsizeiptr)(0L), "")); |
| } |
| checkNotNull(l_ctx).mBoundBuffers[target] = buffer; |
| 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::GlBindBuffer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< uint32_t >(buffer, 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::glGenBuffers(GLsizei count, BufferId* buffers) { |
| GAPID_DEBUG("glGenBuffers(%" PRId32 ", %p)", count, buffers); |
| |
| if (mImports.glGenBuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenBuffers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, buffers] { |
| called = true; |
| observeReads(); |
| mImports.glGenBuffers(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); |
| call(); |
| for (GLsizei l_i = (GLsizei)(0L); l_i < count; ++l_i) { |
| BufferId l_id = (BufferId)(slice(buffers, (uint64_t)((GLsizei)(0L)), (uint64_t)(count))[(uint64_t)(l_i)]); |
| checkNotNull(l_ctx).mInstances.mBuffers[l_id] = std::shared_ptr<Buffer>(new Buffer(Slice<uint8_t>(), Slice<uint8_t>(), (GLsizeiptr)(0L), GLenum::GL_STATIC_DRAW, 0, GLbooleanLabels::GL_FALSE, nullptr, (GLintptr)(0L), (GLsizeiptr)(0L), "")); |
| write(l_b, (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::GlGenBuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(count, mScratch), toEncoder< gapic::coder::gles::BufferId__P >(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::glMapBufferRange(uint32_t target, GLintptr offset, GLsizeiptr length, uint32_t access) { |
| GAPID_DEBUG("glMapBufferRange(%u, %" PRId32 ", %" PRId32 ", %u)", target, offset, length, access); |
| |
| if (mImports.glMapBufferRange == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMapBufferRange"); |
| return nullptr; |
| } |
| |
| void* result = nullptr; |
| bool called = false; |
| auto call = [this, &called, &result, target, offset, length, access] { |
| called = true; |
| observeReads(); |
| result = mImports.glMapBufferRange(target, offset, length, access); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| call(); |
| auto l_ptr = result; |
| subMapBufferRange(call, target, offset, length, access, (uint8_t*)(l_ptr)); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlMapBufferRange coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(offset, mScratch), toEncoder< int32_t >(length, mScratch), access, toEncoder< gapic::coder::gles::Void__P >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glDrawArraysInstanced(uint32_t draw_mode, GLint first_index, GLsizei indices_count, GLsizei instance_count) { |
| GAPID_DEBUG("glDrawArraysInstanced(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ")", draw_mode, first_index, indices_count, instance_count); |
| |
| if (mImports.glDrawArraysInstanced == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawArraysInstanced"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, draw_mode, first_index, indices_count, instance_count] { |
| called = true; |
| observeReads(); |
| mImports.glDrawArraysInstanced(draw_mode, first_index, indices_count, instance_count); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subDrawArraysInstanced(call, draw_mode, first_index, indices_count, instance_count); |
| 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::GlDrawArraysInstanced coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), draw_mode, toEncoder< int32_t >(first_index, mScratch), toEncoder< int32_t >(indices_count, mScratch), toEncoder< int32_t >(instance_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); |
| onPostDrawCall(); |
| |
| } |
| |
| void GlesSpy::glDrawRangeElementsBaseVertex(uint32_t draw_mode, GLuint start, GLuint end, GLsizei indices_count, uint32_t indices_type, IndicesPointer indices, GLint base_vertex) { |
| GAPID_DEBUG("glDrawRangeElementsBaseVertex(%u, %" PRIu32 ", %" PRIu32 ", %" PRId32 ", %u, %p, %" PRId32 ")", draw_mode, start, end, indices_count, indices_type, indices, base_vertex); |
| |
| if (mImports.glDrawRangeElementsBaseVertex == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawRangeElementsBaseVertex"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, draw_mode, start, end, indices_count, indices_type, indices, base_vertex] { |
| called = true; |
| observeReads(); |
| mImports.glDrawRangeElementsBaseVertex(draw_mode, start, end, indices_count, indices_type, indices, base_vertex); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| subDrawRangeElementsBaseVertex(call, draw_mode, start, end, indices_count, indices_type, indices, base_vertex); |
| 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::GlDrawRangeElementsBaseVertex 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), toEncoder< int32_t >(base_vertex, 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::glCompressedTexImage3DOES(uint32_t target, GLint level, uint32_t internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei image_size, TexturePointer data) { |
| GAPID_DEBUG("glCompressedTexImage3DOES(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %p)", target, level, internalformat, width, height, depth, border, image_size, data); |
| |
| if (mImports.glCompressedTexImage3DOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCompressedTexImage3DOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, internalformat, width, height, depth, border, image_size, data] { |
| called = true; |
| observeReads(); |
| mImports.glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, image_size, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_3D); |
| subCompressedTexImage3D(call, target, level, internalformat, width, height, depth, border, 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::GlCompressedTexImage3DOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, mScratch), internalformat, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(depth, mScratch), toEncoder< int32_t >(border, mScratch), 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::glDeleteFencesNV(GLsizei n, GLuint* fences) { |
| GAPID_DEBUG("glDeleteFencesNV(%" PRId32 ", %p)", n, fences); |
| |
| if (mImports.glDeleteFencesNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeleteFencesNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, fences] { |
| called = true; |
| observeReads(); |
| mImports.glDeleteFencesNV(n, fences); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_fence); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDeleteFencesNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< gapic::coder::gles::GLuint__CP >(fences, 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::glDeletePathsNV(GLuint path, GLsizei range) { |
| GAPID_DEBUG("glDeletePathsNV(%" PRIu32 ", %" PRId32 ")", path, range); |
| |
| if (mImports.glDeletePathsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeletePathsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, range] { |
| called = true; |
| observeReads(); |
| mImports.glDeletePathsNV(path, range); |
| }; |
| |
| |
| 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::GlDeletePathsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< int32_t >(range, 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::glDrawArraysInstancedNV(uint32_t mode, GLint first, GLsizei count, GLsizei primcount) { |
| GAPID_DEBUG("glDrawArraysInstancedNV(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ")", mode, first, count, primcount); |
| |
| if (mImports.glDrawArraysInstancedNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawArraysInstancedNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, first, count, primcount] { |
| called = true; |
| observeReads(); |
| mImports.glDrawArraysInstancedNV(mode, first, count, primcount); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_draw_instanced); |
| subDrawArraysInstanced(call, mode, first, count, primcount); |
| 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::GlDrawArraysInstancedNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< int32_t >(first, mScratch), toEncoder< int32_t >(count, mScratch), toEncoder< int32_t >(primcount, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| onPostDrawCall(); |
| |
| } |
| |
| void GlesSpy::glDrawBuffersNV(GLsizei n, uint32_t* bufs) { |
| GAPID_DEBUG("glDrawBuffersNV(%" PRId32 ", %p)", n, bufs); |
| |
| if (mImports.glDrawBuffersNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawBuffersNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, bufs] { |
| called = true; |
| observeReads(); |
| mImports.glDrawBuffersNV(n, bufs); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_draw_buffers); |
| subDrawBuffers(call, n, bufs); |
| 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::GlDrawBuffersNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< gapic::coder::gles::GLenum__CP >(bufs, 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::glDrawElementsBaseVertexOES(uint32_t mode, GLsizei count, uint32_t type, IndicesPointer indices, GLint basevertex) { |
| GAPID_DEBUG("glDrawElementsBaseVertexOES(%u, %" PRId32 ", %u, %p, %" PRId32 ")", mode, count, type, indices, basevertex); |
| |
| if (mImports.glDrawElementsBaseVertexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawElementsBaseVertexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, count, type, indices, basevertex] { |
| called = true; |
| observeReads(); |
| mImports.glDrawElementsBaseVertexOES(mode, count, type, indices, basevertex); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_draw_elements_base_vertex); |
| subDrawElementsBaseVertex(call, mode, 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::GlDrawElementsBaseVertexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, 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::glDrawElementsInstancedBaseInstanceEXT(uint32_t mode, GLsizei count, uint32_t type, void* indices, GLsizei instancecount, GLuint baseinstance) { |
| GAPID_DEBUG("glDrawElementsInstancedBaseInstanceEXT(%u, %" PRId32 ", %u, %p, %" PRId32 ", %" PRIu32 ")", mode, count, type, indices, instancecount, baseinstance); |
| |
| if (mImports.glDrawElementsInstancedBaseInstanceEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawElementsInstancedBaseInstanceEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode, count, type, indices, instancecount, baseinstance] { |
| called = true; |
| observeReads(); |
| mImports.glDrawElementsInstancedBaseInstanceEXT(mode, count, type, indices, 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::GlDrawElementsInstancedBaseInstanceEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mode, toEncoder< int32_t >(count, mScratch), type, toEncoder< gapic::coder::gles::Void__CP >(indices, 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::glExtGetFramebuffersQCOM(FramebufferId* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers) { |
| GAPID_DEBUG("glExtGetFramebuffersQCOM(%p, %" PRId32 ", %p)", framebuffers, maxFramebuffers, numFramebuffers); |
| |
| if (mImports.glExtGetFramebuffersQCOM == nullptr) { |
| GAPID_WARNING("Application called unsupported function glExtGetFramebuffersQCOM"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, framebuffers, maxFramebuffers, numFramebuffers] { |
| called = true; |
| observeReads(); |
| mImports.glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_QCOM_extended_get); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlExtGetFramebuffersQCOM coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::FramebufferId__P >(framebuffers, mScratch), toEncoder< int32_t >(maxFramebuffers, mScratch), toEncoder< gapic::coder::gles::GLint__P >(numFramebuffers, 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::glExtGetShadersQCOM(ShaderId* shaders, GLint maxShaders, GLint* numShaders) { |
| GAPID_DEBUG("glExtGetShadersQCOM(%p, %" PRId32 ", %p)", shaders, maxShaders, numShaders); |
| |
| if (mImports.glExtGetShadersQCOM == nullptr) { |
| GAPID_WARNING("Application called unsupported function glExtGetShadersQCOM"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, shaders, maxShaders, numShaders] { |
| called = true; |
| observeReads(); |
| mImports.glExtGetShadersQCOM(shaders, maxShaders, numShaders); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_QCOM_extended_get2); |
| 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::GlExtGetShadersQCOM coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::ShaderId__P >(shaders, mScratch), toEncoder< int32_t >(maxShaders, mScratch), toEncoder< gapic::coder::gles::GLint__P >(numShaders, 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::glExtGetTexSubImageQCOM(uint32_t target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, uint32_t format, uint32_t type, void* texels) { |
| GAPID_DEBUG("glExtGetTexSubImageQCOM(%u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %p)", target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels); |
| |
| if (mImports.glExtGetTexSubImageQCOM == nullptr) { |
| GAPID_WARNING("Application called unsupported function glExtGetTexSubImageQCOM"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels] { |
| called = true; |
| observeReads(); |
| mImports.glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_QCOM_extended_get); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlExtGetTexSubImageQCOM coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, mScratch), toEncoder< int32_t >(xoffset, mScratch), toEncoder< int32_t >(yoffset, mScratch), toEncoder< int32_t >(zoffset, mScratch), toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(depth, mScratch), format, type, toEncoder< gapic::coder::gles::Void__P >(texels, 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::glFragmentCoverageColorNV(GLuint color) { |
| GAPID_DEBUG("glFragmentCoverageColorNV(%" PRIu32 ")", color); |
| |
| if (mImports.glFragmentCoverageColorNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFragmentCoverageColorNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, color] { |
| called = true; |
| observeReads(); |
| mImports.glFragmentCoverageColorNV(color); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_fragment_coverage_to_color); |
| 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::GlFragmentCoverageColorNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(color, 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::glGenQueriesEXT(GLsizei count, QueryId* queries) { |
| GAPID_DEBUG("glGenQueriesEXT(%" PRId32 ", %p)", count, queries); |
| |
| if (mImports.glGenQueriesEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenQueriesEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, count, queries] { |
| called = true; |
| observeReads(); |
| mImports.glGenQueriesEXT(count, queries); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension2(call, ExtensionId::GL_EXT_disjoint_timer_query, ExtensionId::GL_EXT_occlusion_query_boolean); |
| 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::GlGenQueriesEXT 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); |
| |
| } |
| |
| uint32_t GlesSpy::glGetGraphicsResetStatusEXT() { |
| GAPID_DEBUG("glGetGraphicsResetStatusEXT()"); |
| |
| if (mImports.glGetGraphicsResetStatusEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetGraphicsResetStatusEXT"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result] { |
| called = true; |
| observeReads(); |
| result = mImports.glGetGraphicsResetStatusEXT(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_robustness); |
| 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::GlGetGraphicsResetStatusEXT 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; |
| } |
| |
| uint32_t GlesSpy::glGetGraphicsResetStatusKHR() { |
| GAPID_DEBUG("glGetGraphicsResetStatusKHR()"); |
| |
| if (mImports.glGetGraphicsResetStatusKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetGraphicsResetStatusKHR"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result] { |
| called = true; |
| observeReads(); |
| result = mImports.glGetGraphicsResetStatusKHR(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_robustness); |
| call(); |
| uint32_t l_GetGraphicsResetStatus_61_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::GlGetGraphicsResetStatusKHR 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::glGetPathParameterivNV(GLuint path, uint32_t pname, GLint* value) { |
| GAPID_DEBUG("glGetPathParameterivNV(%" PRIu32 ", %u, %p)", path, pname, value); |
| |
| if (mImports.glGetPathParameterivNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetPathParameterivNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glGetPathParameterivNV(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::GlGetPathParameterivNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), pname, 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::glGetTranslatedShaderSourceANGLE(ShaderId shader, GLsizei bufsize, GLsizei* length, GLchar* source) { |
| GAPID_DEBUG("glGetTranslatedShaderSourceANGLE(%" PRIu32 ", %" PRId32 ", %p, %p)", shader, bufsize, length, source); |
| |
| if (mImports.glGetTranslatedShaderSourceANGLE == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTranslatedShaderSourceANGLE"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, shader, bufsize, length, source] { |
| called = true; |
| observeReads(); |
| mImports.glGetTranslatedShaderSourceANGLE(shader, bufsize, length, source); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_ANGLE_translated_shader_source); |
| 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::GlGetTranslatedShaderSourceANGLE coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(shader, mScratch), toEncoder< int32_t >(bufsize, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(length, mScratch), toEncoder< gapic::coder::gles::GLchar__P >(source, 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::glGetnUniformfvEXT(ProgramId program, UniformLocation location, GLsizei bufSize, GLfloat* params) { |
| GAPID_DEBUG("glGetnUniformfvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, params); |
| |
| if (mImports.glGetnUniformfvEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetnUniformfvEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, bufSize, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetnUniformfvEXT(program, location, bufSize, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_robustness); |
| 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::GlGetnUniformfvEXT 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 >(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::glGetnUniformfvKHR(ProgramId program, UniformLocation location, GLsizei bufSize, GLfloat* params) { |
| GAPID_DEBUG("glGetnUniformfvKHR(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, params); |
| |
| if (mImports.glGetnUniformfvKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetnUniformfvKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, bufSize, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetnUniformfvKHR(program, location, bufSize, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_robustness); |
| ProgramId l_GetnUniformfv_65_program = program; |
| UniformLocation l_GetnUniformfv_65_location = location; |
| GLsizei l_GetnUniformfv_65_bufSize = bufSize; |
| GLfloat* l_GetnUniformfv_65_values = params; |
| (void)l_GetnUniformfv_65_program; |
| (void)l_GetnUniformfv_65_location; |
| call(); |
| write(slice((char*)(l_GetnUniformfv_65_values), (uint64_t)((GLsizei)(0L)), (uint64_t)(l_GetnUniformfv_65_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::GlGetnUniformfvKHR 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 >(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::glGetnUniformuivKHR(ProgramId program, UniformLocation location, GLsizei bufSize, GLuint* params) { |
| GAPID_DEBUG("glGetnUniformuivKHR(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, params); |
| |
| if (mImports.glGetnUniformuivKHR == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetnUniformuivKHR"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, bufSize, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetnUniformuivKHR(program, location, bufSize, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_KHR_robustness); |
| call(); |
| subGetnUniformuiv(call, program, location, bufSize, 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::GlGetnUniformuivKHR 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 >(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::glMakeImageHandleResidentNV(GLuint64 handle, uint32_t access) { |
| GAPID_DEBUG("glMakeImageHandleResidentNV(%" PRIu64 ", %u)", handle, access); |
| |
| if (mImports.glMakeImageHandleResidentNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMakeImageHandleResidentNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, handle, access] { |
| called = true; |
| observeReads(); |
| mImports.glMakeImageHandleResidentNV(handle, access); |
| }; |
| |
| |
| 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::GlMakeImageHandleResidentNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint64_t >(handle, mScratch), access); |
| 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::glMatrixMult3x3fNV(uint32_t matrixMode, GLfloat* m) { |
| GAPID_DEBUG("glMatrixMult3x3fNV(%u, %p)", matrixMode, m); |
| |
| if (mImports.glMatrixMult3x3fNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMatrixMult3x3fNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, matrixMode, m] { |
| called = true; |
| observeReads(); |
| mImports.glMatrixMult3x3fNV(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::GlMatrixMult3x3fNV 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::glPathCommandsNV(GLuint path, GLsizei numCommands, GLubyte* commands, GLsizei numCoords, uint32_t coordType, void* coords) { |
| GAPID_DEBUG("glPathCommandsNV(%" PRIu32 ", %" PRId32 ", %p, %" PRId32 ", %u, %p)", path, numCommands, commands, numCoords, coordType, coords); |
| |
| if (mImports.glPathCommandsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathCommandsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, numCommands, commands, numCoords, coordType, coords] { |
| called = true; |
| observeReads(); |
| mImports.glPathCommandsNV(path, numCommands, commands, numCoords, coordType, coords); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPathCommandsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< int32_t >(numCommands, mScratch), toEncoder< gapic::coder::gles::GLubyte__CP >(commands, mScratch), toEncoder< int32_t >(numCoords, mScratch), coordType, toEncoder< gapic::coder::gles::Void__CP >(coords, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPathCoordsNV(GLuint path, GLsizei numCoords, uint32_t coordType, void* coords) { |
| GAPID_DEBUG("glPathCoordsNV(%" PRIu32 ", %" PRId32 ", %u, %p)", path, numCoords, coordType, coords); |
| |
| if (mImports.glPathCoordsNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathCoordsNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, numCoords, coordType, coords] { |
| called = true; |
| observeReads(); |
| mImports.glPathCoordsNV(path, numCoords, coordType, coords); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPathCoordsNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< int32_t >(numCoords, mScratch), coordType, toEncoder< gapic::coder::gles::Void__CP >(coords, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPathCoverDepthFuncNV(uint32_t func) { |
| GAPID_DEBUG("glPathCoverDepthFuncNV(%u)", func); |
| |
| if (mImports.glPathCoverDepthFuncNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathCoverDepthFuncNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, func] { |
| called = true; |
| observeReads(); |
| mImports.glPathCoverDepthFuncNV(func); |
| }; |
| |
| |
| 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::GlPathCoverDepthFuncNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), func); |
| 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::glPathParameteriNV(GLuint path, uint32_t pname, GLint value) { |
| GAPID_DEBUG("glPathParameteriNV(%" PRIu32 ", %u, %" PRId32 ")", path, pname, value); |
| |
| if (mImports.glPathParameteriNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathParameteriNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glPathParameteriNV(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::GlPathParameteriNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, 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::glPathStencilDepthOffsetNV(GLfloat factor, GLfloat units) { |
| GAPID_DEBUG("glPathStencilDepthOffsetNV(%f, %f)", factor, units); |
| |
| if (mImports.glPathStencilDepthOffsetNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPathStencilDepthOffsetNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, factor, units] { |
| called = true; |
| observeReads(); |
| mImports.glPathStencilDepthOffsetNV(factor, units); |
| }; |
| |
| |
| 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::GlPathStencilDepthOffsetNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(factor, mScratch), toEncoder< float >(units, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPolygonModeNV(uint32_t face, uint32_t mode) { |
| GAPID_DEBUG("glPolygonModeNV(%u, %u)", face, mode); |
| |
| if (mImports.glPolygonModeNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPolygonModeNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, face, mode] { |
| called = true; |
| observeReads(); |
| mImports.glPolygonModeNV(face, mode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_polygon_mode); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlPolygonModeNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), face, 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::glProgramParameteriEXT(ProgramId program, uint32_t pname, GLint value) { |
| GAPID_DEBUG("glProgramParameteriEXT(%" PRIu32 ", %u, %" PRId32 ")", program, pname, value); |
| |
| if (mImports.glProgramParameteriEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramParameteriEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, pname, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramParameteriEXT(program, pname, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| 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::GlProgramParameteriEXT 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::glProgramUniform2fvEXT(ProgramId program, UniformLocation location, GLsizei count, GLfloat* value) { |
| GAPID_DEBUG("glProgramUniform2fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value); |
| |
| if (mImports.glProgramUniform2fvEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform2fvEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform2fvEXT(program, location, count, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniform2fv(call, program, location, count, 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::GlProgramUniform2fvEXT 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 >(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::glProgramUniform2uivEXT(ProgramId program, UniformLocation location, GLsizei count, GLuint* value) { |
| GAPID_DEBUG("glProgramUniform2uivEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value); |
| |
| if (mImports.glProgramUniform2uivEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform2uivEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform2uivEXT(program, location, count, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniform2uiv(call, program, location, count, 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::GlProgramUniform2uivEXT 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 >(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::glProgramUniform3ivEXT(ProgramId program, UniformLocation location, GLsizei count, GLint* value) { |
| GAPID_DEBUG("glProgramUniform3ivEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, value); |
| |
| if (mImports.glProgramUniform3ivEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform3ivEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform3ivEXT(program, location, count, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniform3iv(call, program, location, count, 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::GlProgramUniform3ivEXT 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 >(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::glProgramUniformMatrix3fvEXT(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) { |
| GAPID_DEBUG("glProgramUniformMatrix3fvEXT(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, value); |
| |
| if (mImports.glProgramUniformMatrix3fvEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix3fvEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, value] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix3fvEXT(program, location, count, transpose, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_separate_shader_objects); |
| subProgramUniformMatrix3fv(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::GlProgramUniformMatrix3fvEXT 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::glStencilThenCoverFillPathInstancedNV(GLsizei numPaths, uint32_t pathNameType, void* paths, GLuint pathBase, uint32_t fillMode, GLuint mask, uint32_t coverMode, uint32_t transformType, GLfloat* transformValues) { |
| GAPID_DEBUG("glStencilThenCoverFillPathInstancedNV(%" PRId32 ", %u, %p, %" PRIu32 ", %u, %" PRIu32 ", %u, %u, %p)", numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType, transformValues); |
| |
| if (mImports.glStencilThenCoverFillPathInstancedNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glStencilThenCoverFillPathInstancedNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType, transformValues] { |
| called = true; |
| observeReads(); |
| mImports.glStencilThenCoverFillPathInstancedNV(numPaths, pathNameType, paths, pathBase, fillMode, 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::GlStencilThenCoverFillPathInstancedNV 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), fillMode, 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::glStencilThenCoverStrokePathNV(GLuint path, GLint reference, GLuint mask, uint32_t coverMode) { |
| GAPID_DEBUG("glStencilThenCoverStrokePathNV(%" PRIu32 ", %" PRId32 ", %" PRIu32 ", %u)", path, reference, mask, coverMode); |
| |
| if (mImports.glStencilThenCoverStrokePathNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glStencilThenCoverStrokePathNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, path, reference, mask, coverMode] { |
| called = true; |
| observeReads(); |
| mImports.glStencilThenCoverStrokePathNV(path, reference, mask, coverMode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_path_rendering); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlStencilThenCoverStrokePathNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(path, mScratch), toEncoder< int32_t >(reference, mScratch), toEncoder< uint32_t >(mask, mScratch), coverMode); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| GLboolean GlesSpy::glTestFenceNV(GLuint fence) { |
| GAPID_DEBUG("glTestFenceNV(%" PRIu32 ")", fence); |
| |
| if (mImports.glTestFenceNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTestFenceNV"); |
| return 0; |
| } |
| |
| GLboolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, fence] { |
| called = true; |
| observeReads(); |
| result = mImports.glTestFenceNV(fence); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_fence); |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTestFenceNV coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(fence, mScratch), toEncoder< uint8_t >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glTexBufferRangeOES(uint32_t target, uint32_t internalformat, BufferId buffer, GLintptr offset, GLsizeiptr size) { |
| GAPID_DEBUG("glTexBufferRangeOES(%u, %u, %" PRIu32 ", %" PRId32 ", %" PRId32 ")", target, internalformat, buffer, offset, size); |
| |
| if (mImports.glTexBufferRangeOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexBufferRangeOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, internalformat, buffer, offset, size] { |
| called = true; |
| observeReads(); |
| mImports.glTexBufferRangeOES(target, internalformat, buffer, offset, size); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_buffer); |
| subTexBufferRange(call, target, internalformat, buffer, offset, size); |
| 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::GlTexBufferRangeOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, internalformat, toEncoder< uint32_t >(buffer, mScratch), toEncoder< int32_t >(offset, mScratch), 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::glTexParameterIivOES(uint32_t target, uint32_t pname, GLint* params) { |
| GAPID_DEBUG("glTexParameterIivOES(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glTexParameterIivOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexParameterIivOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glTexParameterIivOES(target, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_texture_border_clamp); |
| subTexParameterIiv(call, target, pname, params); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexParameterIivOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< gapic::coder::gles::GLint__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::glTextureStorage2DEXT(TextureId texture, uint32_t target, GLsizei levels, uint32_t format, GLsizei width, GLsizei height) { |
| GAPID_DEBUG("glTextureStorage2DEXT(%" PRIu32 ", %u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ")", texture, target, levels, format, width, height); |
| |
| if (mImports.glTextureStorage2DEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTextureStorage2DEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, texture, target, levels, format, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glTextureStorage2DEXT(texture, target, levels, format, width, height); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_texture_storage); |
| 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::GlTextureStorage2DEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, mScratch), target, toEncoder< int32_t >(levels, mScratch), format, 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::glTextureViewEXT(TextureId texture, uint32_t target, GLuint origtexture, uint32_t internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) { |
| GAPID_DEBUG("glTextureViewEXT(%" PRIu32 ", %u, %" PRIu32 ", %u, %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers); |
| |
| if (mImports.glTextureViewEXT == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTextureViewEXT"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers] { |
| called = true; |
| observeReads(); |
| mImports.glTextureViewEXT(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_EXT_texture_view); |
| 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::GlTextureViewEXT coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(texture, mScratch), target, toEncoder< uint32_t >(origtexture, mScratch), internalformat, toEncoder< uint32_t >(minlevel, mScratch), toEncoder< uint32_t >(numlevels, mScratch), toEncoder< uint32_t >(minlayer, mScratch), toEncoder< uint32_t >(numlayers, 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::glUniformMatrix2x4fvNV(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) { |
| GAPID_DEBUG("glUniformMatrix2x4fvNV(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, value); |
| |
| if (mImports.glUniformMatrix2x4fvNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix2x4fvNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, value] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix2x4fvNV(location, count, transpose, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_non_square_matrices); |
| subUniformMatrix2x4fv(call, 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::GlUniformMatrix2x4fvNV 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 >(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::glUniformMatrix4x2fvNV(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* value) { |
| GAPID_DEBUG("glUniformMatrix4x2fvNV(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, value); |
| |
| if (mImports.glUniformMatrix4x2fvNV == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix4x2fvNV"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, value] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix4x2fvNV(location, count, transpose, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_NV_non_square_matrices); |
| subUniformMatrix4x2fv(call, 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::GlUniformMatrix4x2fvNV 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 >(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); |
| |
| } |
| |
| uint32_t GlesSpy::glCheckFramebufferStatus(uint32_t target) { |
| GAPID_DEBUG("glCheckFramebufferStatus(%u)", target); |
| |
| if (mImports.glCheckFramebufferStatus == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCheckFramebufferStatus"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, target] { |
| called = true; |
| observeReads(); |
| result = mImports.glCheckFramebufferStatus(target); |
| }; |
| |
| |
| 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); |
| } |
| } |
| 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::GlCheckFramebufferStatus 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::glClear(uint32_t mask) { |
| GAPID_DEBUG("glClear(%u)", mask); |
| |
| if (mImports.glClear == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClear"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mask] { |
| called = true; |
| observeReads(); |
| mImports.glClear(mask); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subSupportsBits(call, mask, (GLbitfield::GL_COLOR_BUFFER_BIT) | ((GLbitfield::GL_DEPTH_BUFFER_BIT) | (GLbitfield::GL_STENCIL_BUFFER_BIT))); |
| if ((mask & GLbitfield::GL_COLOR_BUFFER_BIT) != 0) { |
| } |
| if ((mask & GLbitfield::GL_DEPTH_BUFFER_BIT) != 0) { |
| } |
| if ((mask & GLbitfield::GL_STENCIL_BUFFER_BIT) != 0) { |
| } |
| if ((mask & GLbitfield::GL_COLOR_BUFFER_BIT) != 0) { |
| } |
| 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::GlClear coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), mask); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glClearBufferuiv(uint32_t buffer, GLint drawbuffer, GLuint* value) { |
| GAPID_DEBUG("glClearBufferuiv(%u, %" PRId32 ", %p)", buffer, drawbuffer, value); |
| |
| if (mImports.glClearBufferuiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClearBufferuiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, buffer, drawbuffer, value] { |
| called = true; |
| observeReads(); |
| mImports.glClearBufferuiv(buffer, drawbuffer, value); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| switch (buffer) { |
| case GLenum::GL_COLOR: { |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidValueIf(call, (drawbuffer) >= (checkNotNull(l_ctx).mConstants.mMaxDrawBuffers)); |
| read(slice(value, 0ULL, 4ULL)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, buffer); |
| } |
| } |
| 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::GlClearBufferuiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), buffer, toEncoder< int32_t >(drawbuffer, mScratch), toEncoder< gapic::coder::gles::GLuint__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::glDrawBuffers(GLsizei n, uint32_t* bufs) { |
| GAPID_DEBUG("glDrawBuffers(%" PRId32 ", %p)", n, bufs); |
| |
| if (mImports.glDrawBuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawBuffers"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, bufs] { |
| called = true; |
| observeReads(); |
| mImports.glDrawBuffers(n, bufs); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subDrawBuffers(call, n, bufs); |
| 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::GlDrawBuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< gapic::coder::gles::GLenum__CP >(bufs, 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::glFramebufferRenderbuffer(uint32_t framebuffer_target, uint32_t framebuffer_attachment, uint32_t renderbuffer_target, RenderbufferId renderbuffer) { |
| GAPID_DEBUG("glFramebufferRenderbuffer(%u, %u, %u, %" PRIu32 ")", framebuffer_target, framebuffer_attachment, renderbuffer_target, renderbuffer); |
| |
| if (mImports.glFramebufferRenderbuffer == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferRenderbuffer"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, framebuffer_target, framebuffer_attachment, renderbuffer_target, renderbuffer] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferRenderbuffer(framebuffer_target, framebuffer_attachment, renderbuffer_target, renderbuffer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| switch (framebuffer_attachment) { |
| case GLenum::GL_COLOR_ATTACHMENT0: // fall-through... |
| case GLenum::GL_DEPTH_ATTACHMENT: // fall-through... |
| case GLenum::GL_STENCIL_ATTACHMENT: { |
| break; |
| } |
| 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_STENCIL_ATTACHMENT: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, framebuffer_attachment); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidEnumIf(call, (renderbuffer_target) != (GLenum::GL_RENDERBUFFER)); |
| subGlErrorInvalidOperationIf(call, ((renderbuffer) != ((RenderbufferId)(0UL))) && (!(checkNotNull(l_ctx).mInstances.mRenderbuffers.count(renderbuffer) > 0))); |
| FramebufferAttachment l_attachment = FramebufferAttachment(GLenum::GL_NONE, (GLuint)(0UL), (GLint)(0L), GLenum::GL_NONE, (GLint)(0L), GLbooleanLabels::GL_FALSE); |
| if ((renderbuffer) != ((RenderbufferId)(0UL))) { |
| l_attachment.mObjectType = GLenum::GL_RENDERBUFFER; |
| l_attachment.mObjectName = (GLuint)(renderbuffer); |
| } |
| subSetFramebufferAttachment(call, framebuffer_target, framebuffer_attachment, l_attachment); |
| 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::GlFramebufferRenderbuffer coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), framebuffer_target, framebuffer_attachment, renderbuffer_target, toEncoder< uint32_t >(renderbuffer, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, uint32_t format, uint32_t type, void* data) { |
| GAPID_DEBUG("glReadPixels(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %u, %u, %p)", x, y, width, height, format, type, data); |
| |
| if (mImports.glReadPixels == nullptr) { |
| GAPID_WARNING("Application called unsupported function glReadPixels"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, x, y, width, height, format, type, data] { |
| called = true; |
| observeReads(); |
| mImports.glReadPixels(x, y, width, height, format, type, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subCheckReadPixels(call, width, height, format, type); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| if (((findOrZero(checkNotNull(l_ctx).mBoundBuffers, GLenum::GL_PIXEL_PACK_BUFFER)) == ((BufferId)(0UL))) && ((data) != (nullptr))) { |
| uint32_t l_requiredSize = subImageSize(call, (uint32_t)(width), (uint32_t)(height), format, type); |
| write(slice(data, (uint64_t)(0UL), (uint64_t)(l_requiredSize))); |
| } |
| } 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::GlReadPixels 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< 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::glActiveShaderProgram(PipelineId pipeline, ProgramId program) { |
| GAPID_DEBUG("glActiveShaderProgram(%" PRIu32 ", %" PRIu32 ")", pipeline, program); |
| |
| if (mImports.glActiveShaderProgram == nullptr) { |
| GAPID_WARNING("Application called unsupported function glActiveShaderProgram"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pipeline, program] { |
| called = true; |
| observeReads(); |
| mImports.glActiveShaderProgram(pipeline, program); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| 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::GlActiveShaderProgram coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(pipeline, mScratch), 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); |
| |
| } |
| |
| ShaderId GlesSpy::glCreateShader(uint32_t type) { |
| GAPID_DEBUG("glCreateShader(%u)", type); |
| |
| if (mImports.glCreateShader == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCreateShader"); |
| return 0; |
| } |
| |
| ShaderId result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, type] { |
| called = true; |
| observeReads(); |
| result = mImports.glCreateShader(type); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| switch (type) { |
| case GLenum::GL_FRAGMENT_SHADER: // fall-through... |
| case GLenum::GL_VERTEX_SHADER: { |
| break; |
| } |
| case GLenum::GL_COMPUTE_SHADER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| break; |
| } |
| case GLenum::GL_GEOMETRY_SHADER: // fall-through... |
| case GLenum::GL_TESS_CONTROL_SHADER: // fall-through... |
| case GLenum::GL_TESS_EVALUATION_SHADER: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, type); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| call(); |
| auto l_id = result; |
| checkNotNull(l_ctx).mInstances.mShaders[l_id] = std::shared_ptr<Shader>(new Shader(Slice<uint8_t>(), false, false, Slice<GLchar>(), "", 0, "")); |
| std::shared_ptr<Shader> l_s = findOrZero(checkNotNull(l_ctx).mInstances.mShaders, l_id); |
| checkNotNull(l_s).mType = type; |
| 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::GlCreateShader coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), type, toEncoder< uint32_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::glDeleteProgram(ProgramId program) { |
| GAPID_DEBUG("glDeleteProgram(%" PRIu32 ")", program); |
| |
| if (mImports.glDeleteProgram == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDeleteProgram"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program] { |
| called = true; |
| observeReads(); |
| mImports.glDeleteProgram(program); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| if ((program) != ((ProgramId)(0UL))) { |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckProgram(call, l_ctx, program); |
| if ((checkNotNull(l_ctx).mBoundProgram) == (program)) { |
| checkNotNull(findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, program)).mDeleteStatus = true; |
| } else { |
| checkNotNull(l_ctx).mInstances.mPrograms.erase(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::GlDeleteProgram 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::glDispatchComputeIndirect(GLintptr indirect) { |
| GAPID_DEBUG("glDispatchComputeIndirect(%" PRId32 ")", indirect); |
| |
| if (mImports.glDispatchComputeIndirect == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDispatchComputeIndirect"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, indirect] { |
| called = true; |
| observeReads(); |
| mImports.glDispatchComputeIndirect(indirect); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| 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::GlDispatchComputeIndirect coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(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); |
| |
| } |
| |
| void GlesSpy::glGenProgramPipelines(GLsizei n, PipelineId* pipelines) { |
| GAPID_DEBUG("glGenProgramPipelines(%" PRId32 ", %p)", n, pipelines); |
| |
| if (mImports.glGenProgramPipelines == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGenProgramPipelines"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, pipelines] { |
| called = true; |
| observeReads(); |
| mImports.glGenProgramPipelines(n, pipelines); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| call(); |
| write(slice(pipelines, (uint64_t)((GLsizei)(0L)), (uint64_t)(n))); |
| } 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::GlGenProgramPipelines coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(n, mScratch), toEncoder< gapic::coder::gles::PipelineId__P >(pipelines, 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::glGetProgramBinary(ProgramId program, GLsizei bufSize, GLsizei* length, uint32_t* binaryFormat, void* binary) { |
| GAPID_DEBUG("glGetProgramBinary(%" PRIu32 ", %" PRId32 ", %p, %p, %p)", program, bufSize, length, binaryFormat, binary); |
| |
| if (mImports.glGetProgramBinary == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetProgramBinary"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, bufSize, length, binaryFormat, binary] { |
| called = true; |
| observeReads(); |
| mImports.glGetProgramBinary(program, bufSize, length, binaryFormat, binary); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| ProgramId l_GetProgramBinary_74_program = program; |
| GLsizei l_GetProgramBinary_74_bufSize = bufSize; |
| GLsizei* l_GetProgramBinary_74_length = length; |
| uint32_t* l_GetProgramBinary_74_binaryFormat = binaryFormat; |
| void* l_GetProgramBinary_74_binary = binary; |
| (void)l_GetProgramBinary_74_program; |
| call(); |
| if ((l_GetProgramBinary_74_length) != (nullptr)) { |
| GLsizei l_l = (GLsizei)(slice(length, 0ULL, 1ULL)[0ULL]); |
| write(slice(l_GetProgramBinary_74_length, 0ULL, 1ULL), 0ULL, l_l); |
| write(slice(l_GetProgramBinary_74_binary, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_l))); |
| } else { |
| write(slice(l_GetProgramBinary_74_binary, (uint64_t)((GLsizei)(0L)), (uint64_t)(l_GetProgramBinary_74_bufSize))); |
| } |
| write(slice(l_GetProgramBinary_74_binaryFormat, 0ULL, 1ULL), 0ULL, slice(binaryFormat, 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::GlGetProgramBinary coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(bufSize, mScratch), toEncoder< gapic::coder::gles::GLsizei__P >(length, mScratch), toEncoder< gapic::coder::gles::GLenum__P >(binaryFormat, 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::glGetnUniformiv(ProgramId program, UniformLocation location, GLsizei bufSize, GLint* values) { |
| GAPID_DEBUG("glGetnUniformiv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, bufSize, values); |
| |
| if (mImports.glGetnUniformiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetnUniformiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, bufSize, values] { |
| called = true; |
| observeReads(); |
| mImports.glGetnUniformiv(program, location, bufSize, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| call(); |
| subGetnUniformiv(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::GlGetnUniformiv 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::GLint__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::glProgramUniform1ui(ProgramId program, UniformLocation location, GLuint value0) { |
| GAPID_DEBUG("glProgramUniform1ui(%" PRIu32 ", %" PRId32 ", %" PRIu32 ")", program, location, value0); |
| |
| if (mImports.glProgramUniform1ui == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform1ui"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, value0] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform1ui(program, location, value0); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| call(); |
| subProgramUniform1ui(call, program, location, value0); |
| } 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::GlProgramUniform1ui coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(program, mScratch), toEncoder< int32_t >(location, mScratch), toEncoder< uint32_t >(value0, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glProgramUniform2iv(ProgramId program, UniformLocation location, GLsizei count, GLint* values) { |
| GAPID_DEBUG("glProgramUniform2iv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values); |
| |
| if (mImports.glProgramUniform2iv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform2iv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform2iv(program, location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniform2iv(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::GlProgramUniform2iv 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::glProgramUniform3fv(ProgramId program, UniformLocation location, GLsizei count, GLfloat* values) { |
| GAPID_DEBUG("glProgramUniform3fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %p)", program, location, count, values); |
| |
| if (mImports.glProgramUniform3fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniform3fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniform3fv(program, location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniform3fv(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::GlProgramUniform3fv 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::glProgramUniformMatrix2fv(ProgramId program, UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glProgramUniformMatrix2fv(%" PRIu32 ", %" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", program, location, count, transpose, values); |
| |
| if (mImports.glProgramUniformMatrix2fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glProgramUniformMatrix2fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glProgramUniformMatrix2fv(program, location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| subProgramUniformMatrix2fv(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::GlProgramUniformMatrix2fv 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::glReleaseShaderCompiler() { |
| GAPID_DEBUG("glReleaseShaderCompiler()"); |
| |
| if (mImports.glReleaseShaderCompiler == nullptr) { |
| GAPID_WARNING("Application called unsupported function glReleaseShaderCompiler"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glReleaseShaderCompiler(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (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::GlReleaseShaderCompiler 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::glUniform1uiv(UniformLocation location, GLsizei count, GLuint* values) { |
| GAPID_DEBUG("glUniform1uiv(%" PRId32 ", %" PRId32 ", %p)", location, count, values); |
| |
| if (mImports.glUniform1uiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform1uiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniform1uiv(location, count, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| Slice<GLuint> l_v = slice(values, (uint64_t)((GLsizei)(0L)), (uint64_t)(count)); |
| UniformLocation l_Uniformv_89_location = location; |
| Slice<GLuint> l_Uniformv_89_values = l_v; |
| uint32_t l_Uniformv_89_type = GLenum::GL_UNSIGNED_INT; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_89_location, l_Uniformv_89_values.as<uint8_t>(), l_Uniformv_89_type); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlUniform1uiv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), 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::glUniform2i(UniformLocation location, GLint value0, GLint value1) { |
| GAPID_DEBUG("glUniform2i(%" PRId32 ", %" PRId32 ", %" PRId32 ")", location, value0, value1); |
| |
| if (mImports.glUniform2i == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform2i"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value0, value1] { |
| called = true; |
| observeReads(); |
| mImports.glUniform2i(location, value0, value1); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<Vec2i> l_v = make<Vec2i>(1ULL); |
| call(); |
| write(l_v, 0ULL, {value0, value1}); |
| UniformLocation l_Uniformv_92_location = location; |
| Slice<Vec2i> l_Uniformv_92_values = l_v; |
| uint32_t l_Uniformv_92_type = GLenum::GL_INT_VEC2; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_92_location, l_Uniformv_92_values.as<uint8_t>(), l_Uniformv_92_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::GlUniform2i coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< int32_t >(value0, mScratch), toEncoder< int32_t >(value1, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUniform3f(UniformLocation location, GLfloat value0, GLfloat value1, GLfloat value2) { |
| GAPID_DEBUG("glUniform3f(%" PRId32 ", %f, %f, %f)", location, value0, value1, value2); |
| |
| if (mImports.glUniform3f == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniform3f"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value0, value1, value2] { |
| called = true; |
| observeReads(); |
| mImports.glUniform3f(location, value0, value1, value2); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| Slice<Vec3f> l_v = make<Vec3f>(1ULL); |
| call(); |
| write(l_v, 0ULL, {value0, value1, value2}); |
| UniformLocation l_Uniformv_96_location = location; |
| Slice<Vec3f> l_Uniformv_96_values = l_v; |
| uint32_t l_Uniformv_96_type = GLenum::GL_FLOAT_VEC3; |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subSetProgramUniform(call, checkNotNull(l_ctx).mBoundProgram, l_Uniformv_96_location, l_Uniformv_96_values.as<uint8_t>(), l_Uniformv_96_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::GlUniform3f coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int32_t >(location, mScratch), toEncoder< float >(value0, mScratch), toEncoder< float >(value1, mScratch), toEncoder< float >(value2, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glUniformMatrix2x4fv(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glUniformMatrix2x4fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values); |
| |
| if (mImports.glUniformMatrix2x4fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix2x4fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix2x4fv(location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subUniformMatrix2x4fv(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::GlUniformMatrix2x4fv 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::glUniformMatrix4x2fv(UniformLocation location, GLsizei count, GLboolean transpose, GLfloat* values) { |
| GAPID_DEBUG("glUniformMatrix4x2fv(%" PRId32 ", %" PRId32 ", %" PRIu8 ", %p)", location, count, transpose, values); |
| |
| if (mImports.glUniformMatrix4x2fv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUniformMatrix4x2fv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, count, transpose, values] { |
| called = true; |
| observeReads(); |
| mImports.glUniformMatrix4x2fv(location, count, transpose, values); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subUniformMatrix4x2fv(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::GlUniformMatrix4x2fv 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::glUseProgram(ProgramId program) { |
| GAPID_DEBUG("glUseProgram(%" PRIu32 ")", program); |
| |
| if (mImports.glUseProgram == nullptr) { |
| GAPID_WARNING("Application called unsupported function glUseProgram"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, program] { |
| called = true; |
| observeReads(); |
| mImports.glUseProgram(program); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| if ((program) != ((ProgramId)(0UL))) { |
| subCheckProgram(call, l_ctx, program); |
| } |
| if (((program) == ((ProgramId)(0UL))) || (checkNotNull(l_ctx).mInstances.mPrograms.count(program) > 0)) { |
| if (((checkNotNull(l_ctx).mBoundProgram) != ((ProgramId)(0UL))) && (((checkNotNull(l_ctx).mBoundProgram) != (program)) && (checkNotNull(findOrZero(checkNotNull(l_ctx).mInstances.mPrograms, checkNotNull(l_ctx).mBoundProgram)).mDeleteStatus))) { |
| checkNotNull(l_ctx).mInstances.mPrograms.erase(checkNotNull(l_ctx).mBoundProgram); |
| } |
| checkNotNull(l_ctx).mBoundProgram = 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::GlUseProgram 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::glCullFace(uint32_t mode) { |
| GAPID_DEBUG("glCullFace(%u)", mode); |
| |
| if (mImports.glCullFace == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCullFace"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, mode] { |
| called = true; |
| observeReads(); |
| mImports.glCullFace(mode); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (mode) { |
| case GLenum::GL_BACK: // fall-through... |
| case GLenum::GL_FRONT: // fall-through... |
| case GLenum::GL_FRONT_AND_BACK: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, mode); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| checkNotNull(l_ctx).mRasterization.mCullFaceMode = mode; |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlCullFace 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::glGetInternalformativ(uint32_t target, uint32_t internalformat, uint32_t pname, GLsizei bufSize, GLint* params) { |
| GAPID_DEBUG("glGetInternalformativ(%u, %u, %u, %" PRId32 ", %p)", target, internalformat, pname, bufSize, params); |
| |
| if (mImports.glGetInternalformativ == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetInternalformativ"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, internalformat, pname, bufSize, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetInternalformativ(target, internalformat, pname, bufSize, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_RENDERBUFFER: { |
| break; |
| } |
| case GLenum::GL_TEXTURE_2D_MULTISAMPLE: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(1L)); |
| break; |
| } |
| case GLenum::GL_TEXTURE_2D_MULTISAMPLE_ARRAY: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| switch (internalformat) { |
| case GLenum::GL_DEPTH24_STENCIL8: // fall-through... |
| case GLenum::GL_DEPTH32F_STENCIL8: // fall-through... |
| case GLenum::GL_DEPTH_COMPONENT16: // fall-through... |
| case GLenum::GL_DEPTH_COMPONENT24: // fall-through... |
| case GLenum::GL_DEPTH_COMPONENT32F: // fall-through... |
| case GLenum::GL_R11F_G11F_B10F: // fall-through... |
| case GLenum::GL_R16F: // fall-through... |
| case GLenum::GL_R16I: // fall-through... |
| case GLenum::GL_R16UI: // fall-through... |
| case GLenum::GL_R32F: // fall-through... |
| case GLenum::GL_R32I: // fall-through... |
| case GLenum::GL_R32UI: // fall-through... |
| case GLenum::GL_R8: // fall-through... |
| case GLenum::GL_R8I: // fall-through... |
| case GLenum::GL_R8UI: // fall-through... |
| case GLenum::GL_R8_SNORM: // fall-through... |
| case GLenum::GL_RG16F: // fall-through... |
| case GLenum::GL_RG16I: // fall-through... |
| case GLenum::GL_RG16UI: // fall-through... |
| case GLenum::GL_RG32F: // fall-through... |
| case GLenum::GL_RG32I: // fall-through... |
| case GLenum::GL_RG32UI: // fall-through... |
| case GLenum::GL_RG8: // fall-through... |
| case GLenum::GL_RG8I: // fall-through... |
| case GLenum::GL_RG8UI: // fall-through... |
| case GLenum::GL_RG8_SNORM: // fall-through... |
| case GLenum::GL_RGB10_A2: // fall-through... |
| case GLenum::GL_RGB10_A2UI: // fall-through... |
| case GLenum::GL_RGB16F: // fall-through... |
| case GLenum::GL_RGB16I: // fall-through... |
| case GLenum::GL_RGB16UI: // fall-through... |
| case GLenum::GL_RGB32F: // fall-through... |
| case GLenum::GL_RGB32I: // fall-through... |
| case GLenum::GL_RGB32UI: // fall-through... |
| case GLenum::GL_RGB565: // fall-through... |
| case GLenum::GL_RGB5_A1: // fall-through... |
| case GLenum::GL_RGB8: // fall-through... |
| case GLenum::GL_RGB8I: // fall-through... |
| case GLenum::GL_RGB8UI: // fall-through... |
| case GLenum::GL_RGB8_SNORM: // fall-through... |
| case GLenum::GL_RGB9_E5: // fall-through... |
| case GLenum::GL_RGBA16F: // fall-through... |
| case GLenum::GL_RGBA16I: // fall-through... |
| case GLenum::GL_RGBA16UI: // fall-through... |
| case GLenum::GL_RGBA32F: // fall-through... |
| case GLenum::GL_RGBA32I: // fall-through... |
| case GLenum::GL_RGBA32UI: // fall-through... |
| case GLenum::GL_RGBA4: // fall-through... |
| case GLenum::GL_RGBA8: // fall-through... |
| case GLenum::GL_RGBA8I: // fall-through... |
| case GLenum::GL_RGBA8UI: // fall-through... |
| case GLenum::GL_RGBA8_SNORM: // fall-through... |
| case GLenum::GL_SRGB8: // fall-through... |
| case GLenum::GL_SRGB8_ALPHA8: { |
| break; |
| } |
| case GLenum::GL_STENCIL_INDEX8: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, internalformat); |
| } |
| } |
| switch (pname) { |
| case GLenum::GL_NUM_SAMPLE_COUNTS: // fall-through... |
| case GLenum::GL_SAMPLES: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, pname); |
| } |
| } |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetInternalformativ coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, internalformat, pname, toEncoder< int32_t >(bufSize, mScratch), 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); |
| |
| } |
| |
| GLubyte* GlesSpy::glGetString(uint32_t param) { |
| GAPID_DEBUG("glGetString(%u)", param); |
| |
| if (mImports.glGetString == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetString"); |
| return nullptr; |
| } |
| |
| GLubyte* result = nullptr; |
| bool called = false; |
| auto call = [this, &called, &result, param] { |
| called = true; |
| observeReads(); |
| result = mImports.glGetString(param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (param) { |
| case GLenum::GL_EXTENSIONS: // fall-through... |
| case GLenum::GL_RENDERER: // fall-through... |
| case GLenum::GL_SHADING_LANGUAGE_VERSION: // fall-through... |
| case GLenum::GL_VENDOR: // fall-through... |
| case GLenum::GL_VERSION: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, param); |
| } |
| } |
| 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::GlGetString coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), param, toEncoder< gapic::coder::gles::GLubyte__CP >(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; |
| } |
| |
| uint32_t GlesSpy::glClientWaitSync(GLsync sync, uint32_t syncFlags, GLuint64 timeout) { |
| GAPID_DEBUG("glClientWaitSync(%p, %u, %" PRIu64 ")", sync, syncFlags, timeout); |
| |
| if (mImports.glClientWaitSync == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClientWaitSync"); |
| return 0; |
| } |
| |
| uint32_t result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, sync, syncFlags, timeout] { |
| called = true; |
| observeReads(); |
| result = mImports.glClientWaitSync(sync, syncFlags, timeout); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| GLsync l_ClientWaitSync_112_sync = sync; |
| uint32_t l_ClientWaitSync_112_syncFlags = syncFlags; |
| GLuint64 l_ClientWaitSync_112_timeout = timeout; |
| subSupportsBits(call, l_ClientWaitSync_112_syncFlags, GLbitfield::GL_SYNC_FLUSH_COMMANDS_BIT); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidValueIf(call, !(checkNotNull(l_ctx).mInstances.mSyncObjects.count(l_ClientWaitSync_112_sync) > 0)); |
| if ((l_ClientWaitSync_112_syncFlags & GLbitfield::GL_SYNC_FLUSH_COMMANDS_BIT) != 0) { |
| } |
| (void)l_ClientWaitSync_112_timeout; |
| call(); |
| uint32_t l_ClientWaitSync_112_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::GlClientWaitSync coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLsync >(sync, mScratch), syncFlags, toEncoder< uint64_t >(timeout, 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::glActiveTexture(uint32_t unit) { |
| GAPID_DEBUG("glActiveTexture(%u)", unit); |
| |
| if (mImports.glActiveTexture == nullptr) { |
| GAPID_WARNING("Application called unsupported function glActiveTexture"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, unit] { |
| called = true; |
| observeReads(); |
| mImports.glActiveTexture(unit); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| GLint l_index = ((GLint)(unit)) - ((GLint)(GLenum::GL_TEXTURE0)); |
| switch (unit) { |
| case GLenum::GL_TEXTURE0: // fall-through... |
| case GLenum::GL_TEXTURE1: // fall-through... |
| case GLenum::GL_TEXTURE10: // fall-through... |
| case GLenum::GL_TEXTURE11: // fall-through... |
| case GLenum::GL_TEXTURE12: // fall-through... |
| case GLenum::GL_TEXTURE13: // fall-through... |
| case GLenum::GL_TEXTURE14: // fall-through... |
| case GLenum::GL_TEXTURE15: // fall-through... |
| case GLenum::GL_TEXTURE16: // fall-through... |
| case GLenum::GL_TEXTURE17: // fall-through... |
| case GLenum::GL_TEXTURE18: // fall-through... |
| case GLenum::GL_TEXTURE19: // fall-through... |
| case GLenum::GL_TEXTURE2: // fall-through... |
| case GLenum::GL_TEXTURE20: // fall-through... |
| case GLenum::GL_TEXTURE21: // fall-through... |
| case GLenum::GL_TEXTURE22: // fall-through... |
| case GLenum::GL_TEXTURE23: // fall-through... |
| case GLenum::GL_TEXTURE24: // fall-through... |
| case GLenum::GL_TEXTURE25: // fall-through... |
| case GLenum::GL_TEXTURE26: // fall-through... |
| case GLenum::GL_TEXTURE27: // fall-through... |
| case GLenum::GL_TEXTURE28: // fall-through... |
| case GLenum::GL_TEXTURE29: // fall-through... |
| case GLenum::GL_TEXTURE3: // fall-through... |
| case GLenum::GL_TEXTURE30: // fall-through... |
| case GLenum::GL_TEXTURE31: // fall-through... |
| case GLenum::GL_TEXTURE4: // fall-through... |
| case GLenum::GL_TEXTURE5: // fall-through... |
| case GLenum::GL_TEXTURE6: // fall-through... |
| case GLenum::GL_TEXTURE7: // fall-through... |
| case GLenum::GL_TEXTURE8: // fall-through... |
| case GLenum::GL_TEXTURE9: { |
| subGlErrorInvalidEnumIf(call, ((l_index) < ((GLint)(0L))) || ((l_index) >= (checkNotNull(l_ctx).mConstants.mMaxCombinedTextureImageUnits))); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnumIf(call, ((l_index) < ((GLint)(0L))) || ((l_index) >= (checkNotNull(l_ctx).mConstants.mMaxCombinedTextureImageUnits))); |
| } |
| } |
| checkNotNull(l_ctx).mActiveTextureUnit = unit; |
| 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::GlActiveTexture coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), unit); |
| 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::glBindSampler(GLuint index, SamplerId sampler) { |
| GAPID_DEBUG("glBindSampler(%" PRIu32 ", %" PRIu32 ")", index, sampler); |
| |
| if (mImports.glBindSampler == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBindSampler"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, sampler] { |
| called = true; |
| observeReads(); |
| mImports.glBindSampler(index, sampler); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| uint32_t l_unit = (uint32_t)((index) + ((GLuint)(GLenum::GL_TEXTURE0))); |
| checkNotNull(findOrZero(checkNotNull(l_ctx).mTextureUnits, l_unit)).mSamplerBinding = sampler; |
| 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::GlBindSampler coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), toEncoder< uint32_t >(sampler, 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::glCompressedTexImage2D(uint32_t target, GLint level, uint32_t format, GLsizei width, GLsizei height, GLint border, GLsizei image_size, TexturePointer data) { |
| GAPID_DEBUG("glCompressedTexImage2D(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %p)", target, level, format, width, height, border, image_size, data); |
| |
| if (mImports.glCompressedTexImage2D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCompressedTexImage2D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, format, width, height, border, image_size, data] { |
| called = true; |
| observeReads(); |
| mImports.glCompressedTexImage2D(target, level, format, width, height, border, image_size, data); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_TEXTURE_2D: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_X: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_X: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_Y: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_Z: { |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| switch (format) { |
| case GLenum::GL_COMPRESSED_R11_EAC: // fall-through... |
| case GLenum::GL_COMPRESSED_RG11_EAC: // fall-through... |
| case GLenum::GL_COMPRESSED_RGB8_ETC2: // fall-through... |
| case GLenum::GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA8_ETC2_EAC: // fall-through... |
| case GLenum::GL_COMPRESSED_SIGNED_R11_EAC: // fall-through... |
| case GLenum::GL_COMPRESSED_SIGNED_RG11_EAC: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ETC2: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| case GLenum::GL_ATC_RGB_AMD: // fall-through... |
| case GLenum::GL_ATC_RGBA_EXPLICIT_ALPHA_AMD: // fall-through... |
| case GLenum::GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: { |
| subRequiresExtension(call, ExtensionId::GL_AMD_compressed_ATC_texture); |
| break; |
| } |
| case GLenum::GL_ETC1_RGB8_OES: { |
| subRequiresExtension(call, ExtensionId::GL_OES_compressed_ETC1_RGB8_texture); |
| break; |
| } |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_10x10: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_10x5: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_10x6: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_10x8: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_12x10: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_12x12: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_4x4: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_5x4: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_5x5: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_6x5: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_6x6: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_8x5: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_8x6: // fall-through... |
| case GLenum::GL_COMPRESSED_RGBA_ASTC_8x8: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6: // fall-through... |
| case GLenum::GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, format); |
| } |
| } |
| subGlErrorInvalidValueIf(call, ((border) != ((GLint)(0L))) || ((image_size) < ((GLsizei)(0L)))); |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subCheckMaxTextureSize(call, l_ctx, target, level, width, height); |
| std::shared_ptr<TextureUnit> l_tu = findOrZero(checkNotNull(l_ctx).mTextureUnits, checkNotNull(l_ctx).mActiveTextureUnit); |
| switch (target) { |
| case GLenum::GL_TEXTURE_2D: { |
| TextureId l_id = checkNotNull(l_tu).mBinding2d; |
| std::shared_ptr<Texture> l_t = findOrZero(checkNotNull(l_ctx).mInstances.mTextures, l_id); |
| Image l_l = Image(width, height, Slice<uint8_t>(), (uint32_t)(image_size), format, 0); |
| if (((findOrZero(checkNotNull(l_ctx).mBoundBuffers, GLenum::GL_PIXEL_UNPACK_BUFFER)) == ((BufferId)(0UL))) && ((data) != (nullptr))) { |
| l_l.mData = clone(slice((uint8_t*)(data), (uint64_t)(0UL), (uint64_t)(l_l.mSize))); |
| } |
| checkNotNull(l_t).mTexture2D[level] = l_l; |
| checkNotNull(l_t).mKind = TextureKind::TEXTURE2D; |
| checkNotNull(l_t).mTexelFormat = format; |
| break; |
| } |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_X: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_Y: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_Z: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_X: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: { |
| TextureId l_id = checkNotNull(l_tu).mBindingCubeMap; |
| std::shared_ptr<Texture> l_t = findOrZero(checkNotNull(l_ctx).mInstances.mTextures, l_id); |
| Image l_l = Image(width, height, Slice<uint8_t>(), (uint32_t)(image_size), format, 0); |
| if (((findOrZero(checkNotNull(l_ctx).mBoundBuffers, GLenum::GL_PIXEL_UNPACK_BUFFER)) == ((BufferId)(0UL))) && ((data) != (nullptr))) { |
| l_l.mData = clone(slice((uint8_t*)(data), (uint64_t)(0UL), (uint64_t)(l_l.mSize))); |
| } |
| CubemapLevel l_cube = findOrZero(checkNotNull(l_t).mCubemap, level); |
| l_cube.mFaces[target] = l_l; |
| checkNotNull(l_t).mCubemap[level] = l_cube; |
| checkNotNull(l_t).mKind = TextureKind::CUBEMAP; |
| checkNotNull(l_t).mTexelFormat = format; |
| break; |
| } |
| } |
| 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::GlCompressedTexImage2D coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, mScratch), format, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(border, mScratch), 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::glCopyTexImage2D(uint32_t target, GLint level, uint32_t format, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { |
| GAPID_DEBUG("glCopyTexImage2D(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", target, level, format, x, y, width, height, border); |
| |
| if (mImports.glCopyTexImage2D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glCopyTexImage2D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, level, format, x, y, width, height, border] { |
| called = true; |
| observeReads(); |
| mImports.glCopyTexImage2D(target, level, format, x, y, width, height, border); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| switch (target) { |
| case GLenum::GL_TEXTURE_2D: { |
| break; |
| } |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_X: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_X: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_Y: // fall-through... |
| case GLenum::GL_TEXTURE_CUBE_MAP_POSITIVE_Z: { |
| subGlErrorInvalidValueIf(call, (width) != (height)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, target); |
| } |
| } |
| switch (format) { |
| case GLenum::GL_ALPHA: // fall-through... |
| case GLenum::GL_LUMINANCE: // fall-through... |
| case GLenum::GL_LUMINANCE_ALPHA: // fall-through... |
| case GLenum::GL_RGB: // fall-through... |
| case GLenum::GL_RGBA: { |
| break; |
| } |
| case GLenum::GL_R16I: // fall-through... |
| case GLenum::GL_R16UI: // fall-through... |
| case GLenum::GL_R32I: // fall-through... |
| case GLenum::GL_R32UI: // fall-through... |
| case GLenum::GL_R8: // fall-through... |
| case GLenum::GL_R8I: // fall-through... |
| case GLenum::GL_R8UI: // fall-through... |
| case GLenum::GL_RG16I: // fall-through... |
| case GLenum::GL_RG16UI: // fall-through... |
| case GLenum::GL_RG32I: // fall-through... |
| case GLenum::GL_RG32UI: // fall-through... |
| case GLenum::GL_RG8: // fall-through... |
| case GLenum::GL_RG8I: // fall-through... |
| case GLenum::GL_RG8UI: // fall-through... |
| case GLenum::GL_RGB10_A2: // fall-through... |
| case GLenum::GL_RGB10_A2UI: // fall-through... |
| case GLenum::GL_RGB565: // fall-through... |
| case GLenum::GL_RGB5_A1: // fall-through... |
| case GLenum::GL_RGB8: // fall-through... |
| case GLenum::GL_RGBA16I: // fall-through... |
| case GLenum::GL_RGBA16UI: // fall-through... |
| case GLenum::GL_RGBA32I: // fall-through... |
| case GLenum::GL_RGBA32UI: // fall-through... |
| case GLenum::GL_RGBA4: // fall-through... |
| case GLenum::GL_RGBA8: // fall-through... |
| case GLenum::GL_RGBA8I: // fall-through... |
| case GLenum::GL_RGBA8UI: // fall-through... |
| case GLenum::GL_SRGB8: // fall-through... |
| case GLenum::GL_SRGB8_ALPHA8: { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| break; |
| } |
| default: { |
| subGlErrorInvalidEnum(call, format); |
| } |
| } |
| std::shared_ptr<Context> l_ctx = subGetContext(call); |
| subGlErrorInvalidValueIf(call, (border) != ((GLint)(0L))); |
| subCheckMaxTextureSize(call, l_ctx, target, level, 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::GlCopyTexImage2D coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(level, mScratch), format, toEncoder< int32_t >(x, mScratch), toEncoder< int32_t >(y, mScratch), toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), toEncoder< int32_t >(border, 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::glGetTexParameterIuiv(uint32_t target, uint32_t pname, GLuint* params) { |
| GAPID_DEBUG("glGetTexParameterIuiv(%u, %u, %p)", target, pname, params); |
| |
| if (mImports.glGetTexParameterIuiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetTexParameterIuiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetTexParameterIuiv(target, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| 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::GlGetTexParameterIuiv 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); |
| |
| } |
| |
| void GlesSpy::glSamplerParameterIiv(SamplerId sampler, uint32_t pname, GLint* param) { |
| GAPID_DEBUG("glSamplerParameterIiv(%" PRIu32 ", %u, %p)", sampler, pname, param); |
| |
| if (mImports.glSamplerParameterIiv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glSamplerParameterIiv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, sampler, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glSamplerParameterIiv(sampler, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(2L)); |
| 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::GlSamplerParameterIiv 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::glTexStorage3D(uint32_t target, GLsizei levels, uint32_t internalformat, GLsizei width, GLsizei height, GLsizei depth) { |
| GAPID_DEBUG("glTexStorage3D(%u, %" PRId32 ", %u, %" PRId32 ", %" PRId32 ", %" PRId32 ")", target, levels, internalformat, width, height, depth); |
| |
| if (mImports.glTexStorage3D == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexStorage3D"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, levels, internalformat, width, height, depth] { |
| called = true; |
| observeReads(); |
| mImports.glTexStorage3D(target, levels, internalformat, width, height, depth); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| subTexStorage3D(call, target, levels, internalformat, width, height, depth); |
| 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::GlTexStorage3D coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, toEncoder< int32_t >(levels, mScratch), internalformat, toEncoder< int32_t >(width, mScratch), toEncoder< int32_t >(height, mScratch), 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::glVertexAttrib1f(AttributeLocation location, GLfloat value0) { |
| GAPID_DEBUG("glVertexAttrib1f(%" PRIu32 ", %f)", location, value0); |
| |
| if (mImports.glVertexAttrib1f == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttrib1f"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, location, value0] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttrib1f(location, value0); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(2L), (GLint)(0L)); |
| call(); |
| subVertexAttribF(call, location, std::move(Vec4f{value0, (GLfloat)(0.f), (GLfloat)(0.f), (GLfloat)(1.f)})); |
| } 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::GlVertexAttrib1f coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(location, mScratch), toEncoder< float >(value0, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glVertexAttribI4ui(AttributeLocation index, GLuint x, GLuint y, GLuint z, GLuint w) { |
| GAPID_DEBUG("glVertexAttribI4ui(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ", %" PRIu32 ")", index, x, y, z, w); |
| |
| if (mImports.glVertexAttribI4ui == nullptr) { |
| GAPID_WARNING("Application called unsupported function glVertexAttribI4ui"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, index, x, y, z, w] { |
| called = true; |
| observeReads(); |
| mImports.glVertexAttribI4ui(index, x, y, z, w); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(3L), (GLint)(0L)); |
| call(); |
| subVertexAttribI(call, index, std::move(Vec4i{(GLint)(x), (GLint)(y), (GLint)(z), (GLint)(w)})); |
| } 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::GlVertexAttribI4ui coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< uint32_t >(index, mScratch), toEncoder< uint32_t >(x, mScratch), toEncoder< uint32_t >(y, mScratch), toEncoder< uint32_t >(z, mScratch), toEncoder< uint32_t >(w, 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::eglSwapBuffers(EGLDisplay display, void* surface) { |
| GAPID_DEBUG("eglSwapBuffers(%p, %p)", display, surface); |
| |
| if (mImports.eglSwapBuffers == nullptr) { |
| GAPID_WARNING("Application called unsupported function eglSwapBuffers"); |
| return 0; |
| } |
| |
| EGLBoolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, display, surface] { |
| called = true; |
| observeReads(); |
| result = mImports.eglSwapBuffers(display, surface); |
| }; |
| |
| onPreEndOfFrame(); |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::EglSwapBuffers coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, mScratch), toEncoder< gapic::coder::gles::Void__P >(surface, 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; |
| } |
| |
| EGLBoolean GlesSpy::eglGetConfigAttrib(EGLDisplay display, EGLConfig config, EGLint attribute, EGLint* value) { |
| GAPID_DEBUG("eglGetConfigAttrib(%p, %p, %d, %p)", display, config, attribute, value); |
| |
| if (mImports.eglGetConfigAttrib == nullptr) { |
| GAPID_WARNING("Application called unsupported function eglGetConfigAttrib"); |
| return 0; |
| } |
| |
| EGLBoolean result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, display, config, attribute, value] { |
| called = true; |
| observeReads(); |
| result = mImports.eglGetConfigAttrib(display, config, 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::EglGetConfigAttrib coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::EGLDisplay >(display, mScratch), toEncoder< gapic::coder::gles::EGLConfig >(config, 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; |
| } |
| |
| GLXContext GlesSpy::glXCreateNewContext(void* display, void* fbconfig, uint32_t type, GLXContext shared, bool direct) { |
| GAPID_DEBUG("glXCreateNewContext(%p, %p, %" PRIu32 ", %p, %d)", display, fbconfig, type, shared, direct); |
| |
| if (mImports.glXCreateNewContext == nullptr) { |
| GAPID_WARNING("Application called unsupported function glXCreateNewContext"); |
| return nullptr; |
| } |
| |
| GLXContext result = nullptr; |
| bool called = false; |
| auto call = [this, &called, &result, display, fbconfig, type, shared, direct] { |
| called = true; |
| observeReads(); |
| result = mImports.glXCreateNewContext(display, fbconfig, type, shared, direct); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| auto l_context = result; |
| std::shared_ptr<Context> l__res_0 = subCreateContext(call); |
| this->GLXContexts[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::GlXCreateNewContext coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::Void__P >(display, mScratch), toEncoder< gapic::coder::gles::Void__P >(fbconfig, mScratch), type, toEncoder< gapic::coder::gles::GLXContext >(shared, mScratch), direct, toEncoder< gapic::coder::gles::GLXContext >(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; |
| } |
| |
| CGLError GlesSpy::CGLFlushDrawable(CGLContextObj ctx) { |
| GAPID_DEBUG("CGLFlushDrawable(%p)", ctx); |
| |
| if (mImports.CGLFlushDrawable == nullptr) { |
| GAPID_WARNING("Application called unsupported function CGLFlushDrawable"); |
| return 0; |
| } |
| |
| CGLError result = 0; |
| bool called = false; |
| auto call = [this, &called, &result, ctx] { |
| called = true; |
| observeReads(); |
| result = mImports.CGLFlushDrawable(ctx); |
| }; |
| |
| onPreEndOfFrame(); |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| call(); |
| break; |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::CGLFlushDrawable coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::CGLContextObj >(ctx, mScratch), toEncoder< int >(result, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| |
| return result; |
| } |
| |
| void GlesSpy::glBlendEquationSeparateOES(uint32_t modeRGB, uint32_t modeAlpha) { |
| GAPID_DEBUG("glBlendEquationSeparateOES(%u, %u)", modeRGB, modeAlpha); |
| |
| if (mImports.glBlendEquationSeparateOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendEquationSeparateOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, modeRGB, modeAlpha] { |
| called = true; |
| observeReads(); |
| mImports.glBlendEquationSeparateOES(modeRGB, modeAlpha); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_blend_equation_separate); |
| 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::GlBlendEquationSeparateOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), modeRGB, modeAlpha); |
| 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::glBlendFuncSeparateOES(uint32_t srcRGB, uint32_t dstRGB, uint32_t srcAlpha, uint32_t dstAlpha) { |
| GAPID_DEBUG("glBlendFuncSeparateOES(%u, %u, %u, %u)", srcRGB, dstRGB, srcAlpha, dstAlpha); |
| |
| if (mImports.glBlendFuncSeparateOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glBlendFuncSeparateOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, srcRGB, dstRGB, srcAlpha, dstAlpha] { |
| called = true; |
| observeReads(); |
| mImports.glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_blend_func_separate); |
| 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::GlBlendFuncSeparateOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 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::glClearDepthfOES(GLclampf depth) { |
| GAPID_DEBUG("glClearDepthfOES(%f)", depth); |
| |
| if (mImports.glClearDepthfOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glClearDepthfOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, depth] { |
| called = true; |
| observeReads(); |
| mImports.glClearDepthfOES(depth); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_single_precision); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlClearDepthfOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(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::glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { |
| GAPID_DEBUG("glColor4f(%f, %f, %f, %f)", red, green, blue, alpha); |
| |
| if (mImports.glColor4f == nullptr) { |
| GAPID_WARNING("Application called unsupported function glColor4f"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, red, green, blue, alpha] { |
| called = true; |
| observeReads(); |
| mImports.glColor4f(red, green, blue, alpha); |
| }; |
| |
| |
| 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::GlColor4f coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(red, mScratch), toEncoder< float >(green, mScratch), toEncoder< float >(blue, mScratch), toEncoder< float >(alpha, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glDepthRangefOES(GLclampf n, GLclampf f) { |
| GAPID_DEBUG("glDepthRangefOES(%f, %f)", n, f); |
| |
| if (mImports.glDepthRangefOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDepthRangefOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, n, f] { |
| called = true; |
| observeReads(); |
| mImports.glDepthRangefOES(n, f); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_single_precision); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlDepthRangefOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(n, mScratch), toEncoder< float >(f, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glDrawTexivOES(GLint* coords) { |
| GAPID_DEBUG("glDrawTexivOES(%p)", coords); |
| |
| if (mImports.glDrawTexivOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawTexivOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, coords] { |
| called = true; |
| observeReads(); |
| mImports.glDrawTexivOES(coords); |
| }; |
| |
| |
| 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::GlDrawTexivOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< gapic::coder::gles::GLint__CP >(coords, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| onPostDrawCall(); |
| |
| } |
| |
| void GlesSpy::glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) { |
| GAPID_DEBUG("glDrawTexsOES(%" PRId16 ", %" PRId16 ", %" PRId16 ", %" PRId16 ", %" PRId16 ")", x, y, z, width, height); |
| |
| if (mImports.glDrawTexsOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glDrawTexsOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, x, y, z, width, height] { |
| called = true; |
| observeReads(); |
| mImports.glDrawTexsOES(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::GlDrawTexsOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< int16_t >(x, mScratch), toEncoder< int16_t >(y, mScratch), toEncoder< int16_t >(z, mScratch), toEncoder< int16_t >(width, mScratch), toEncoder< int16_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::glEnableClientState(uint32_t array) { |
| GAPID_DEBUG("glEnableClientState(%u)", array); |
| |
| if (mImports.glEnableClientState == nullptr) { |
| GAPID_WARNING("Application called unsupported function glEnableClientState"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, array] { |
| called = true; |
| observeReads(); |
| mImports.glEnableClientState(array); |
| }; |
| |
| |
| 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::GlEnableClientState coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), array); |
| 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::glFramebufferTexture2DOES(uint32_t target, uint32_t attachment, uint32_t textarget, TextureId texture, GLint level) { |
| GAPID_DEBUG("glFramebufferTexture2DOES(%u, %u, %u, %" PRIu32 ", %" PRId32 ")", target, attachment, textarget, texture, level); |
| |
| if (mImports.glFramebufferTexture2DOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glFramebufferTexture2DOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, attachment, textarget, texture, level] { |
| called = true; |
| observeReads(); |
| mImports.glFramebufferTexture2DOES(target, attachment, textarget, texture, level); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_framebuffer_object); |
| subFramebufferTexture2D(call, target, attachment, textarget, texture, level); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlFramebufferTexture2DOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, attachment, textarget, toEncoder< uint32_t >(texture, mScratch), toEncoder< int32_t >(level, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glGetClipPlanexOES(uint32_t plane, GLfixed* equation) { |
| GAPID_DEBUG("glGetClipPlanexOES(%u, %p)", plane, equation); |
| |
| if (mImports.glGetClipPlanexOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetClipPlanexOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, plane, equation] { |
| called = true; |
| observeReads(); |
| mImports.glGetClipPlanexOES(plane, equation); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetClipPlanexOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), plane, toEncoder< gapic::coder::gles::GLfixed__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::glGetMaterialfv(uint32_t face, uint32_t pname, GLfloat* params) { |
| GAPID_DEBUG("glGetMaterialfv(%u, %u, %p)", face, pname, params); |
| |
| if (mImports.glGetMaterialfv == nullptr) { |
| GAPID_WARNING("Application called unsupported function glGetMaterialfv"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, face, pname, params] { |
| called = true; |
| observeReads(); |
| mImports.glGetMaterialfv(face, pname, params); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subMinRequiredVersion(call, (GLint)(1L), (GLint)(0L)); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlGetMaterialfv coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), face, 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::glLightModelf(uint32_t pname, GLfloat param) { |
| GAPID_DEBUG("glLightModelf(%u, %f)", pname, param); |
| |
| if (mImports.glLightModelf == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLightModelf"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glLightModelf(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::GlLightModelf coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), 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::glLightxOES(uint32_t light, uint32_t pname, GLfixed param) { |
| GAPID_DEBUG("glLightxOES(%u, %u, %" PRId32 ")", light, pname, param); |
| |
| if (mImports.glLightxOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLightxOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, light, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glLightxOES(light, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlLightxOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), light, pname, toEncoder< int32_t >(param, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glLoadPaletteFromModelViewMatrixOES() { |
| GAPID_DEBUG("glLoadPaletteFromModelViewMatrixOES()"); |
| |
| if (mImports.glLoadPaletteFromModelViewMatrixOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glLoadPaletteFromModelViewMatrixOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glLoadPaletteFromModelViewMatrixOES(); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_matrix_palette); |
| 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::GlLoadPaletteFromModelViewMatrixOES 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::glMaterialf(uint32_t face, uint32_t pname, GLfloat param) { |
| GAPID_DEBUG("glMaterialf(%u, %u, %f)", face, pname, param); |
| |
| if (mImports.glMaterialf == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMaterialf"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, face, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glMaterialf(face, 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::GlMaterialf coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), face, 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::glMatrixIndexPointerOES(GLint size, uint32_t type, GLsizei stride, void* pointer) { |
| GAPID_DEBUG("glMatrixIndexPointerOES(%" PRId32 ", %u, %" PRId32 ", %p)", size, type, stride, pointer); |
| |
| if (mImports.glMatrixIndexPointerOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glMatrixIndexPointerOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, size, type, stride, pointer] { |
| called = true; |
| observeReads(); |
| mImports.glMatrixIndexPointerOES(size, type, stride, pointer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_matrix_palette); |
| 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::GlMatrixIndexPointerOES 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)); |
| 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::glOrthofOES(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) { |
| GAPID_DEBUG("glOrthofOES(%f, %f, %f, %f, %f, %f)", l, r, b, t, n, f); |
| |
| if (mImports.glOrthofOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glOrthofOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, l, r, b, t, n, f] { |
| called = true; |
| observeReads(); |
| mImports.glOrthofOES(l, r, b, t, n, f); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_single_precision); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlOrthofOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), toEncoder< float >(l, mScratch), toEncoder< float >(r, mScratch), toEncoder< float >(b, mScratch), toEncoder< float >(t, mScratch), toEncoder< float >(n, mScratch), toEncoder< float >(f, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glPointParameterf(uint32_t pname, GLfloat param) { |
| GAPID_DEBUG("glPointParameterf(%u, %f)", pname, param); |
| |
| if (mImports.glPointParameterf == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPointParameterf"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glPointParameterf(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::GlPointParameterf coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), 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::glPointSizePointerOES(uint32_t type, GLsizei stride, void* pointer) { |
| GAPID_DEBUG("glPointSizePointerOES(%u, %" PRId32 ", %p)", type, stride, pointer); |
| |
| if (mImports.glPointSizePointerOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPointSizePointerOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, type, stride, pointer] { |
| called = true; |
| observeReads(); |
| mImports.glPointSizePointerOES(type, stride, pointer); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_point_size_array); |
| 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::GlPointSizePointerOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), type, toEncoder< int32_t >(stride, mScratch), toEncoder< gapic::coder::gles::Void__CP >(pointer, 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::glPointSizex(GLfixed size) { |
| GAPID_DEBUG("glPointSizex(%" PRId32 ")", size); |
| |
| if (mImports.glPointSizex == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPointSizex"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, size] { |
| called = true; |
| observeReads(); |
| mImports.glPointSizex(size); |
| }; |
| |
| |
| 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::GlPointSizex 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::glPushMatrix() { |
| GAPID_DEBUG("glPushMatrix()"); |
| |
| if (mImports.glPushMatrix == nullptr) { |
| GAPID_WARNING("Application called unsupported function glPushMatrix"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called] { |
| called = true; |
| observeReads(); |
| mImports.glPushMatrix(); |
| }; |
| |
| |
| 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::GlPushMatrix 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::glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) { |
| GAPID_DEBUG("glRotatex(%" PRId32 ", %" PRId32 ", %" PRId32 ", %" PRId32 ")", angle, x, y, z); |
| |
| if (mImports.glRotatex == nullptr) { |
| GAPID_WARNING("Application called unsupported function glRotatex"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, angle, x, y, z] { |
| called = true; |
| observeReads(); |
| mImports.glRotatex(angle, 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::GlRotatex 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::glTexParameterxOES(uint32_t target, uint32_t pname, GLfixed param) { |
| GAPID_DEBUG("glTexParameterxOES(%u, %u, %" PRId32 ")", target, pname, param); |
| |
| if (mImports.glTexParameterxOES == nullptr) { |
| GAPID_WARNING("Application called unsupported function glTexParameterxOES"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, target, pname, param] { |
| called = true; |
| observeReads(); |
| mImports.glTexParameterxOES(target, pname, param); |
| }; |
| |
| |
| uint64_t counter_at_begin = mCommandStartEndCounter++; |
| |
| try { |
| do { |
| subRequiresExtension(call, ExtensionId::GL_OES_fixed_point); |
| subErrorGLES10notSupported(call); |
| call(); |
| } while(false); |
| } catch (gapii::AbortException& e) { |
| if (!called) { |
| call(); // abort() was called before the fence. |
| } |
| handleAbort(e); |
| } |
| uint64_t counter_at_end = mCommandStartEndCounter++; |
| gapic::coder::atom::CommandCounter counter_value_encodable(counter_at_begin, counter_at_end); |
| |
| observeWrites(); |
| |
| gapic::coder::gles::GlTexParameterxOES coder(mScratch.vector<gapic::Encodable*>(kMaxExtras), target, pname, toEncoder< int32_t >(param, mScratch)); |
| coder.mextras.append(&mObservations); |
| |
| if (counter_at_end > counter_at_begin + 1 || |
| counter_at_begin != mExpectedNextCommandStartCounterValue) { |
| coder.mextras.append(&counter_value_encodable); |
| } |
| mExpectedNextCommandStartCounterValue = counter_at_end + 1; |
| |
| addExtras(coder); |
| mEncoder->Variant(&coder); |
| |
| } |
| |
| void GlesSpy::glColorPointerBounds(GLint size, uint32_t type, GLsizei stride, void* pointer, GLsizei count) { |
| GAPID_DEBUG("glColorPointerBounds(%" PRId32 ", %u, %" PRId32 ", %p, %" PRId32 ")", size, type, stride, pointer, count); |
| |
| if (mImports.glColorPointerBounds == nullptr) { |
| GAPID_WARNING("Application called unsupported function glColorPointerBounds"); |
| return; |
| } |
| |
| bool called = false; |
| auto call = [this, &called, size, type, stride, pointer, count] { |
| called = true; |
| observeReads(); |
| mImports.glColorPointerBounds(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::GlColorPointerBounds 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); |
| |
| } |
| } // namespace gapii |