blob: 2355b058cc4bac89eb6cd8da728c2514fad9d856 [file] [log] [blame]
/*
* Copyright 2015, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
////////////////////////////////////////////////////////////////////////////////
// Automatically generated file. Do not modify!
////////////////////////////////////////////////////////////////////////////////
#include "GetGfxProcAddress.h"
#include "GfxApi.h"
#include "Interpreter.h"
#include "Log.h"
#include "Stack.h"
namespace android {
namespace caze {
namespace gfxapi {
namespace {
bool callEglCreateContext(Stack* stack, bool pushReturn) {
int32_t* context = stack->pop<int32_t*>();
int32_t* version = stack->pop<int32_t*>();
if (stack->isValid()) {
CAZE_INFO("eglCreateContext(%p, %p)\n", version, context);
if (eglCreateContext != nullptr) {
eglCreateContext(version, context);
} else {
CAZE_WARNING("Attempted to call unsupported function eglCreateContext\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function eglCreateContext\n");
return false;
}
}
bool callEglMakeCurrent(Stack* stack, bool pushReturn) {
int32_t context = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("eglMakeCurrent(%d)\n", context);
if (eglMakeCurrent != nullptr) {
eglMakeCurrent(context);
} else {
CAZE_WARNING("Attempted to call unsupported function eglMakeCurrent\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function eglMakeCurrent\n");
return false;
}
}
bool callEglSwapBuffers(Stack* stack, bool pushReturn) {
if (stack->isValid()) {
CAZE_INFO("eglSwapBuffers()\n");
if (eglSwapBuffers != nullptr) {
eglSwapBuffers();
} else {
CAZE_WARNING("Attempted to call unsupported function eglSwapBuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function eglSwapBuffers\n");
return false;
}
}
bool callGlEnableClientState(Stack* stack, bool pushReturn) {
uint32_t type = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glEnableClientState(%u)\n", type);
if (glEnableClientState != nullptr) {
glEnableClientState(type);
} else {
CAZE_WARNING("Attempted to call unsupported function glEnableClientState\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glEnableClientState\n");
return false;
}
}
bool callGlDisableClientState(Stack* stack, bool pushReturn) {
uint32_t type = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glDisableClientState(%u)\n", type);
if (glDisableClientState != nullptr) {
glDisableClientState(type);
} else {
CAZE_WARNING("Attempted to call unsupported function glDisableClientState\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDisableClientState\n");
return false;
}
}
bool callGlGetProgramBinaryOES(Stack* stack, bool pushReturn) {
void* binary = stack->pop<void*>();
uint32_t* binary_format = stack->pop<uint32_t*>();
int32_t* bytes_written = stack->pop<int32_t*>();
int32_t buffer_size = stack->pop<int32_t>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetProgramBinaryOES(%u, %d, %p, %p, %p)\n", program, buffer_size,
bytes_written, binary_format, binary);
if (glGetProgramBinaryOES != nullptr) {
glGetProgramBinaryOES(program, buffer_size, bytes_written, binary_format, binary);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetProgramBinaryOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetProgramBinaryOES\n");
return false;
}
}
bool callGlProgramBinaryOES(Stack* stack, bool pushReturn) {
int32_t binary_size = stack->pop<int32_t>();
void* binary = stack->pop<void*>();
uint32_t binary_format = stack->pop<uint32_t>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glProgramBinaryOES(%u, %u, %p, %d)\n", program, binary_format, binary,
binary_size);
if (glProgramBinaryOES != nullptr) {
glProgramBinaryOES(program, binary_format, binary, binary_size);
} else {
CAZE_WARNING("Attempted to call unsupported function glProgramBinaryOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glProgramBinaryOES\n");
return false;
}
}
bool callGlStartTilingQCOM(Stack* stack, bool pushReturn) {
uint32_t preserveMask = stack->pop<uint32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t y = stack->pop<int32_t>();
int32_t x = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glStartTilingQCOM(%d, %d, %d, %d, %u)\n", x, y, width, height, preserveMask);
if (glStartTilingQCOM != nullptr) {
glStartTilingQCOM(x, y, width, height, preserveMask);
} else {
CAZE_WARNING("Attempted to call unsupported function glStartTilingQCOM\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glStartTilingQCOM\n");
return false;
}
}
bool callGlEndTilingQCOM(Stack* stack, bool pushReturn) {
uint32_t preserve_mask = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glEndTilingQCOM(%u)\n", preserve_mask);
if (glEndTilingQCOM != nullptr) {
glEndTilingQCOM(preserve_mask);
} else {
CAZE_WARNING("Attempted to call unsupported function glEndTilingQCOM\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glEndTilingQCOM\n");
return false;
}
}
bool callGlDiscardFramebufferEXT(Stack* stack, bool pushReturn) {
uint32_t* attachments = stack->pop<uint32_t*>();
int32_t numAttachments = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glDiscardFramebufferEXT(%u, %d, %p)\n", target, numAttachments, attachments);
if (glDiscardFramebufferEXT != nullptr) {
glDiscardFramebufferEXT(target, numAttachments, attachments);
} else {
CAZE_WARNING("Attempted to call unsupported function glDiscardFramebufferEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDiscardFramebufferEXT\n");
return false;
}
}
bool callGlInsertEventMarkerEXT(Stack* stack, bool pushReturn) {
const char* marker = stack->pop<const char*>();
int32_t length = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glInsertEventMarkerEXT(%d, %s)\n", length, marker);
if (glInsertEventMarkerEXT != nullptr) {
glInsertEventMarkerEXT(length, marker);
} else {
CAZE_WARNING("Attempted to call unsupported function glInsertEventMarkerEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glInsertEventMarkerEXT\n");
return false;
}
}
bool callGlPushGroupMarkerEXT(Stack* stack, bool pushReturn) {
const char* marker = stack->pop<const char*>();
int32_t length = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glPushGroupMarkerEXT(%d, %s)\n", length, marker);
if (glPushGroupMarkerEXT != nullptr) {
glPushGroupMarkerEXT(length, marker);
} else {
CAZE_WARNING("Attempted to call unsupported function glPushGroupMarkerEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glPushGroupMarkerEXT\n");
return false;
}
}
bool callGlPopGroupMarkerEXT(Stack* stack, bool pushReturn) {
if (stack->isValid()) {
CAZE_INFO("glPopGroupMarkerEXT()\n");
if (glPopGroupMarkerEXT != nullptr) {
glPopGroupMarkerEXT();
} else {
CAZE_WARNING("Attempted to call unsupported function glPopGroupMarkerEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glPopGroupMarkerEXT\n");
return false;
}
}
bool callGlTexStorage1DEXT(Stack* stack, bool pushReturn) {
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t levels = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexStorage1DEXT(%u, %d, %u, %d)\n", target, levels, format, width);
if (glTexStorage1DEXT != nullptr) {
glTexStorage1DEXT(target, levels, format, width);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexStorage1DEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexStorage1DEXT\n");
return false;
}
}
bool callGlTexStorage2DEXT(Stack* stack, bool pushReturn) {
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t levels = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexStorage2DEXT(%u, %d, %u, %d, %d)\n", target, levels, format, width, height);
if (glTexStorage2DEXT != nullptr) {
glTexStorage2DEXT(target, levels, format, width, height);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexStorage2DEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexStorage2DEXT\n");
return false;
}
}
bool callGlTexStorage3DEXT(Stack* stack, bool pushReturn) {
int32_t depth = stack->pop<int32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t levels = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexStorage3DEXT(%u, %d, %u, %d, %d, %d)\n", target, levels, format, width,
height, depth);
if (glTexStorage3DEXT != nullptr) {
glTexStorage3DEXT(target, levels, format, width, height, depth);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexStorage3DEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexStorage3DEXT\n");
return false;
}
}
bool callGlTextureStorage1DEXT(Stack* stack, bool pushReturn) {
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t levels = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
TextureId texture = stack->pop<TextureId>();
if (stack->isValid()) {
CAZE_INFO("glTextureStorage1DEXT(%u, %u, %d, %u, %d)\n", texture, target, levels, format,
width);
if (glTextureStorage1DEXT != nullptr) {
glTextureStorage1DEXT(texture, target, levels, format, width);
} else {
CAZE_WARNING("Attempted to call unsupported function glTextureStorage1DEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTextureStorage1DEXT\n");
return false;
}
}
bool callGlTextureStorage2DEXT(Stack* stack, bool pushReturn) {
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t levels = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
TextureId texture = stack->pop<TextureId>();
if (stack->isValid()) {
CAZE_INFO("glTextureStorage2DEXT(%u, %u, %d, %u, %d, %d)\n", texture, target, levels,
format, width, height);
if (glTextureStorage2DEXT != nullptr) {
glTextureStorage2DEXT(texture, target, levels, format, width, height);
} else {
CAZE_WARNING("Attempted to call unsupported function glTextureStorage2DEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTextureStorage2DEXT\n");
return false;
}
}
bool callGlTextureStorage3DEXT(Stack* stack, bool pushReturn) {
int32_t depth = stack->pop<int32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t levels = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
TextureId texture = stack->pop<TextureId>();
if (stack->isValid()) {
CAZE_INFO("glTextureStorage3DEXT(%u, %u, %d, %u, %d, %d, %d)\n", texture, target, levels,
format, width, height, depth);
if (glTextureStorage3DEXT != nullptr) {
glTextureStorage3DEXT(texture, target, levels, format, width, height, depth);
} else {
CAZE_WARNING("Attempted to call unsupported function glTextureStorage3DEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTextureStorage3DEXT\n");
return false;
}
}
bool callGlGenVertexArraysOES(Stack* stack, bool pushReturn) {
VertexArrayId* arrays = stack->pop<VertexArrayId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glGenVertexArraysOES(%d, %p)\n", count, arrays);
if (glGenVertexArraysOES != nullptr) {
glGenVertexArraysOES(count, arrays);
} else {
CAZE_WARNING("Attempted to call unsupported function glGenVertexArraysOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGenVertexArraysOES\n");
return false;
}
}
bool callGlBindVertexArrayOES(Stack* stack, bool pushReturn) {
VertexArrayId array = stack->pop<VertexArrayId>();
if (stack->isValid()) {
CAZE_INFO("glBindVertexArrayOES(%u)\n", array);
if (glBindVertexArrayOES != nullptr) {
glBindVertexArrayOES(array);
} else {
CAZE_WARNING("Attempted to call unsupported function glBindVertexArrayOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBindVertexArrayOES\n");
return false;
}
}
bool callGlDeleteVertexArraysOES(Stack* stack, bool pushReturn) {
VertexArrayId* arrays = stack->pop<VertexArrayId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glDeleteVertexArraysOES(%d, %p)\n", count, arrays);
if (glDeleteVertexArraysOES != nullptr) {
glDeleteVertexArraysOES(count, arrays);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteVertexArraysOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDeleteVertexArraysOES\n");
return false;
}
}
bool callGlIsVertexArrayOES(Stack* stack, bool pushReturn) {
VertexArrayId array = stack->pop<VertexArrayId>();
if (stack->isValid()) {
CAZE_INFO("glIsVertexArrayOES(%u)\n", array);
if (glIsVertexArrayOES != nullptr) {
bool* return_value = glIsVertexArrayOES(array);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<bool*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glIsVertexArrayOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glIsVertexArrayOES\n");
return false;
}
}
bool callGlEGLImageTargetTexture2DOES(Stack* stack, bool pushReturn) {
ImageOES image = stack->pop<ImageOES>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glEGLImageTargetTexture2DOES(%u, %p)\n", target, image);
if (glEGLImageTargetTexture2DOES != nullptr) {
glEGLImageTargetTexture2DOES(target, image);
} else {
CAZE_WARNING("Attempted to call unsupported function glEGLImageTargetTexture2DOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glEGLImageTargetTexture2DOES\n");
return false;
}
}
bool callGlEGLImageTargetRenderbufferStorageOES(Stack* stack, bool pushReturn) {
TexturePointer image = stack->pop<TexturePointer>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glEGLImageTargetRenderbufferStorageOES(%u, %p)\n", target, image);
if (glEGLImageTargetRenderbufferStorageOES != nullptr) {
glEGLImageTargetRenderbufferStorageOES(target, image);
} else {
CAZE_WARNING(
"Attempted to call unsupported function "
"glEGLImageTargetRenderbufferStorageOES\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glEGLImageTargetRenderbufferStorageOES\n");
return false;
}
}
bool callGlGetGraphicsResetStatusEXT(Stack* stack, bool pushReturn) {
if (stack->isValid()) {
CAZE_INFO("glGetGraphicsResetStatusEXT()\n");
if (glGetGraphicsResetStatusEXT != nullptr) {
uint32_t* return_value = glGetGraphicsResetStatusEXT();
CAZE_INFO("Returned: %u\n", return_value);
if (pushReturn) {
stack->push<uint32_t*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glGetGraphicsResetStatusEXT\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetGraphicsResetStatusEXT\n");
return false;
}
}
bool callGlBindAttribLocation(Stack* stack, bool pushReturn) {
const char* name = stack->pop<const char*>();
AttributeLocation location = stack->pop<AttributeLocation>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glBindAttribLocation(%u, %d, %s)\n", program, location, name);
if (glBindAttribLocation != nullptr) {
glBindAttribLocation(program, location, name);
} else {
CAZE_WARNING("Attempted to call unsupported function glBindAttribLocation\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBindAttribLocation\n");
return false;
}
}
bool callGlBlendFunc(Stack* stack, bool pushReturn) {
uint32_t dst_factor = stack->pop<uint32_t>();
uint32_t src_factor = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBlendFunc(%u, %u)\n", src_factor, dst_factor);
if (glBlendFunc != nullptr) {
glBlendFunc(src_factor, dst_factor);
} else {
CAZE_WARNING("Attempted to call unsupported function glBlendFunc\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBlendFunc\n");
return false;
}
}
bool callGlBlendFuncSeparate(Stack* stack, bool pushReturn) {
uint32_t dst_factor_alpha = stack->pop<uint32_t>();
uint32_t src_factor_alpha = stack->pop<uint32_t>();
uint32_t dst_factor_rgb = stack->pop<uint32_t>();
uint32_t src_factor_rgb = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBlendFuncSeparate(%u, %u, %u, %u)\n", src_factor_rgb, dst_factor_rgb,
src_factor_alpha, dst_factor_alpha);
if (glBlendFuncSeparate != nullptr) {
glBlendFuncSeparate(src_factor_rgb, dst_factor_rgb, src_factor_alpha, dst_factor_alpha);
} else {
CAZE_WARNING("Attempted to call unsupported function glBlendFuncSeparate\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBlendFuncSeparate\n");
return false;
}
}
bool callGlBlendEquation(Stack* stack, bool pushReturn) {
uint32_t equation = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBlendEquation(%u)\n", equation);
if (glBlendEquation != nullptr) {
glBlendEquation(equation);
} else {
CAZE_WARNING("Attempted to call unsupported function glBlendEquation\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBlendEquation\n");
return false;
}
}
bool callGlBlendEquationSeparate(Stack* stack, bool pushReturn) {
uint32_t alpha = stack->pop<uint32_t>();
uint32_t rgb = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBlendEquationSeparate(%u, %u)\n", rgb, alpha);
if (glBlendEquationSeparate != nullptr) {
glBlendEquationSeparate(rgb, alpha);
} else {
CAZE_WARNING("Attempted to call unsupported function glBlendEquationSeparate\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBlendEquationSeparate\n");
return false;
}
}
bool callGlBlendColor(Stack* stack, bool pushReturn) {
float alpha = stack->pop<float>();
float blue = stack->pop<float>();
float green = stack->pop<float>();
float red = stack->pop<float>();
if (stack->isValid()) {
CAZE_INFO("glBlendColor(%f, %f, %f, %f)\n", red, green, blue, alpha);
if (glBlendColor != nullptr) {
glBlendColor(red, green, blue, alpha);
} else {
CAZE_WARNING("Attempted to call unsupported function glBlendColor\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBlendColor\n");
return false;
}
}
bool callGlEnableVertexAttribArray(Stack* stack, bool pushReturn) {
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glEnableVertexAttribArray(%d)\n", location);
if (glEnableVertexAttribArray != nullptr) {
glEnableVertexAttribArray(location);
} else {
CAZE_WARNING("Attempted to call unsupported function glEnableVertexAttribArray\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glEnableVertexAttribArray\n");
return false;
}
}
bool callGlDisableVertexAttribArray(Stack* stack, bool pushReturn) {
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glDisableVertexAttribArray(%d)\n", location);
if (glDisableVertexAttribArray != nullptr) {
glDisableVertexAttribArray(location);
} else {
CAZE_WARNING("Attempted to call unsupported function glDisableVertexAttribArray\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDisableVertexAttribArray\n");
return false;
}
}
bool callGlVertexAttribPointer(Stack* stack, bool pushReturn) {
VertexPointer data = stack->pop<VertexPointer>();
int32_t stride = stack->pop<int32_t>();
bool normalized = stack->pop<bool>();
uint32_t type = stack->pop<uint32_t>();
uint32_t size = stack->pop<uint32_t>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttribPointer(%d, %u, %u, %d, %d, %p)\n", location, size, type,
normalized, stride, data);
if (glVertexAttribPointer != nullptr) {
glVertexAttribPointer(location, size, type, normalized, stride, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttribPointer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttribPointer\n");
return false;
}
}
bool callGlGetActiveAttrib(Stack* stack, bool pushReturn) {
const char* name = stack->pop<const char*>();
uint32_t* type = stack->pop<uint32_t*>();
int32_t* vector_count = stack->pop<int32_t*>();
int32_t* buffer_bytes_written = stack->pop<int32_t*>();
int32_t buffer_size = stack->pop<int32_t>();
AttributeLocation location = stack->pop<AttributeLocation>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetActiveAttrib(%u, %d, %d, %p, %p, %p, %p)\n", program, location, buffer_size,
buffer_bytes_written, vector_count, type, name);
if (glGetActiveAttrib != nullptr) {
glGetActiveAttrib(program, location, buffer_size, buffer_bytes_written, vector_count,
type, name);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetActiveAttrib\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetActiveAttrib\n");
return false;
}
}
bool callGlGetActiveUniform(Stack* stack, bool pushReturn) {
const char* name = stack->pop<const char*>();
uint32_t* type = stack->pop<uint32_t*>();
int32_t* size = stack->pop<int32_t*>();
int32_t* buffer_bytes_written = stack->pop<int32_t*>();
int32_t buffer_size = stack->pop<int32_t>();
int32_t location = stack->pop<int32_t>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetActiveUniform(%u, %d, %d, %p, %p, %p, %p)\n", program, location,
buffer_size, buffer_bytes_written, size, type, name);
if (glGetActiveUniform != nullptr) {
glGetActiveUniform(program, location, buffer_size, buffer_bytes_written, size, type,
name);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetActiveUniform\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetActiveUniform\n");
return false;
}
}
bool callGlGetError(Stack* stack, bool pushReturn) {
if (stack->isValid()) {
CAZE_INFO("glGetError()\n");
if (glGetError != nullptr) {
uint32_t* return_value = glGetError();
CAZE_INFO("Returned: %u\n", return_value);
if (pushReturn) {
stack->push<uint32_t*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glGetError\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetError\n");
return false;
}
}
bool callGlGetProgramiv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
uint32_t parameter = stack->pop<uint32_t>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetProgramiv(%u, %u, %p)\n", program, parameter, value);
if (glGetProgramiv != nullptr) {
glGetProgramiv(program, parameter, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetProgramiv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetProgramiv\n");
return false;
}
}
bool callGlGetShaderiv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
uint32_t parameter = stack->pop<uint32_t>();
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glGetShaderiv(%u, %u, %p)\n", shader, parameter, value);
if (glGetShaderiv != nullptr) {
glGetShaderiv(shader, parameter, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetShaderiv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetShaderiv\n");
return false;
}
}
bool callGlGetUniformLocation(Stack* stack, bool pushReturn) {
const char* name = stack->pop<const char*>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetUniformLocation(%u, %s)\n", program, name);
if (glGetUniformLocation != nullptr) {
UniformLocation* return_value = glGetUniformLocation(program, name);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<UniformLocation*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glGetUniformLocation\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetUniformLocation\n");
return false;
}
}
bool callGlGetAttribLocation(Stack* stack, bool pushReturn) {
const char* name = stack->pop<const char*>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetAttribLocation(%u, %s)\n", program, name);
if (glGetAttribLocation != nullptr) {
AttributeLocation* return_value = glGetAttribLocation(program, name);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<AttributeLocation*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glGetAttribLocation\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetAttribLocation\n");
return false;
}
}
bool callGlPixelStorei(Stack* stack, bool pushReturn) {
int32_t value = stack->pop<int32_t>();
uint32_t parameter = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glPixelStorei(%u, %d)\n", parameter, value);
if (glPixelStorei != nullptr) {
glPixelStorei(parameter, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glPixelStorei\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glPixelStorei\n");
return false;
}
}
bool callGlTexParameteri(Stack* stack, bool pushReturn) {
int32_t value = stack->pop<int32_t>();
uint32_t parameter = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexParameteri(%u, %u, %d)\n", target, parameter, value);
if (glTexParameteri != nullptr) {
glTexParameteri(target, parameter, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexParameteri\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexParameteri\n");
return false;
}
}
bool callGlTexParameterf(Stack* stack, bool pushReturn) {
float value = stack->pop<float>();
uint32_t parameter = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexParameterf(%u, %u, %f)\n", target, parameter, value);
if (glTexParameterf != nullptr) {
glTexParameterf(target, parameter, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexParameterf\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexParameterf\n");
return false;
}
}
bool callGlGetTexParameteriv(Stack* stack, bool pushReturn) {
int32_t* values = stack->pop<int32_t*>();
uint32_t parameter = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glGetTexParameteriv(%u, %u, %p)\n", target, parameter, values);
if (glGetTexParameteriv != nullptr) {
glGetTexParameteriv(target, parameter, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetTexParameteriv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetTexParameteriv\n");
return false;
}
}
bool callGlGetTexParameterfv(Stack* stack, bool pushReturn) {
float* values = stack->pop<float*>();
uint32_t parameter = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glGetTexParameterfv(%u, %u, %p)\n", target, parameter, values);
if (glGetTexParameterfv != nullptr) {
glGetTexParameterfv(target, parameter, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetTexParameterfv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetTexParameterfv\n");
return false;
}
}
bool callGlUniform1i(Stack* stack, bool pushReturn) {
int32_t value = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform1i(%d, %d)\n", location, value);
if (glUniform1i != nullptr) {
glUniform1i(location, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform1i\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform1i\n");
return false;
}
}
bool callGlUniform2i(Stack* stack, bool pushReturn) {
int32_t value1 = stack->pop<int32_t>();
int32_t value0 = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform2i(%d, %d, %d)\n", location, value0, value1);
if (glUniform2i != nullptr) {
glUniform2i(location, value0, value1);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform2i\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform2i\n");
return false;
}
}
bool callGlUniform3i(Stack* stack, bool pushReturn) {
int32_t value2 = stack->pop<int32_t>();
int32_t value1 = stack->pop<int32_t>();
int32_t value0 = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform3i(%d, %d, %d, %d)\n", location, value0, value1, value2);
if (glUniform3i != nullptr) {
glUniform3i(location, value0, value1, value2);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform3i\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform3i\n");
return false;
}
}
bool callGlUniform4i(Stack* stack, bool pushReturn) {
int32_t value3 = stack->pop<int32_t>();
int32_t value2 = stack->pop<int32_t>();
int32_t value1 = stack->pop<int32_t>();
int32_t value0 = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform4i(%d, %d, %d, %d, %d)\n", location, value0, value1, value2, value3);
if (glUniform4i != nullptr) {
glUniform4i(location, value0, value1, value2, value3);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform4i\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform4i\n");
return false;
}
}
bool callGlUniform1iv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform1iv(%d, %d, %p)\n", location, count, value);
if (glUniform1iv != nullptr) {
glUniform1iv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform1iv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform1iv\n");
return false;
}
}
bool callGlUniform2iv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform2iv(%d, %d, %p)\n", location, count, value);
if (glUniform2iv != nullptr) {
glUniform2iv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform2iv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform2iv\n");
return false;
}
}
bool callGlUniform3iv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform3iv(%d, %d, %p)\n", location, count, value);
if (glUniform3iv != nullptr) {
glUniform3iv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform3iv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform3iv\n");
return false;
}
}
bool callGlUniform4iv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform4iv(%d, %d, %p)\n", location, count, value);
if (glUniform4iv != nullptr) {
glUniform4iv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform4iv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform4iv\n");
return false;
}
}
bool callGlUniform1f(Stack* stack, bool pushReturn) {
float value = stack->pop<float>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform1f(%d, %f)\n", location, value);
if (glUniform1f != nullptr) {
glUniform1f(location, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform1f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform1f\n");
return false;
}
}
bool callGlUniform2f(Stack* stack, bool pushReturn) {
float value1 = stack->pop<float>();
float value0 = stack->pop<float>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform2f(%d, %f, %f)\n", location, value0, value1);
if (glUniform2f != nullptr) {
glUniform2f(location, value0, value1);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform2f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform2f\n");
return false;
}
}
bool callGlUniform3f(Stack* stack, bool pushReturn) {
float value2 = stack->pop<float>();
float value1 = stack->pop<float>();
float value0 = stack->pop<float>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform3f(%d, %f, %f, %f)\n", location, value0, value1, value2);
if (glUniform3f != nullptr) {
glUniform3f(location, value0, value1, value2);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform3f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform3f\n");
return false;
}
}
bool callGlUniform4f(Stack* stack, bool pushReturn) {
float value3 = stack->pop<float>();
float value2 = stack->pop<float>();
float value1 = stack->pop<float>();
float value0 = stack->pop<float>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform4f(%d, %f, %f, %f, %f)\n", location, value0, value1, value2, value3);
if (glUniform4f != nullptr) {
glUniform4f(location, value0, value1, value2, value3);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform4f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform4f\n");
return false;
}
}
bool callGlUniform1fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform1fv(%d, %d, %p)\n", location, count, value);
if (glUniform1fv != nullptr) {
glUniform1fv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform1fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform1fv\n");
return false;
}
}
bool callGlUniform2fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform2fv(%d, %d, %p)\n", location, count, value);
if (glUniform2fv != nullptr) {
glUniform2fv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform2fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform2fv\n");
return false;
}
}
bool callGlUniform3fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform3fv(%d, %d, %p)\n", location, count, value);
if (glUniform3fv != nullptr) {
glUniform3fv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform3fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform3fv\n");
return false;
}
}
bool callGlUniform4fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniform4fv(%d, %d, %p)\n", location, count, value);
if (glUniform4fv != nullptr) {
glUniform4fv(location, count, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniform4fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniform4fv\n");
return false;
}
}
bool callGlUniformMatrix2fv(Stack* stack, bool pushReturn) {
float* values = stack->pop<float*>();
bool transpose = stack->pop<bool>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniformMatrix2fv(%d, %d, %d, %p)\n", location, count, transpose, values);
if (glUniformMatrix2fv != nullptr) {
glUniformMatrix2fv(location, count, transpose, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniformMatrix2fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniformMatrix2fv\n");
return false;
}
}
bool callGlUniformMatrix3fv(Stack* stack, bool pushReturn) {
float* values = stack->pop<float*>();
bool transpose = stack->pop<bool>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniformMatrix3fv(%d, %d, %d, %p)\n", location, count, transpose, values);
if (glUniformMatrix3fv != nullptr) {
glUniformMatrix3fv(location, count, transpose, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniformMatrix3fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniformMatrix3fv\n");
return false;
}
}
bool callGlUniformMatrix4fv(Stack* stack, bool pushReturn) {
float* values = stack->pop<float*>();
bool transpose = stack->pop<bool>();
int32_t count = stack->pop<int32_t>();
UniformLocation location = stack->pop<UniformLocation>();
if (stack->isValid()) {
CAZE_INFO("glUniformMatrix4fv(%d, %d, %d, %p)\n", location, count, transpose, values);
if (glUniformMatrix4fv != nullptr) {
glUniformMatrix4fv(location, count, transpose, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glUniformMatrix4fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glUniformMatrix4fv\n");
return false;
}
}
bool callGlGetUniformfv(Stack* stack, bool pushReturn) {
float* values = stack->pop<float*>();
UniformLocation location = stack->pop<UniformLocation>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetUniformfv(%u, %d, %p)\n", program, location, values);
if (glGetUniformfv != nullptr) {
glGetUniformfv(program, location, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetUniformfv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetUniformfv\n");
return false;
}
}
bool callGlGetUniformiv(Stack* stack, bool pushReturn) {
int32_t* values = stack->pop<int32_t*>();
UniformLocation location = stack->pop<UniformLocation>();
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glGetUniformiv(%u, %d, %p)\n", program, location, values);
if (glGetUniformiv != nullptr) {
glGetUniformiv(program, location, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetUniformiv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetUniformiv\n");
return false;
}
}
bool callGlVertexAttrib1f(Stack* stack, bool pushReturn) {
float value0 = stack->pop<float>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib1f(%d, %f)\n", location, value0);
if (glVertexAttrib1f != nullptr) {
glVertexAttrib1f(location, value0);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib1f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib1f\n");
return false;
}
}
bool callGlVertexAttrib2f(Stack* stack, bool pushReturn) {
float value1 = stack->pop<float>();
float value0 = stack->pop<float>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib2f(%d, %f, %f)\n", location, value0, value1);
if (glVertexAttrib2f != nullptr) {
glVertexAttrib2f(location, value0, value1);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib2f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib2f\n");
return false;
}
}
bool callGlVertexAttrib3f(Stack* stack, bool pushReturn) {
float value2 = stack->pop<float>();
float value1 = stack->pop<float>();
float value0 = stack->pop<float>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib3f(%d, %f, %f, %f)\n", location, value0, value1, value2);
if (glVertexAttrib3f != nullptr) {
glVertexAttrib3f(location, value0, value1, value2);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib3f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib3f\n");
return false;
}
}
bool callGlVertexAttrib4f(Stack* stack, bool pushReturn) {
float value3 = stack->pop<float>();
float value2 = stack->pop<float>();
float value1 = stack->pop<float>();
float value0 = stack->pop<float>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib4f(%d, %f, %f, %f, %f)\n", location, value0, value1, value2,
value3);
if (glVertexAttrib4f != nullptr) {
glVertexAttrib4f(location, value0, value1, value2, value3);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib4f\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib4f\n");
return false;
}
}
bool callGlVertexAttrib1fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib1fv(%d, %p)\n", location, value);
if (glVertexAttrib1fv != nullptr) {
glVertexAttrib1fv(location, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib1fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib1fv\n");
return false;
}
}
bool callGlVertexAttrib2fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib2fv(%d, %p)\n", location, value);
if (glVertexAttrib2fv != nullptr) {
glVertexAttrib2fv(location, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib2fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib2fv\n");
return false;
}
}
bool callGlVertexAttrib3fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib3fv(%d, %p)\n", location, value);
if (glVertexAttrib3fv != nullptr) {
glVertexAttrib3fv(location, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib3fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib3fv\n");
return false;
}
}
bool callGlVertexAttrib4fv(Stack* stack, bool pushReturn) {
float* value = stack->pop<float*>();
AttributeLocation location = stack->pop<AttributeLocation>();
if (stack->isValid()) {
CAZE_INFO("glVertexAttrib4fv(%d, %p)\n", location, value);
if (glVertexAttrib4fv != nullptr) {
glVertexAttrib4fv(location, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glVertexAttrib4fv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glVertexAttrib4fv\n");
return false;
}
}
bool callGlGetShaderPrecisionFormat(Stack* stack, bool pushReturn) {
int32_t* precision = stack->pop<int32_t*>();
int32_t* range = stack->pop<int32_t*>();
uint32_t precision_type = stack->pop<uint32_t>();
uint32_t shader_type = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glGetShaderPrecisionFormat(%u, %u, %p, %p)\n", shader_type, precision_type,
range, precision);
if (glGetShaderPrecisionFormat != nullptr) {
glGetShaderPrecisionFormat(shader_type, precision_type, range, precision);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetShaderPrecisionFormat\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetShaderPrecisionFormat\n");
return false;
}
}
bool callGlDepthMask(Stack* stack, bool pushReturn) {
bool enabled = stack->pop<bool>();
if (stack->isValid()) {
CAZE_INFO("glDepthMask(%d)\n", enabled);
if (glDepthMask != nullptr) {
glDepthMask(enabled);
} else {
CAZE_WARNING("Attempted to call unsupported function glDepthMask\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDepthMask\n");
return false;
}
}
bool callGlDepthFunc(Stack* stack, bool pushReturn) {
uint32_t function = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glDepthFunc(%u)\n", function);
if (glDepthFunc != nullptr) {
glDepthFunc(function);
} else {
CAZE_WARNING("Attempted to call unsupported function glDepthFunc\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDepthFunc\n");
return false;
}
}
bool callGlDepthRangef(Stack* stack, bool pushReturn) {
float far = stack->pop<float>();
float near = stack->pop<float>();
if (stack->isValid()) {
CAZE_INFO("glDepthRangef(%f, %f)\n", near, far);
if (glDepthRangef != nullptr) {
glDepthRangef(near, far);
} else {
CAZE_WARNING("Attempted to call unsupported function glDepthRangef\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDepthRangef\n");
return false;
}
}
bool callGlColorMask(Stack* stack, bool pushReturn) {
bool alpha = stack->pop<bool>();
bool blue = stack->pop<bool>();
bool green = stack->pop<bool>();
bool red = stack->pop<bool>();
if (stack->isValid()) {
CAZE_INFO("glColorMask(%d, %d, %d, %d)\n", red, green, blue, alpha);
if (glColorMask != nullptr) {
glColorMask(red, green, blue, alpha);
} else {
CAZE_WARNING("Attempted to call unsupported function glColorMask\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glColorMask\n");
return false;
}
}
bool callGlStencilMask(Stack* stack, bool pushReturn) {
uint32_t mask = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glStencilMask(%u)\n", mask);
if (glStencilMask != nullptr) {
glStencilMask(mask);
} else {
CAZE_WARNING("Attempted to call unsupported function glStencilMask\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glStencilMask\n");
return false;
}
}
bool callGlStencilMaskSeparate(Stack* stack, bool pushReturn) {
uint32_t mask = stack->pop<uint32_t>();
uint32_t face = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glStencilMaskSeparate(%u, %u)\n", face, mask);
if (glStencilMaskSeparate != nullptr) {
glStencilMaskSeparate(face, mask);
} else {
CAZE_WARNING("Attempted to call unsupported function glStencilMaskSeparate\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glStencilMaskSeparate\n");
return false;
}
}
bool callGlStencilFuncSeparate(Stack* stack, bool pushReturn) {
int32_t mask = stack->pop<int32_t>();
int32_t reference_value = stack->pop<int32_t>();
uint32_t function = stack->pop<uint32_t>();
uint32_t face = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glStencilFuncSeparate(%u, %u, %d, %d)\n", face, function, reference_value, mask);
if (glStencilFuncSeparate != nullptr) {
glStencilFuncSeparate(face, function, reference_value, mask);
} else {
CAZE_WARNING("Attempted to call unsupported function glStencilFuncSeparate\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glStencilFuncSeparate\n");
return false;
}
}
bool callGlStencilOpSeparate(Stack* stack, bool pushReturn) {
uint32_t stencil_pass_depth_pass = stack->pop<uint32_t>();
uint32_t stencil_pass_depth_fail = stack->pop<uint32_t>();
uint32_t stencil_fail = stack->pop<uint32_t>();
uint32_t face = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glStencilOpSeparate(%u, %u, %u, %u)\n", face, stencil_fail,
stencil_pass_depth_fail, stencil_pass_depth_pass);
if (glStencilOpSeparate != nullptr) {
glStencilOpSeparate(face, stencil_fail, stencil_pass_depth_fail,
stencil_pass_depth_pass);
} else {
CAZE_WARNING("Attempted to call unsupported function glStencilOpSeparate\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glStencilOpSeparate\n");
return false;
}
}
bool callGlFrontFace(Stack* stack, bool pushReturn) {
uint32_t orientation = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glFrontFace(%u)\n", orientation);
if (glFrontFace != nullptr) {
glFrontFace(orientation);
} else {
CAZE_WARNING("Attempted to call unsupported function glFrontFace\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glFrontFace\n");
return false;
}
}
bool callGlViewport(Stack* stack, bool pushReturn) {
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t y = stack->pop<int32_t>();
int32_t x = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glViewport(%d, %d, %d, %d)\n", x, y, width, height);
if (glViewport != nullptr) {
glViewport(x, y, width, height);
} else {
CAZE_WARNING("Attempted to call unsupported function glViewport\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glViewport\n");
return false;
}
}
bool callGlScissor(Stack* stack, bool pushReturn) {
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t y = stack->pop<int32_t>();
int32_t x = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glScissor(%d, %d, %d, %d)\n", x, y, width, height);
if (glScissor != nullptr) {
glScissor(x, y, width, height);
} else {
CAZE_WARNING("Attempted to call unsupported function glScissor\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glScissor\n");
return false;
}
}
bool callGlActiveTexture(Stack* stack, bool pushReturn) {
uint32_t unit = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glActiveTexture(%u)\n", unit);
if (glActiveTexture != nullptr) {
glActiveTexture(unit);
} else {
CAZE_WARNING("Attempted to call unsupported function glActiveTexture\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glActiveTexture\n");
return false;
}
}
bool callGlGenTextures(Stack* stack, bool pushReturn) {
TextureId* textures = stack->pop<TextureId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glGenTextures(%d, %p)\n", count, textures);
if (glGenTextures != nullptr) {
glGenTextures(count, textures);
} else {
CAZE_WARNING("Attempted to call unsupported function glGenTextures\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGenTextures\n");
return false;
}
}
bool callGlDeleteTextures(Stack* stack, bool pushReturn) {
TextureId* textures = stack->pop<TextureId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glDeleteTextures(%d, %p)\n", count, textures);
if (glDeleteTextures != nullptr) {
glDeleteTextures(count, textures);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteTextures\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDeleteTextures\n");
return false;
}
}
bool callGlIsTexture(Stack* stack, bool pushReturn) {
TextureId texture = stack->pop<TextureId>();
if (stack->isValid()) {
CAZE_INFO("glIsTexture(%u)\n", texture);
if (glIsTexture != nullptr) {
bool* return_value = glIsTexture(texture);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<bool*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glIsTexture\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glIsTexture\n");
return false;
}
}
bool callGlBindTexture(Stack* stack, bool pushReturn) {
TextureId texture = stack->pop<TextureId>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBindTexture(%u, %u)\n", target, texture);
if (glBindTexture != nullptr) {
glBindTexture(target, texture);
} else {
CAZE_WARNING("Attempted to call unsupported function glBindTexture\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBindTexture\n");
return false;
}
}
bool callGlTexImage2D(Stack* stack, bool pushReturn) {
TexturePointer data = stack->pop<TexturePointer>();
uint32_t type = stack->pop<uint32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t border = stack->pop<int32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t internal_format = stack->pop<uint32_t>();
int32_t level = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexImage2D(%u, %d, %u, %d, %d, %d, %u, %u, %p)\n", target, level,
internal_format, width, height, border, format, type, data);
if (glTexImage2D != nullptr) {
glTexImage2D(target, level, internal_format, width, height, border, format, type, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexImage2D\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexImage2D\n");
return false;
}
}
bool callGlTexSubImage2D(Stack* stack, bool pushReturn) {
TexturePointer data = stack->pop<TexturePointer>();
uint32_t type = stack->pop<uint32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t yoffset = stack->pop<int32_t>();
int32_t xoffset = stack->pop<int32_t>();
int32_t level = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glTexSubImage2D(%u, %d, %d, %d, %d, %d, %u, %u, %p)\n", target, level, xoffset,
yoffset, width, height, format, type, data);
if (glTexSubImage2D != nullptr) {
glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glTexSubImage2D\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glTexSubImage2D\n");
return false;
}
}
bool callGlCopyTexImage2D(Stack* stack, bool pushReturn) {
int32_t border = stack->pop<int32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t y = stack->pop<int32_t>();
int32_t x = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t level = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glCopyTexImage2D(%u, %d, %u, %d, %d, %d, %d, %d)\n", target, level, format, x, y,
width, height, border);
if (glCopyTexImage2D != nullptr) {
glCopyTexImage2D(target, level, format, x, y, width, height, border);
} else {
CAZE_WARNING("Attempted to call unsupported function glCopyTexImage2D\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCopyTexImage2D\n");
return false;
}
}
bool callGlCopyTexSubImage2D(Stack* stack, bool pushReturn) {
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t y = stack->pop<int32_t>();
int32_t x = stack->pop<int32_t>();
int32_t yoffset = stack->pop<int32_t>();
int32_t xoffset = stack->pop<int32_t>();
int32_t level = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glCopyTexSubImage2D(%u, %d, %d, %d, %d, %d, %d, %d)\n", target, level, xoffset,
yoffset, x, y, width, height);
if (glCopyTexSubImage2D != nullptr) {
glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
} else {
CAZE_WARNING("Attempted to call unsupported function glCopyTexSubImage2D\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCopyTexSubImage2D\n");
return false;
}
}
bool callGlCompressedTexImage2D(Stack* stack, bool pushReturn) {
TexturePointer data = stack->pop<TexturePointer>();
int32_t image_size = stack->pop<int32_t>();
int32_t border = stack->pop<int32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t level = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glCompressedTexImage2D(%u, %d, %u, %d, %d, %d, %d, %p)\n", target, level, format,
width, height, border, image_size, data);
if (glCompressedTexImage2D != nullptr) {
glCompressedTexImage2D(target, level, format, width, height, border, image_size, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glCompressedTexImage2D\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCompressedTexImage2D\n");
return false;
}
}
bool callGlCompressedTexSubImage2D(Stack* stack, bool pushReturn) {
TexturePointer data = stack->pop<TexturePointer>();
int32_t image_size = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t yoffset = stack->pop<int32_t>();
int32_t xoffset = stack->pop<int32_t>();
int32_t level = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glCompressedTexSubImage2D(%u, %d, %d, %d, %d, %d, %u, %d, %p)\n", target, level,
xoffset, yoffset, width, height, format, image_size, data);
if (glCompressedTexSubImage2D != nullptr) {
glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format,
image_size, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glCompressedTexSubImage2D\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCompressedTexSubImage2D\n");
return false;
}
}
bool callGlGenerateMipmap(Stack* stack, bool pushReturn) {
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glGenerateMipmap(%u)\n", target);
if (glGenerateMipmap != nullptr) {
glGenerateMipmap(target);
} else {
CAZE_WARNING("Attempted to call unsupported function glGenerateMipmap\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGenerateMipmap\n");
return false;
}
}
bool callGlReadPixels(Stack* stack, bool pushReturn) {
void* data = stack->pop<void*>();
uint32_t type = stack->pop<uint32_t>();
uint32_t format = stack->pop<uint32_t>();
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
int32_t y = stack->pop<int32_t>();
int32_t x = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glReadPixels(%d, %d, %d, %d, %u, %u, %p)\n", x, y, width, height, format, type,
data);
if (glReadPixels != nullptr) {
glReadPixels(x, y, width, height, format, type, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glReadPixels\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glReadPixels\n");
return false;
}
}
bool callGlGenFramebuffers(Stack* stack, bool pushReturn) {
FramebufferId* framebuffers = stack->pop<FramebufferId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glGenFramebuffers(%d, %p)\n", count, framebuffers);
if (glGenFramebuffers != nullptr) {
glGenFramebuffers(count, framebuffers);
} else {
CAZE_WARNING("Attempted to call unsupported function glGenFramebuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGenFramebuffers\n");
return false;
}
}
bool callGlBindFramebuffer(Stack* stack, bool pushReturn) {
FramebufferId framebuffer = stack->pop<FramebufferId>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBindFramebuffer(%u, %u)\n", target, framebuffer);
if (glBindFramebuffer != nullptr) {
glBindFramebuffer(target, framebuffer);
} else {
CAZE_WARNING("Attempted to call unsupported function glBindFramebuffer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBindFramebuffer\n");
return false;
}
}
bool callGlCheckFramebufferStatus(Stack* stack, bool pushReturn) {
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glCheckFramebufferStatus(%u)\n", target);
if (glCheckFramebufferStatus != nullptr) {
uint32_t* return_value = glCheckFramebufferStatus(target);
CAZE_INFO("Returned: %u\n", return_value);
if (pushReturn) {
stack->push<uint32_t*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glCheckFramebufferStatus\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCheckFramebufferStatus\n");
return false;
}
}
bool callGlDeleteFramebuffers(Stack* stack, bool pushReturn) {
FramebufferId* framebuffers = stack->pop<FramebufferId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glDeleteFramebuffers(%d, %p)\n", count, framebuffers);
if (glDeleteFramebuffers != nullptr) {
glDeleteFramebuffers(count, framebuffers);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteFramebuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDeleteFramebuffers\n");
return false;
}
}
bool callGlIsFramebuffer(Stack* stack, bool pushReturn) {
FramebufferId framebuffer = stack->pop<FramebufferId>();
if (stack->isValid()) {
CAZE_INFO("glIsFramebuffer(%u)\n", framebuffer);
if (glIsFramebuffer != nullptr) {
bool* return_value = glIsFramebuffer(framebuffer);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<bool*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glIsFramebuffer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glIsFramebuffer\n");
return false;
}
}
bool callGlGenRenderbuffers(Stack* stack, bool pushReturn) {
RenderbufferId* renderbuffers = stack->pop<RenderbufferId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glGenRenderbuffers(%d, %p)\n", count, renderbuffers);
if (glGenRenderbuffers != nullptr) {
glGenRenderbuffers(count, renderbuffers);
} else {
CAZE_WARNING("Attempted to call unsupported function glGenRenderbuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGenRenderbuffers\n");
return false;
}
}
bool callGlBindRenderbuffer(Stack* stack, bool pushReturn) {
RenderbufferId renderbuffer = stack->pop<RenderbufferId>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBindRenderbuffer(%u, %u)\n", target, renderbuffer);
if (glBindRenderbuffer != nullptr) {
glBindRenderbuffer(target, renderbuffer);
} else {
CAZE_WARNING("Attempted to call unsupported function glBindRenderbuffer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBindRenderbuffer\n");
return false;
}
}
bool callGlRenderbufferStorage(Stack* stack, bool pushReturn) {
int32_t height = stack->pop<int32_t>();
int32_t width = stack->pop<int32_t>();
uint32_t format = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glRenderbufferStorage(%u, %u, %d, %d)\n", target, format, width, height);
if (glRenderbufferStorage != nullptr) {
glRenderbufferStorage(target, format, width, height);
} else {
CAZE_WARNING("Attempted to call unsupported function glRenderbufferStorage\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glRenderbufferStorage\n");
return false;
}
}
bool callGlDeleteRenderbuffers(Stack* stack, bool pushReturn) {
RenderbufferId* renderbuffers = stack->pop<RenderbufferId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glDeleteRenderbuffers(%d, %p)\n", count, renderbuffers);
if (glDeleteRenderbuffers != nullptr) {
glDeleteRenderbuffers(count, renderbuffers);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteRenderbuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDeleteRenderbuffers\n");
return false;
}
}
bool callGlIsRenderbuffer(Stack* stack, bool pushReturn) {
RenderbufferId renderbuffer = stack->pop<RenderbufferId>();
if (stack->isValid()) {
CAZE_INFO("glIsRenderbuffer(%u)\n", renderbuffer);
if (glIsRenderbuffer != nullptr) {
bool* return_value = glIsRenderbuffer(renderbuffer);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<bool*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glIsRenderbuffer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glIsRenderbuffer\n");
return false;
}
}
bool callGlGetRenderbufferParameteriv(Stack* stack, bool pushReturn) {
int32_t* values = stack->pop<int32_t*>();
uint32_t parameter = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glGetRenderbufferParameteriv(%u, %u, %p)\n", target, parameter, values);
if (glGetRenderbufferParameteriv != nullptr) {
glGetRenderbufferParameteriv(target, parameter, values);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetRenderbufferParameteriv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetRenderbufferParameteriv\n");
return false;
}
}
bool callGlGenBuffers(Stack* stack, bool pushReturn) {
BufferId* buffers = stack->pop<BufferId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glGenBuffers(%d, %p)\n", count, buffers);
if (glGenBuffers != nullptr) {
glGenBuffers(count, buffers);
} else {
CAZE_WARNING("Attempted to call unsupported function glGenBuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGenBuffers\n");
return false;
}
}
bool callGlBindBuffer(Stack* stack, bool pushReturn) {
BufferId buffer = stack->pop<BufferId>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBindBuffer(%u, %u)\n", target, buffer);
if (glBindBuffer != nullptr) {
glBindBuffer(target, buffer);
} else {
CAZE_WARNING("Attempted to call unsupported function glBindBuffer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBindBuffer\n");
return false;
}
}
bool callGlBufferData(Stack* stack, bool pushReturn) {
uint32_t usage = stack->pop<uint32_t>();
BufferDataPointer data = stack->pop<BufferDataPointer>();
int32_t size = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBufferData(%u, %d, %p, %u)\n", target, size, data, usage);
if (glBufferData != nullptr) {
glBufferData(target, size, data, usage);
} else {
CAZE_WARNING("Attempted to call unsupported function glBufferData\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBufferData\n");
return false;
}
}
bool callGlBufferSubData(Stack* stack, bool pushReturn) {
void* data = stack->pop<void*>();
int32_t size = stack->pop<int32_t>();
int32_t offset = stack->pop<int32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glBufferSubData(%u, %d, %d, %p)\n", target, offset, size, data);
if (glBufferSubData != nullptr) {
glBufferSubData(target, offset, size, data);
} else {
CAZE_WARNING("Attempted to call unsupported function glBufferSubData\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glBufferSubData\n");
return false;
}
}
bool callGlDeleteBuffers(Stack* stack, bool pushReturn) {
BufferId* buffers = stack->pop<BufferId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glDeleteBuffers(%d, %p)\n", count, buffers);
if (glDeleteBuffers != nullptr) {
glDeleteBuffers(count, buffers);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteBuffers\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDeleteBuffers\n");
return false;
}
}
bool callGlIsBuffer(Stack* stack, bool pushReturn) {
BufferId buffer = stack->pop<BufferId>();
if (stack->isValid()) {
CAZE_INFO("glIsBuffer(%u)\n", buffer);
if (glIsBuffer != nullptr) {
bool* return_value = glIsBuffer(buffer);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<bool*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glIsBuffer\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glIsBuffer\n");
return false;
}
}
bool callGlGetBufferParameteriv(Stack* stack, bool pushReturn) {
int32_t* value = stack->pop<int32_t*>();
uint32_t parameter = stack->pop<uint32_t>();
uint32_t target = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glGetBufferParameteriv(%u, %u, %p)\n", target, parameter, value);
if (glGetBufferParameteriv != nullptr) {
glGetBufferParameteriv(target, parameter, value);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetBufferParameteriv\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetBufferParameteriv\n");
return false;
}
}
bool callGlCreateShader(Stack* stack, bool pushReturn) {
uint32_t type = stack->pop<uint32_t>();
if (stack->isValid()) {
CAZE_INFO("glCreateShader(%u)\n", type);
if (glCreateShader != nullptr) {
ShaderId* return_value = glCreateShader(type);
CAZE_INFO("Returned: %u\n", return_value);
if (pushReturn) {
stack->push<ShaderId*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glCreateShader\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCreateShader\n");
return false;
}
}
bool callGlDeleteShader(Stack* stack, bool pushReturn) {
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glDeleteShader(%u)\n", shader);
if (glDeleteShader != nullptr) {
glDeleteShader(shader);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteShader\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glDeleteShader\n");
return false;
}
}
bool callGlShaderSource(Stack* stack, bool pushReturn) {
int32_t* length = stack->pop<int32_t*>();
const char** source = stack->pop<const char**>();
int32_t count = stack->pop<int32_t>();
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glShaderSource(%u, %d, %p, %p)\n", shader, count, source, length);
if (glShaderSource != nullptr) {
glShaderSource(shader, count, source, length);
} else {
CAZE_WARNING("Attempted to call unsupported function glShaderSource\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glShaderSource\n");
return false;
}
}
bool callGlShaderBinary(Stack* stack, bool pushReturn) {
int32_t binary_size = stack->pop<int32_t>();
void* binary = stack->pop<void*>();
uint32_t binary_format = stack->pop<uint32_t>();
ShaderId* shaders = stack->pop<ShaderId*>();
int32_t count = stack->pop<int32_t>();
if (stack->isValid()) {
CAZE_INFO("glShaderBinary(%d, %p, %u, %p, %d)\n", count, shaders, binary_format, binary,
binary_size);
if (glShaderBinary != nullptr) {
glShaderBinary(count, shaders, binary_format, binary, binary_size);
} else {
CAZE_WARNING("Attempted to call unsupported function glShaderBinary\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glShaderBinary\n");
return false;
}
}
bool callGlGetShaderInfoLog(Stack* stack, bool pushReturn) {
const char* info = stack->pop<const char*>();
int32_t* string_length_written = stack->pop<int32_t*>();
int32_t buffer_length = stack->pop<int32_t>();
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glGetShaderInfoLog(%u, %d, %p, %p)\n", shader, buffer_length,
string_length_written, info);
if (glGetShaderInfoLog != nullptr) {
glGetShaderInfoLog(shader, buffer_length, string_length_written, info);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetShaderInfoLog\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetShaderInfoLog\n");
return false;
}
}
bool callGlGetShaderSource(Stack* stack, bool pushReturn) {
const char* source = stack->pop<const char*>();
int32_t* string_length_written = stack->pop<int32_t*>();
int32_t buffer_length = stack->pop<int32_t>();
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glGetShaderSource(%u, %d, %p, %p)\n", shader, buffer_length,
string_length_written, source);
if (glGetShaderSource != nullptr) {
glGetShaderSource(shader, buffer_length, string_length_written, source);
} else {
CAZE_WARNING("Attempted to call unsupported function glGetShaderSource\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glGetShaderSource\n");
return false;
}
}
bool callGlReleaseShaderCompiler(Stack* stack, bool pushReturn) {
if (stack->isValid()) {
CAZE_INFO("glReleaseShaderCompiler()\n");
if (glReleaseShaderCompiler != nullptr) {
glReleaseShaderCompiler();
} else {
CAZE_WARNING("Attempted to call unsupported function glReleaseShaderCompiler\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glReleaseShaderCompiler\n");
return false;
}
}
bool callGlCompileShader(Stack* stack, bool pushReturn) {
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glCompileShader(%u)\n", shader);
if (glCompileShader != nullptr) {
glCompileShader(shader);
} else {
CAZE_WARNING("Attempted to call unsupported function glCompileShader\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCompileShader\n");
return false;
}
}
bool callGlIsShader(Stack* stack, bool pushReturn) {
ShaderId shader = stack->pop<ShaderId>();
if (stack->isValid()) {
CAZE_INFO("glIsShader(%u)\n", shader);
if (glIsShader != nullptr) {
bool* return_value = glIsShader(shader);
CAZE_INFO("Returned: %d\n", return_value);
if (pushReturn) {
stack->push<bool*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glIsShader\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glIsShader\n");
return false;
}
}
bool callGlCreateProgram(Stack* stack, bool pushReturn) {
if (stack->isValid()) {
CAZE_INFO("glCreateProgram()\n");
if (glCreateProgram != nullptr) {
ProgramId* return_value = glCreateProgram();
CAZE_INFO("Returned: %u\n", return_value);
if (pushReturn) {
stack->push<ProgramId*>(return_value);
}
} else {
CAZE_WARNING("Attempted to call unsupported function glCreateProgram\n");
}
return true;
} else {
CAZE_WARNING("Error during calling function glCreateProgram\n");
return false;
}
}
bool callGlDeleteProgram(Stack* stack, bool pushReturn) {
ProgramId program = stack->pop<ProgramId>();
if (stack->isValid()) {
CAZE_INFO("glDeleteProgram(%u)\n", program);
if (glDeleteProgram != nullptr) {
glDeleteProgram(program);
} else {
CAZE_WARNING("Attempted to call unsupported function glDeleteProgram\n");