Commit Graph

2536 Commits

Author SHA1 Message Date
Tarek Yasser 047fd86757 Fix compilation errors on clang. 2023-10-10 03:54:33 +03:00
Tarek Yasser 636e24003d Add an explanation as to why GLGL_UNSIGNED_INT_8_8_8_8_REV is used in
OpenGL textures.
2023-10-10 02:20:26 +03:00
Tarek Yasser 872487490a Change back initialization of depth values in Framebuffer::getDepthAt.
Remove redundant `glReadBuffer` call.
2023-10-09 21:03:00 +03:00
Tarek Yasser eba9a1b3e7 Revert "Remove redundant std qualification for std::move."
This reverts commit 048fa18006.
2023-10-09 19:38:17 +03:00
Tarek Yasser 048fa18006 Remove redundant std qualification for std::move. 2023-10-06 00:38:03 +03:00
Tarek Yasser c0cc087347 Rename tryCreateWindow to tryCreateContext. Update renderer comments
to doxygen format.
2023-10-06 00:36:37 +03:00
Tarek Yasser bf4748e900 Replace "window" with "context" in Renderer::findCompatibleApi. 2023-10-06 00:31:24 +03:00
Tarek Yasser eaf8073d39 Modify static_cast to use the proper target type. 2023-10-06 00:29:57 +03:00
Tarek Yasser b153551520 Fix comment cutting OpenGL ES in two. 2023-10-06 00:29:16 +03:00
Tarek Yasser 5a809d3a75 Fix indentation inside the Splash namespace. Add separators in source
files.
2023-10-06 00:26:50 +03:00
Tarek Yasser 2cd4708516 Modify renderer initialization failure handling to be more concise. 2023-10-06 00:19:30 +03:00
Tarek Yasser d16e8b0231 Modify help message to specify the avaiable choices for
`--renderingApi`.
2023-10-06 00:17:38 +03:00
Tarek Yasser 021ea5d3b9 Revert ZMQ to an earlier version. 2023-10-06 00:15:41 +03:00
Tarek Yasser 7a4878dec3 Add/Modify a bunch of copyright notices on header files. 2023-10-06 00:10:24 +03:00
Tarek Yasser a32a5e6985 Use nullptr instead of 0 for a pointer parameter. 2023-10-06 00:07:11 +03:00
Tarek Yasser 29bcdf03e9 Merge branch 'graphics_api_merge' of https://gitlab.com/sat-mtl/tools/splash/splash into graphics_api_merge 2023-10-05 23:18:47 +03:00
Tarek Yasser bed1502034 Revert formatting changes done to world.cpp. 2023-10-05 23:18:06 +03:00
Tarek Yasser c540f8ab10 Clean up includes in root_object.h and scene.cpp. 2023-10-05 22:51:20 +03:00
Emmanuel Durand a2fb63d914 Restore the docs of getGLVersion, getGLVendor, getGLRenderer. 2023-10-05 19:47:08 +00:00
Tarek Yasser 64ff2500f8 Revert timeout to 5 seconds. 2023-10-05 22:42:51 +03:00
Tarek Yasser 88db2de8e3 Document setApiSpecificFlags, getApiSpecificVersion, and loadApiSpecificGlFunctions. 2023-10-05 22:28:24 +03:00
Tarek Yasser 5831543bd7 Add override to all overridden methods in OpenGLRenderer and
`GLESRenderer`.
2023-10-05 22:23:11 +03:00
Tarek Yasser 882d5e1ece Fix includes to follow Splash's style. 2023-10-05 22:20:01 +03:00
Tarek Yasser 404d127f1e Fix incorrect setting/checking of renderer/scene initialization. Add
logs to `findCompatibleAPI`.
2023-10-04 00:49:21 +03:00
Tarek Yasser dae2537dcc Add automatically trying OpenGL 4.5 and OpenGL ES 3.2 on app start.
- If the user chose a specific API, then only that will be tried. If
  not, we try OpenGL 4.5 first, followed by OpenGL ES 3.2. Whichever API
  works first (creates a window successfully) is then used.
