Commit Graph

134 Commits (9236b940a2c51ba3e7081a186c2db888e9b5bd82)

Author SHA1 Message Date
jp9000 2dbbffe4a2 Make a number of key optimizations
- Changed glMapBuffer to glMapBufferRange to allow invalidation.  Using
   just glMapBuffer alone was causing some unacceptable stalls.

 - Changed dynamic buffers from GL_DYNAMIC_WRITE to GL_STREAM_WRITE
   because I had misunderstood the OpenGL specification

 - Added _OPENGL and _D3D11 builtin preprocessor macros to effects to
   allow special processing if needed

 - Added fmod support to shaders (NOTE: D3D and GL do not function
   identically with negative numbers when using this.  Positive numbers
   however function identically)

 - Created a planar conversion shader that converts from packed YUV to
   planar 420 right on the GPU without any CPU processing.  Reduces
   required GPU download size to approximately 37.5% of its normal rate
   as well.  GPU usage down by 10 entire percentage points despite the
   extra required pass.
2014-02-16 19:28:21 -07:00
jp9000 1570fa75b9 Fix variable placement, not safe with goto usage 2014-02-14 18:23:21 -07:00
jp9000 30af7dc211 Optimize GL staging surface and fix mac issue
Staging surfaces with GL originally copied to a texture and then
downloaded that copied texture, but I realized that there was really no
real need to do that.  Now instead they'll copy directly from the
texture that's given to them rather than copying to a buffer first.

Secondly, hopefully fix the mac issue where the only way to perform an
asynchronous texture download is via FBOs and glReadPixels.  It's a
really dumb issue with macs and the amount of "gotchas" and non-standard
internal GL functionaly on mac is really annoying.
2014-02-14 18:13:25 -07:00
jp9000 8b8217f68e Fix a some more linux/GCC specific warnings 2014-02-14 15:56:01 -07:00
jp9000 966b943d5b Remove majority of warnings
There were a *lot* of warnings, managed to remove most of them.

