Skip to content

Commit

Permalink
OpenGL will be converted to OpenGL ES using gl4es. I only tested this…
Browse files Browse the repository at this point in the history
… on the 64-bit windows build and I had to copy libEGL.dll and libGLESv2.dll from Chrome to the x64/Debug ES build directory in order to run it. GL Gears worked and Quake 2 worked. But DirectDraw games that were not using the GDI DirectDraw renderer all failed, lots of errors releated to textures. I tried one Direct3D game that also failed because of textures. There are a lot places these errors could be coming from: 1) I could have advertised an incorrect pixel format to Wine 2) I could have marshaled something incorrectly 3) gl4es doesn't support what is needed, gl4es implements up to OpenGL 2.1, I'm not sure what Wine 1.7 needs 4) Perhaps there was an issue with me just copying chrome's version of libGLESv2
  • Loading branch information
danoon2 committed Sep 1, 2021
1 parent 8f7b18e commit 5174701
Show file tree
Hide file tree
Showing 275 changed files with 140,165 additions and 14 deletions.
12 changes: 12 additions & 0 deletions lib/gl4es/.github/FUNDING.yml
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: ptitSeb
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: paypal.me/0ptitSeb
11 changes: 11 additions & 0 deletions lib/gl4es/.gitignore
@@ -0,0 +1,11 @@
.gdb_history
.vscode/
CMakeFiles/
lib/
Makefile
CMakeCache.txt
CTestTestfile.cmake
cmake_install.cmake
spec/yml/gles-1.1-full.yml
/build/
/tests/*.png
20 changes: 20 additions & 0 deletions lib/gl4es/.travis.yml
@@ -0,0 +1,20 @@
language: c
sudo: false
dist: buster

compiler:
- gcc

#Build steps
before_script:
- mkdir build
- cd build
- cmake .. -DODROID=1

script:
- make

#after_script:
# - sudo apt-get install apitrace-gl-frontend=5\* imagemagick xvfb -y
# - cd ../tests
# - xvfb-run ./tests.sh ../lib
104 changes: 104 additions & 0 deletions lib/gl4es/Android.mk
@@ -0,0 +1,104 @@
LOCAL_PATH := $(call my-dir)

###########################
#
# GL static library
#
###########################

include $(CLEAR_VARS)

LOCAL_MODULE := GL

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) -DBCMHOST

LOCAL_SRC_FILES := \
src/gl/arbconverter.c \
src/gl/arbgenerator.c \
src/gl/arbhelper.c \
src/gl/arbparser.c \
src/gl/array.c \
src/gl/blend.c \
src/gl/blit.c \
src/gl/buffers.c \
src/gl/build_info.c \
src/gl/debug.c \
src/gl/decompress.c \
src/gl/depth.c \
src/gl/directstate.c \
src/gl/drawing.c \
src/gl/enable.c \
src/gl/envvars.c \
src/gl/eval.c \
src/gl/face.c \
src/gl/fog.c \
src/gl/fpe.c \
src/gl/fpe_cache.c \
src/gl/fpe_shader.c \
src/gl/framebuffers.c \
src/gl/gl_lookup.c \
src/gl/getter.c \
src/gl/gl4es.c \
src/gl/glstate.c \
src/gl/hint.c \
src/gl/init.c \
src/gl/light.c \
src/gl/line.c \
src/gl/list.c \
src/gl/listdraw.c \
src/gl/listrl.c \
src/gl/loader.c \
src/gl/logs.c \
src/gl/matrix.c \
src/gl/matvec.c \
src/gl/oldprogram.c \
src/gl/pixel.c \
src/gl/planes.c \
src/gl/pointsprite.c \
src/gl/preproc.c \
src/gl/program.c \
src/gl/queries.c \
src/gl/raster.c \
src/gl/render.c \
src/gl/samplers.c \
src/gl/shader.c \
src/gl/shaderconv.c \
src/gl/shader_hacks.c \
src/gl/stack.c \
src/gl/stencil.c \
src/gl/string_utils.c \
src/gl/stubs.c \
src/gl/texenv.c \
src/gl/texgen.c \
src/gl/texture.c \
src/gl/texture_compressed.c \
src/gl/texture_params.c \
src/gl/texture_read.c \
src/gl/texture_3d.c \
src/gl/uniform.c \
src/gl/vertexattrib.c \
src/gl/wrap/gl4eswraps.c \
src/gl/wrap/gles.c \
src/gl/wrap/glstub.c \
src/gl/math/matheval.c \
src/glx/hardext.c \
src/glx/glx.c \
src/glx/lookup.c \
src/glx/gbm.c \
src/glx/streaming.c \

LOCAL_CFLAGS += -g -std=gnu99 -funwind-tables -O3 -fvisibility=hidden -include include/android_debug.h
LOCAL_CFLAGS += -DNOX11
LOCAL_CFLAGS += -DNO_GBM
#LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR
LOCAL_CFLAGS += -DDEFAULT_ES=2
//TODO: maybe temporary?
LOCAL_CFLAGS += -Wno-typedef-redefinition -Wno-dangling-else

LOCAL_LDLIBS := -llog
#building as a static lib

LOCAL_CFLAGS += -DSTATICLIB
include $(BUILD_STATIC_LIBRARY)
171 changes: 171 additions & 0 deletions lib/gl4es/CHANGELOG.md
@@ -0,0 +1,171 @@
Version history
----
##### Current Version
* Improve glGetError() handling

##### v1.1.4
* Fixed some regression, and foobillard++ is working fine now
* Set default GL version to 2.1 (instead of 2.0) for GLES2.0 backend
* Added ARB_vertex_program and ARB_fragment_program
* Improved fpe with more compatibility fixes
* Improved Handling of DXTc textures
* Improve handling of partially mipmap'd textures
* Added PYRA Profile
* Added support for Texture LOD access in Fragment Shaders
* Increased maximum Texture Unit support to 16 (from 8)
* Added support for program without Vertex Shader
* Some fixes for program that switch GLX Context frequently.
* Fixes and improvements in fpe_shaders (less array access)
* Added support for Clipping Plane in custom shaders (help OpenMW water reflection)
* Added support for multiple FBO attachement (if hardware support it)

##### v1.1.2
* Improved a bit the merger (wich merge subsequent `glBegin(...)`/`glEnd()`) efficiency
* Removed LIBGL_BEGINEND=2 (that was not working correctly, and it complexify the code too much)
* Added some Direct Access function (from EXT_direct_access)
* Fixes and Improvements on depth (and depth_Stencil) Texture handling
* Handling of GL_BGRA color size in VA (for HumandRessourceMachine)
* Some fixes to fpe_shader (for Neverwinter Night)
* Rework of Header structure (from @rajdakin)
* Better test, using "make test" (from @rajdakin, still using apitrace for replay)
* Added PSA: Precompiled Shader Archive, to store (and fast retrieve) FPE shader (and avoid some pauses when complex FPE shaders are computed)
* Numerous optimization and changes in Batch mode.
* Fixes to GL_BGRA handling
* Improvement in texture format handling, to limit number of conversions
* Added handling of VBO. Real VBO are used (in GLES2+ only) for GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER
* Added VBO when processing glList (only in GLES2+)
* Added a few more GL3.x functions (like glTexStorage). No real GL3.0 support yet
* Can now use GBM/DRM, using LIBGL_FB=4. Still WIP, but now it start to work (thanks to @icecream95)
* Preliminary Emscripten support (thanks to @CecilHarvey)
* AmigaOS4 support is now live (thanks to @kas1e)
* Some fixes to texture handling, when uploading (or modifying) a texture in a multi-texture context
* Small optimization some of the FPE Generated program (many fragment shaders that do texturing)
* Added support to glGetProgramBinary extension
* GL4ES has a logo now :) !
* AmigaOS4 is now fully supported! And SDK (with libs and samples) is available on os4depot
* Emscripten is now supported! A first example of a game using gl4es in a web build can be found [here](http://ptitseb.github.io/stuntcarremake/) with [Stunt Car Remake](https://github.com/ptitSeb/stuntcarremake)


##### v1.1.0
* Default backend is now GLES2 (but not on Pandora, still GLES1.1 for compatibility reasons)
* Added LIBGL_SHADERNOGLES to remove the GLES part of shaders (if any).
* Various RPi improvements, mainly in the context creation.
* Various AmigaOS4 improvement and workaround (but still in a beta state)
* Various improvement in GLX function, with a more accurate way to emulate GLXFBConfig
* Improved the way eglSurface are created in glx.c, to avoid try to create 2 on the same window (EGL doesn't allow that)
* Added LIBGL_GLXRECYCLE to not delete eglSurface and recycle them
* Added tracking of Framebuffers Object and Renderbuffers Objects
* Added (real) support for Float and Half-float Texture (including has attachement to FBO, emulating it if not supported in Hardware)
* Added support for Depth Stencil texture when attached to an FBO
* Added LIBGL_FBO=WxH for all platform
* Fixed some issue when resized textures attached to an FBO
* Added LIBGL_NODEPTHTEX to avoid using Depth Texture when available (using renderbuffer can be faster)
* Added support for Depth Texture when attached to an FBO (if supported by Hardware)
* Fixes some isue with blitting of FBO when size of Main Framebuffer changed
* Added option LIBGL_LOGSHADERERROR to get Shader compiler log and error
* Added support for (emulated) Hardware Instancing
* Added support for GL_ARB_draw_elements_base_vertex

##### v1.0.8
* Fixes and improvments to avoid unnecessary GLES state changes
* Fixes some memory issues with glBitmap
* Fixes to FPE (when using multitexture and GL_COMBINE)
* Added some TexEnv extension for GLES2 backend
* Fixes to Batch / Merger on GL_POLYGON primitives
* Fixes to LineStipple
* Pandora only: Fixed use of Texture Streaming on GLES2 backend

##### v1.0.6
* Factorised "Blit" function, and implemented `glBlitFramebuffer`
* Optimized `glBitmap`
* Added (limited) direct support to `GL_UNSIGNED_INT` for `glDrawElements` for hardware that support it
* Improved (a lot) `glBegin`/`glEnd` merger
* Added Anisotropic filtering support, for hardware that support it.
* Changed `LIBGL_BATCH`. It will now try to merge small (parametrable) subsequent `glDrawXXXX`
* Changed (simplified) the way texture "0" is handled
* Improvement to `glDrawArrays` and `glDrawElement`, with less copy of data
* WIP AmigaOS4 support (and BigEndian architecture)
* Improved NPOT support for "Limited NPOT" hardware
* Lots of FPE fixes
* Improve the way multi glX Context are handled
* Added basic pre-proc (only handle comments for now)
* Small optimization on when using `glDrawArrays` with GL_QUADS
* Improvement to GL_RENDER
* Improvement to line stipple
* Improvement to glPolygonMode(GL_LINE)

##### v1.0.4
* FPE is now usable. Most function are implemented
* ShaderConv in now usable. Basic GL 2 shader are supported
* Refactored Texture cache and handling, for better Tex1D/Tex3D/TexRectangle handling

##### v1.0.2
* Added GLES2 backend infrastructure
* Begin GLES2 backend
* Infrastructure for FPE (Fixed Pipeline Emulator)
* Basic and Crude Shader convertor
* Added blit function for GLES2 backend
* Added some OpenGL Builtin VAs and Uniforms

##### 1.0.0
* Removed old ES2 defines (ES2 will be dynamic later)

##### 0.9.8
* Added TravisCI build on github
* Added some optimization when to discard call to glBindTexture if useless (same texture) between 2 glBegin/glEnd blocks
* Stubbed glGet with GL_DRAW_BUFFER
* Improvement to Raster operations
* Factorised Blit function (only 1 function for that now)
* Tracking ShadeModel
* Tracking TexEnv

##### 0.9.7
* Tracking Clip Planes
* Refactor Blitting function, and use glDrawTex extension if present
* Restructured README and split in several files
* Some improvments and fixes to LIBGL_BEGINEND=2 mode
* Some improvments to some LIBGL_SHRINK mode
* Proper support for DOT3 extension
* Some fixes to Read/Draw Buffer handling
* Some fix with the PixMap glX context creation

##### 0.9.6
* Some fixes in GL_TEXTURE_RECTANGLE_ARB handling
* Some other fixes in texture handling (unpack and glList related)
* Some fix with the PBuffer glX context creation
* Tracking of glFog
* Exposed glBlendEquation if supported
* New LIBGL_AVOID16BITS parameter to prefer 32bits texture (useful on ODroid)
* Some optimisations in texture conversion

##### 0.9.5
* Added some optimizations for sequential glBegin/glEnd blocks, with a switch to control them
* Fixed many issue with Lights introduced with 0.9.4
* Fixed Android build introduced with 0.9.4

##### 0.9.4
* Fixed some extended functions (like glBlendFuncSeparate) not working inside list (fixing some issues with Batch mode)
* Added back GL_TEXTURE_RECTANGLE_ARB handling (and using npot texture, even limited, if available)
* Added tracking of Lights and Materials
* Fixed (Added in fact) support for Multisampling on the GLX Context creation (a bit hacky, but seems to works)
* Added LIBGL_NODOWNSAMPLING and associated Hint
* Try to implement some caching on VAO to avoid some memcpy in renderlist (with a way to disable it just in case)

##### 0.9.3
* Added support for Cube Mapping (with hardware support)
* Improved Texture state tracking
* Added LIBGL_NOTEXMAT env. var. switch for Texture Matrix handling
* Added GL_EXT_vertex_array_bgra (and NEONinzed some loop)
* Finished GL_EXT_direct_state_access extension
* Mangled glX function (to be able to use apitrace to capture GL frames)
* Return some values in glXQueryServerString, coherent with glXGetClientString

##### 0.9.2
* All matrix are tracked now
* Texture Matrix are 100% handled by gl4es. GLES Hardware keep an Identity matrix (TexCoord are transformed if needed). This allows a better handling of NPOT texture on hardware that doesn't support Full NPOT (fixed movies being horizontally shifted in openmw with LIBGL_NPOT=1 for example)

##### 0.9.1
* Added gl4es specifics glHint capabilities. If the extension GL_GL4ES_hint is present, than a few Hint are accessible. Look in include/gl4eshint.h for the list.

##### 0.9.0
* New name: gl4es

0 comments on commit 5174701

Please sign in to comment.