Commit Graph
6575 Commits
Author SHA1 Message Date
Johannes Schickel 17b1124a5a OPENGL: Do not keep uniform state for nonexistent uniforms. 2016-03-16 20:29:31 +01:00
Johannes Schickel 1e1272a8c4 OPENGL: Store logical texture dimensions in GLTexture. 2016-03-16 20:29:31 +01:00
Johannes Schickel 2b3340474e OPENGL: Introduce convenience wrappers for get*Location in Shader. 2016-03-16 20:29:31 +01:00
Johannes Schickel 39100b6132 OPENGL: Do not hardcode any uniform/attribute handling in Shader. 2016-03-16 20:29:31 +01:00
Johannes Schickel baca885cfc OPENGL: Let Shader store the uniform state. 2016-03-16 20:29:31 +01:00
Johannes Schickel 6dacc96d1f OPENGL: Only set projection matrix once on pipeline activation. 2016-03-16 20:29:31 +01:00
Johannes Schickel 8b80e9d36c OPENGL: Properly deactivate old pipeline. 2016-03-16 20:29:31 +01:00
Johannes Schickel 3f9852eb20 OPENGL: Make shader pipelines use fixed shaders. 2016-03-16 20:29:31 +01:00
Johannes Schickel 26f106497a OPENGL: Implement CLUT8 look up as Pipeline. 2016-03-16 20:29:30 +01:00
Johannes Schickel 8a4938f82b OPENGL: Move pipeline code to pipelines/. 2016-03-16 20:29:30 +01:00
Johannes Schickel bec2088d6c OPENGL: Only allow Pipeline to switch active Framebuffers. 2016-03-16 20:29:30 +01:00
Johannes Schickel ed6689d4fc OPENGL: Do not allow direct access to Context::activePipeline. 2016-03-16 20:29:27 +01:00
Johannes Schickel b17c035642 OPENGL: Implement texture drawing in Pipeline instead of Surface. 2016-03-16 20:29:27 +01:00
Johannes Schickel 0fe580d10c OPENGL: Make shader/framebuffer part of pipeline state. 2016-03-16 20:29:27 +01:00
Johannes Schickel 0b46af2f0e OPENGL: Don't prefix maxTextureSize variable for consistency. 2016-03-16 20:29:27 +01:00
Johannes Schickel c4e65732be OPENGL: Introduce abstraction for framebuffer.
This allows us to use various framebuffer settings easily. Now the GPU
accelerated CLUT8 surface implementation does not need to query former
framebuffer state anymore.
2016-03-16 20:29:26 +01:00
Johannes Schickel 5498982a37 OPENGL: Introduce ShaderManager to handle builtin shaders. 2016-03-16 20:29:26 +01:00
Johannes Schickel f5f1b6eba0 OPENGL: Introduce pipeline abstraction to cleanup code. 2016-03-16 20:29:26 +01:00
Johannes Schickel 08553a09cf OPENGL: Support GLSL based CLUT8 look up for GLES2+. 2016-03-16 20:29:26 +01:00
Johannes Schickel bf2735cd53 OPENGL: Detect NPOT support for GLES.
For GLES1+ there exists GL_OES_texture_npot, which indicates that there is
NPOT support.