Also, put warning flags before C_FLAGS and CXX_FLAGS, rather than after,
as -Wall -Wextra was overwriting flags that came before it.
2014-02-14 15:13:36 -07:00
jp9000 b067440f73 Use bzalloc instead of bmalloc then memset
Reduces needless code repetition and still allows for proper memory
alignment.  Cleans up the code a bit.
2014-02-09 12:34:07 -07:00
jp9000 6ffcd5e74e Implement FBO blit texture copy
This trick uses FBOs to allow for copying textures without the need for
special texture copy functions.
2014-02-09 11:37:22 -07:00
jp9000 6c92cf5841 Implement output, improve video/audio subsystems
- Fill in the rest of the FFmpeg test output code for testing so it
   actually properly outputs data.

 - Improve the main video subsystem to be a bit more optimal and
   automatically output I420 or NV12 if needed.

 - Fix audio subsystem insertation and byte calculation.  Now it will
   seamlessly insert new audio data in to the audio stream based upon
   its timestamp value.  (Be extremely cautious when using floating
   point calculations for important things like this, and always round
   your values and check your values)

 - Use 32 byte alignment in case of future optimizations and export a
   function to get the current alignment.

 - Make os_sleepto_ns return true if slept, false if the time has
   already been passed before the call.

 - Fix sinewave output so that it actually properly calculates a middle
   C sinewave.

 - Change the use of row_bytes to linesize (also makes it a bit more
   consistent with FFmpeg's naming as well)
2014-02-09 05:51:06 -07:00
Zachary Lund 4461281a3b Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-02-08 16:02:44 -06:00
Zachary Lund cd9c4b39d0 We only really require GLX 1.3. Also fixed version check to be more appropriate. 2014-02-08 02:52:55 -06:00
jp9000 3d6d43225f Add planar audio support, improve test output
- Add planar audio support.  FFmpeg and libav use planar audio for many
  encoders, so it was somewhat necessary to add support in libobs
  itself.

- Improve/adjust FFmpeg test output plugin.  The exports were somewhat
  messed up (making me rethink how exports should be done).  Not yet
  functional; it handles video properly, but it still does not handle
  audio properly.

- Improve planar video code.  The planar video code was not properly
  accounting for row sizes for each plane.  Specifying row sizes for
  each plane has now been added.  This will also make it more compatible
  with FFmpeg/libav.

- Fixed a bug where callbacks wouldn't create properly in audio-io and
  video-io code.

- Implement 'blogva' function to allow for va_list usage with libobs
  logging.
2014-02-07 03:03:54 -07:00
Zachary Lund 9a2b662935 Changed version checks... I got most of them wrong. 2014-02-06 17:49:12 -06:00
Zachary Lund 11c40ba6cd Minor adjustment to code. ARB version of debug_output doesn't use GL_DEBUG_OUTPUT 2014-02-06 01:57:14 -06:00
Zachary Lund 72c156f549 Corrected a version check which caused crashes on non-4.3 profiles. 2014-02-06 01:41:55 -06:00
Zachary Lund fe1adfceec Broke Windows, here's a fix. 2014-02-06 01:29:07 -06:00
Zachary Lund 5c3b56807a Fixed gl-subsystem.c to reflect changes to GL loader API. 2014-02-06 00:25:15 -06:00
Zachary Lund 019d8d83ee Messed with GL loader some more.
I've branched well off of upstream glloadgen since they don't appear to be very active in between GL versions.

1) Changed how the address finder functions are set to be more sane.
2) Added *all* possible extensions. For the lulz.
3) Fixed a retarded bug in IsVersionGEQ.
4) Slapped myself for not seeing IsVersionGEQ bug earlier. Most important change.
2014-02-06 00:20:03 -06:00
jp9000 021d9522ea Eliminate more trailing whitespace from gl-x11.c 2014-02-05 21:33:55 -07:00
jp9000 8219a64958 Remove trailing whitespace from gl-x11.c (OCD) 2014-02-05 21:31:03 -07:00
jp9000 ab4ab95790 Implement output scaling/conversion/downloading
- Implement texture scaling/conversion/downloading for the main view so
  we can finally start getting data to output.

  Also, redesign how it works a bit, it will now properly wait one full
  frame for each step in the process:  rendering the main texture,
  scaling the main texture to an output texture, staging/downloading the
  ouput texture, and then outputting that staged data.  This way, the
  GPU will have more than enough time to fully complete each step.

- Fix a bug with OpenGL plugin's texture staging function.  Was using
  glBindBuffer instead of what should have been used:  glBindTexture.

- Change the naming scheme of the variables in default.effect.  It's now
  named with the idea of just "color matrix" in mind instead of "yuv
  matrix", and instead of DrawRGBToYUV, it's now just DrawMatrix.
2014-02-05 20:36:21 -07:00
BtbN e53825f1c3 Remove autotools files and update INSTALL file 2014-02-02 22:45:05 +01:00
Zachary Lund cc44c93fbf Fixed missed boolean check 2014-01-26 01:53:59 -06:00
Zachary Lund 488c90b3d2 Removed mercurial leftovers 2014-01-26 00:53:12 -06:00
Zachary Lund 666f0be14f Merge branch 'alt-ogl-loader' of https://github.com/jp9000/obs-studio into alt-ogl-loader 2014-01-25 23:59:26 -06:00
Zachary Lund ae17c457a7 Regenerated files 2014-01-25 23:58:43 -06:00
Zachary Lund f4379d7889 Changed constness on passed argument, updated VC++ project files 2014-01-25 23:23:26 -06:00
Zachary Lund 1c48834cb5 Fixed signedness issue on GLX 2014-01-25 22:27:02 -06:00
Zachary Lund 469f217e6b Removed tools used to generate the GL headers/implementations as we never use them to build 2014-01-25 22:26:55 -06:00
Zachary Lund 001f0b10a4 Fixed Windows goofy macros 2014-01-25 22:26:55 -06:00
Zachary Lund f33e693a6e Fixed cmake for Windows 2014-01-25 22:26:55 -06:00
Zachary Lund 74ab96a3ad I removed GLEW, added glLoadGen (renamed to GL here), and added implementations for all platforms. Hopefully this goes better than GLAD did. 2014-01-25 22:26:43 -06:00
Zachary Lund e3299d5662 Added rudimentary support for Qt on Linux 2014-01-24 21:55:10 -06:00
BtbN 45ec80fb7d Full rewrite of all CMakeLists
CMake now works on all platforms
2014-01-24 18:56:32 +01:00
BtbN 8fa309c96e Clean old cmake files 2014-01-24 01:46:36 +01:00
Zachary Lund bb24591d48 Add copyright and name to files it applies to. 2014-01-11 18:09:48 -06:00
Zachary Lund 78aa456a7b Added comments on why some code is disabled 2014-01-09 21:04:52 -06:00
Zachary Lund d283f24cbb A few changes concerning wxGTK.
For one, I added a new member gs_window for future use.
The member is "display" which represents our connection to X11.
Ideally, we should use this specific connection to deal with our Window.
For now, it's disabled. Read comment for more information.