2023-10-04 00:26:23 +03:00
Tarek Yasser 54dd9ad821 Add a command line argument for the rendering backend. 2023-10-03 21:32:12 +03:00
Tarek Yasser e36dc895da Split GpuBuffer into OpenGL an GLES subclasses. 2023-10-03 20:58:02 +03:00
Tarek Yasser 90e2d72251 Revert accidental formatting changes in shader.cpp 2023-09-28 19:31:01 +03:00
Tarek Yasser fa483b4e4d Add copyright notices + other minor changes.
- Add copyright blocks to GLES and OpenGL texture headers.
- Add `virtual` to overridden functions.
- Rename `updateTextureFromPBO` to `updateTextureFromImage`.
2023-09-28 19:05:34 +03:00
Tarek Yasser 146aee939f Add a bunch of doxygen docs to Texture_Image. 2023-09-28 19:02:25 +03:00
Tarek Yasser cd17edea08 Split OpenGLTexture_Image into source and header files. 2023-09-28 17:28:45 +03:00
Tarek Yasser b0e01541ca Split GLESTexture_Image into source and header files. 2023-09-28 17:22:28 +03:00
Tarek Yasser c86f8eeff8 Fix incorrect class names in logs in Texture_Image. 2023-09-26 02:58:00 +03:00
Tarek Yasser b965d6f06d Convert if-else chains in initFromPixelFormat to more concise tables. 2023-09-26 02:49:55 +03:00
Tarek Yasser 370af642b7 Implement an OpenGL ES equivalent for glGetTextureImage. Change usages
of various OpenGL API wrapper functions to not automatically bind (for
performance reasons).
2023-09-26 02:11:18 +03:00
Tarek Yasser 4adc0c0f09 Pull common code from GLESTexture_Image and OpenGLTexture_Image into
`Texture_Image`.

- Thankfully, OpenGL and OpenGL ES share a few functions verbaitum,
  which allowed me to avoid virtualizing some individual API calls.
2023-09-25 02:16:27 +03:00
Tarek Yasser 7397f51bbd Fix a crash where compressed (DXT1) textures would crash on PBO read.
This was due to `updateCompressedSpec` being called before `rawSize`.
  The former doubles texture height for DXT1 textures, while the latter
  uses the texture height for buffer size computations. Due to the
  doubled height and thus doubled buffer size, `memcpy` would read off
  the image's buffer when it was time to upload it to the OpenGL
  texture, causing a segfault.
2023-09-22 07:03:48 +03:00
Tarek Yasser 2304af84b2 Move flip and flop parameter getting into GLESTexture::updateShaderUniforms. 2023-09-22 05:07:55 +03:00
Tarek Yasser 61104373eb Split OpenGLTexture_Image::update to a bunch of smaller functions. 2023-09-22 05:05:40 +03:00
Tarek Yasser 468c41efdd Split GLESTexture_Image::update to a bunch of smaller functions. 2023-09-21 21:22:36 +03:00
Tarek Yasser 5aee9edf57 Split GLESTexture_Image::reset and OpenGLTexture_Image::reset into smaller functions. 2023-09-21 00:30:42 +03:00
Tarek Yasser e0a69ed122 Demote missing uniforms in Shader::parseUniforms to warnings. 2023-09-19 01:35:38 +03:00
Tarek Yasser 47df0b7d7b Add more OpenGL functions calls to the merged API. 2023-09-19 01:35:06 +03:00
Tarek Yasser 95d61ac6b0 Remove hardcoded GL_TEXTURE_2D OpenGL calls, use the proper texture
type.
2023-09-19 01:34:19 +03:00
Tarek Yasser e2fead61e9 Split Texture_Image into OpenGLTexture_Image and
`GLESTexture_Image`.
2023-09-18 21:55:19 +03:00
Tarek Yasser 4882ecd644 Split Renderer into header and source files. Remove _glVersion. 2023-09-17 23:02:18 +03:00
Tarek Yasser e5b41cb872 Remove tracy GPU profiling calls as they're incompatible with GLES 3.2. 2023-09-17 22:31:51 +03:00
Tarek Yasser d0ed054da8 Fix compilation error due to switch case flow of control.
- The compiler complained about "control reaches end of non-void
  function" even though all paths returned.
2023-09-17 22:30:03 +03:00
Tarek Yasser ff1e9c70f3 Add a comment to explain why RGBA and RGBA16 textures are treated the
same.
2023-09-17 22:18:16 +03:00
Tarek Yasser ce177386e9 Use an enum to differentiate which API to create instead of a bool. 2023-09-17 22:17:20 +03:00