GLES2 always had (limited) NPOT support, which is all we require, thus we
always enable it.
2016-03-16 20:29:26 +01:00
Johannes Schickel 18306ee206 OPENGL: Simplify shader support checks. 2016-03-16 20:29:26 +01:00
Johannes Schickel 397ce9b947 OPENGL: Keep feature state for all contexts and log them. 2016-03-16 20:29:26 +01:00
Johannes Schickel 2319fcd228 OPENGL: Handle GLES2 and GL shaders uniformly.
GLES2 requires precision qualifiers to be set and allows use of precision
qualifiers. For GLES2 we define a default precision now. Since precision
qualifiers are not supported in the GLSL version we use for GL, we
introduce compatibility #defines.
2016-03-16 20:29:26 +01:00
Johannes Schickel e66e9e44d3 OPENGL: Accelerate palette lookups with shaders.
This currently is limited to GL contexts.
2016-03-16 20:29:26 +01:00
Johannes Schickel de3846923c OPENGL: Introduce simple abstraction for surfaces.
This is basically an interface extracted from Texture without any knowledge
about any actual implementation, except for copyRectToTexture, fill, and
dirty rect handling. These are convenient helpers.
2016-03-16 20:29:26 +01:00
Johannes Schickel 8b0cf0c5f7 OPENGL: Cleanup. Remove Texture::getHardwareFormat. 2016-03-16 20:29:26 +01:00
Johannes Schickel 618adec7b0 OPENGL: Move color key handling for CLUT8 to TextureCLUT8. 2016-03-16 20:29:26 +01:00
Johannes Schickel db2917dde5 OPENGL: Fix texture format for BGR565. 2016-03-16 20:29:26 +01:00
Johannes Schickel 9844d89231 OPENGL: Move max texture size information to Context. 2016-03-16 20:29:26 +01:00
Johannes Schickel b081fe63e8 OPENGL: Create new abstraction for GL texture objects. 2016-03-16 20:29:26 +01:00
Johannes Schickel 5eb0ac0c9e OPENGL: Remove (some) unused GL definitions. 2016-03-16 20:29:26 +01:00
Johannes Schickel b8d79261ed OPENGLSDL: Request "standard" GL contexts.
Compatibility profiles only exist in modern OpenGL and we request an ancient
version.
2016-03-16 20:29:26 +01:00
Johannes Schickel 8a3eecb73a OPENGL: Unify shader implementation for GL and GLES2. 2016-03-16 20:29:25 +01:00
Johannes Schickel fc52f73050 OPENGL: Slightly cleanup programmable pipeline handling. 2016-03-16 20:29:25 +01:00
Johannes Schickel c7c870bf7f OPENGL: (Partly) move context specific handling to Context.
This does not include (most) shader setup, and projection matrices yet.
2016-03-16 20:29:25 +01:00
Johannes Schickel 5752f125e1 OPENGL: Make Context::reset explicitly reset state. 2016-03-16 20:29:25 +01:00
Johannes Schickel 1802c939a1 OPENGL: Slight simplifcation for opengl-func.h usage. 2016-03-16 20:29:25 +01:00
Johannes Schickel b7e64c6eeb OPENGLSDL: Destroy GL context on exit with SDL2. 2016-03-16 20:29:25 +01:00
Johannes Schickel d029f16799 OPENGL: Handle destruction gracefully when no context is setup. 2016-03-16 20:29:25 +01:00
Johannes Schickel fee1aa5502 OPENGL: Add support for shaders with GL contexts. 2016-03-16 20:29:25 +01:00
Johannes Schickel 19abd8ccbb OPENGL: Reset context description on context destroy. 2016-03-16 20:29:25 +01:00
Johannes Schickel 1c61e017a0 OPENGL: Reset full context structure. 2016-03-16 20:29:25 +01:00
Johannes Schickel fe88375ff3 OPENGL: Support GLES2 contexts. 2016-03-16 20:29:25 +01:00
Johannes Schickel e931018673 OPENGL: Typo. 2016-03-16 20:29:25 +01:00
Johannes Schickel c5ce812711 OPENGL: Simplify orthogonal projection setup. 2016-03-16 20:29:25 +01:00
Johannes Schickel 67e2790beb OPENGLSDL: Slight cleanup. 2016-03-16 20:29:25 +01:00
Johannes Schickel af727afe0c OPENGL: Simplify context type setting. 2016-03-16 20:29:25 +01:00
Johannes Schickel da062ad1ea OPENGLSDL: Try to use GL(ES) context SDL2 defaults to. 2016-03-16 20:29:25 +01:00
Johannes Schickel 2277144623 OPENGL: Support RGB555 for OpenGL ES output.
This mode should *not* be used by any new engines/code. If someone is going
to use it and says it works with the OpenGL output, please make them wear a
red uniform and beam them onto a remote planet.
2016-03-16 20:29:25 +01:00
Johannes Schickel d6d3e17d53 OPENGL: Allow runtime specification of OpenGL mode.
Formerly, we required that the OpenGL mode was fixed at compile time. Now we
allow the code to work with whatever it is given at runtime.

It is still possible to force a context type on compile time.
2016-03-16 20:29:25 +01:00