Secondly, wxGTK apparently doesn't map our window in some cases.
This causes the window ID passed to be bad and will stop (or segfault)
our program. This might be related to the first commit above.

For now, all this commit does is realize the window manually.
2014-01-09 21:04:52 -06:00
Jim 0b7497d6df Merge pull request #23 from Ceropean/master
Use XGetErrorText() instead of our own table
2014-01-07 20:18:32 -08:00
Zachary Lund d3dab077cb Another attempt to fix ARB_debug_output, hopefully the last one. 2014-01-07 18:24:04 -06:00
Ján Mlynek ecadb4faae Use XGetErrorText() instead of our own table
This fixes segfaults when the error code is not in the table
2014-01-07 20:35:19 +01:00
jp9000 bf371437b3 Fixed debug extension check
- Check the actual debug extension instead of checking GL 4.0 support;
   it appears that despite having GL 4.0 support, AMD does not implement
   the standard debug extensions even when the *_CONTEXT_DEBUG_BIT_ARB
   flag is set on the context.

 - Also, fixed a place where spaces where used for indents instead of a
   tab.
2014-01-06 19:02:19 -07:00
jp9000 156009cc0c Fixed debug GL functions on windows (amend)
- Removed the dependency on windows.h for windows.  I feel it's an
   unnecessarily large dependency to have to add to all source files
   when the only thing that's needed to make the windows version compile
   the debug functions is just the __stdcall call convention keyword.

   On top of increasing compile time due to the large number of headers
   it includes from all the windows API headers, it also adds a lot of
   potential name conflicts, as I was getting a number of name conflicts
   for lots of names like near/far, which were used in old legacy 16bit
   windows code.
2014-01-06 17:36:19 -07:00
Zachary Lund 8073b0ecd4 Fixed APIENTRY quirk with GLEW 2014-01-06 17:51:45 -06:00
Zachary Lund 840c1cfd65 I removed GL-specific extension checking to a platform independent file.
I also fixed autoconf to find wxWidgets 2.9 without user intervention
Removed unused code and added more organization
2014-01-05 23:50:32 -06:00
Zachary Lund 4aef1d00d1 Change _DEBUG coverage a bit 2014-01-05 19:55:19 -06:00
Zachary Lund fee0d9a8f3 Minor style fixup 2014-01-04 01:37:00 -06:00
Zachary Lund 8df5293be1 Added GLX version check and assures context is set to none on failure.
Fixed the location glewExperimental was being set to just before glewInit() (where it should be).
2014-01-04 01:29:37 -06:00
Zachary Lund ffd80449d3 Added gl_update (does nothing for now).
Fix previous commit..
2014-01-04 00:50:40 -06:00
Zachary Lund 3dc2024c8f Remove enable statements. This should be done in platform-independent code using GLEW. 2014-01-04 00:42:23 -06:00
Zachary Lund 94f88c82cf Added OpenGL debug callback support and context changes.
1. We no longer hardcode a 3.2 profile. It chooses the latest profile that fits out description.
2. I added three tables and macros to help with the offsets compared to the variables to help reading. Read comments for more info.
3. I added glewExperimental being set. What a dumb "feature". It doesn't help anything...
2014-01-03 23:14:35 -06:00