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.
This commit is contained in:
jp9000
2014-02-16 19:28:21 -07:00
parent fc368f663e
commit 2dbbffe4a2
21 changed files with 470 additions and 24 deletions

View File

@@ -282,16 +282,17 @@ bool OBSBasic::InitGraphics()
App()->GetConfigFPS(ovi.fps_num, ovi.fps_den);
ovi.graphics_module = App()->GetRenderModule();
ovi.base_width = (uint32_t)config_get_uint(GetGlobalConfig(),
ovi.base_width = (uint32_t)config_get_uint(GetGlobalConfig(),
"Video", "BaseCX");
ovi.base_height = (uint32_t)config_get_uint(GetGlobalConfig(),
ovi.base_height = (uint32_t)config_get_uint(GetGlobalConfig(),
"Video", "BaseCY");
ovi.output_width = (uint32_t)config_get_uint(GetGlobalConfig(),
ovi.output_width = (uint32_t)config_get_uint(GetGlobalConfig(),
"Video", "OutputCX");
ovi.output_height = (uint32_t)config_get_uint(GetGlobalConfig(),
ovi.output_height = (uint32_t)config_get_uint(GetGlobalConfig(),
"Video", "OutputCY");
ovi.output_format = VIDEO_FORMAT_I420;
ovi.adapter = 0;
ovi.output_format = VIDEO_FORMAT_I420;
ovi.adapter = 0;
ovi.gpu_conversion = true;
QTToGSWindow(ui->preview, ovi.window);