1. 05 8月, 2015 1 次提交
  2. 31 7月, 2015 2 次提交
    • J
      libobs-opengl: Only flush if no active swap on OSX · 05a19161
      jp9000 提交于
      glFlush is somewhat implementation-specific; on OSX for example, it is
      additionally used to draw to a view.  However, we're already using the
      Objective-C function flushBuffer, which apparently calls glFlush
      internally anyway to draw to views.  That means that we're superfluously
      calling glFlush most of the time if there's an active swap chain.  So
      instead, only call glFlush when there are no active swap chains on OSX.
      05a19161
    • J
      libobs-opengl: Make sure current swap is valid · de65407a
      jp9000 提交于
      de65407a
  3. 28 3月, 2015 1 次提交
    • J
      Add gs_blend_function_separate · be52fa26
      jp9000 提交于
      This allows the ability to separate the blend states of color and alpha.
      
      The default blend state has also changed so that alpha is always added
      together to ensure that the destination image always gets an alpha value
      that is actually usable after the operation (for render targets).
      
      Old default state:
        color source: GS_BLEND_SRCALPHA, color dest: GS_BLEND_INVSRCALPHA
        alpha source: GS_BLEND_SRCALPHA, alpha dest: GS_BLEND_INVSRCALPHA
      
      New default state:
        color source: GS_BLEND_SRCALPHA, color dest: GS_BLEND_INVSRCALPHA
        alpha source: GS_BLEND_ONE,      alpha dest: GS_BLEND_ONE
      be52fa26
  4. 23 3月, 2015 2 次提交
    • J
      libobs-opengl: Fix bug switching render targets · 2abf7b05
      jp9000 提交于
      If a render target was switched from one to another and then back
      consecutively, the texture would not get reattached at the last point
      due to the fact that the cur_render_target variable of the FBO storage
      structure would already be set to that texture, and then it would never
      get reattached because it thought it was already using that render
      target.
      
      So to fix this, any time a render target legitimately changes from one
      to another, it sets the cur_render_target and cur_zstencil_buffer
      variables of the FBO structure to null.
      2abf7b05
    • J
      libobs-opengl: Fix render targets being flipped · 2fa37a1f
      jp9000 提交于
      When render targets are used, they output to the render target inverted
      due to the way that opengl works.  This fixes that issue by inverting
      the projection matrix so that it renders the image upside down and
      inverting the front face from counterclockwise to clockwise.
      2fa37a1f
  5. 05 1月, 2015 1 次提交
  6. 10 12月, 2014 1 次提交
    • J
      libobs-opengl: Don't display unimportant messages · e88632ed
      jp9000 提交于
      The glDebugMessageCallback function will set a callback that will relay
      all messages coming from the driver (on supported drivers at least).
      For nvidia, sometimes there are a lot of irrelevant messages, which is
      nice depending on the type of application you're writing.
      
      I actually at first thought these messages were important, but it turns
      out that they're almost always irrelevant and not actually warnings.
      Most of the messages at a certain type/severity are mostly for debugging
      purposes or minor hints about how to maximize performance, so
      unfortunately there ends up being a lot of pointless spam in the debug
      output.
      
      The particular performance messages are related to optimizations you can
      get via multithreading, and are optimizations you would expect for games
      more than for this type of application.  They don't really apply for our
      use cases most of the time.
      
      High severity messages however are not omitted regardless of message
      type.
      
      These messages can be enabled again by simply defining the
      SHOW_ALL_GL_MESSAGES macro.
      e88632ed
  7. 27 9月, 2014 1 次提交
    • J
      (API Change) Use const params where applicable · 41fad2d1
      jp9000 提交于
      This Fixes a minor flaw with the API where data had to always be mutable
      to be usable by the API.
      
      Functions that do not modify the fundamental underlying data of a
      structure should be marked as constant, both for safety and to signify
      that the parameter is input only and will not be modified by the
      function using it.
      41fad2d1
  8. 26 9月, 2014 2 次提交
    • J
      libobs-opengl: Fix styling (80 column limit) · 0ef7a3f3
      jp9000 提交于
      0ef7a3f3
    • J
      (API Change) Remove pointers from all typedefs · c9df41c1
      jp9000 提交于
      Typedef pointers are unsafe.  If you do:
      typedef struct bla *bla_t;
      then you cannot use it as a constant, such as: const bla_t, because
      that constant will be to the pointer itself rather than to the
      underlying data.  I admit this was a fundamental mistake that must
      be corrected.
      
      All typedefs that were pointer types will now have their pointers
      removed from the type itself, and the pointers will be used when they
      are actually used as variables/parameters/returns instead.
      
      This does not break ABI though, which is pretty nice.
      c9df41c1
  9. 20 9月, 2014 2 次提交
    • J
      Remove unused variables · 732d24ca
      jp9000 提交于
      732d24ca
    • J
      Replace ARB_separate_shader_objects extension · 3967c635
      jp9000 提交于
      This replaces the ARB_separate_shader_objects extension with traditional
      linked shaders.  I was able to get the existing system to use linked
      shaders without having to change any libobs graphics API.
      
      This essentially creates a linked list of shader programs with
      references to the shaders they link.  Before draw, it searches that
      linked list for a particular pixel/vertex shader pair, and the linked
      program associated with it.  If no matching program exists, it creates
      the program.
      3967c635
  10. 10 8月, 2014 1 次提交
    • J
      (API Change) Improve graphics API consistency · 5780f3f1
      jp9000 提交于
      Summary:
      - Prefix all graphics subsystem names with gs_ or GS_
      - Unsquish funciton names (for example _setfloat to _set_float)
      - Changed create functions to be more consistent with the rest of the
        API elsewhere.  For exmaple, instead of
        gs_create_texture/gs_texture_destroy, it's now
        gs_texture_create/gs_texture_destroy
      - Renamed gs_stencil_op enum to gs_stencil_op_type
      
      From:                            To:
      -----------------------------------------------------------
      tvertarray                       gs_tvertarray
      vb_data                          gs_vb_data
      vbdata_create                    gs_vbdata_create
      vbdata_destroy                   gs_vbdata_destroy
      shader_param                     gs_shader_param
      gs_effect                        gs_effect
      effect_technique                 gs_effect_technique
      effect_pass                      gs_effect_pass
      effect_param                     gs_effect_param
      texture_t                        gs_texture_t
      stagesurf_t                      gs_stagesurf_t
      zstencil_t                       gs_zstencil_t
      vertbuffer_t                     gs_vertbuffer_t
      indexbuffer_t                    gs_indexbuffer_t
      samplerstate_t                   gs_samplerstate_t
      swapchain_t                      gs_swapchain_t
      texrender_t                      gs_texrender_t
      shader_t                         gs_shader_t
      sparam_t                         gs_sparam_t
      effect_t                         gs_effect_t
      technique_t                      gs_technique_t
      eparam_t                         gs_eparam_t
      device_t                         gs_device_t
      graphics_t                       graphics_t
      shader_param_type                gs_shader_param_type
      SHADER_PARAM_UNKNOWN             GS_SHADER_PARAM_UNKNOWN
      SHADER_PARAM_BOOL                GS_SHADER_PARAM_BOOL
      SHADER_PARAM_FLOAT               GS_SHADER_PARAM_FLOAT
      SHADER_PARAM_INT                 GS_SHADER_PARAM_INT
      SHADER_PARAM_STRING              GS_SHADER_PARAM_STRING
      SHADER_PARAM_VEC2                GS_SHADER_PARAM_VEC2
      SHADER_PARAM_VEC3                GS_SHADER_PARAM_VEC3
      SHADER_PARAM_VEC4                GS_SHADER_PARAM_VEC4
      SHADER_PARAM_MATRIX4X4           GS_SHADER_PARAM_MATRIX4X4
      SHADER_PARAM_TEXTURE             GS_SHADER_PARAM_TEXTURE
      shader_param_info                gs_shader_param_info
      shader_type                      gs_shader_type
      SHADER_VERTEX                    GS_SHADER_VERTEX
      SHADER_PIXEL                     GS_SHADER_PIXEL
      shader_destroy                   gs_shader_destroy
      shader_numparams                 gs_shader_get_num_params
      shader_getparambyidx             gs_shader_get_param_by_idx
      shader_getparambyname            gs_shader_get_param_by_name
      shader_getviewprojmatrix         gs_shader_get_viewproj_matrix
      shader_getworldmatrix            gs_shader_get_world_matrix
      shader_getparaminfo              gs_shader_get_param_info
      shader_setbool                   gs_shader_set_bool
      shader_setfloat                  gs_shader_set_float
      shader_setint                    gs_shader_set_int
      shader_setmatrix3                gs_shader_setmatrix3
      shader_setmatrix4                gs_shader_set_matrix4
      shader_setvec2                   gs_shader_set_vec2
      shader_setvec3                   gs_shader_set_vec3
      shader_setvec4                   gs_shader_set_vec4
      shader_settexture                gs_shader_set_texture
      shader_setval                    gs_shader_set_val
      shader_setdefault                gs_shader_set_default
      effect_property_type             gs_effect_property_type
      EFFECT_NONE                      GS_EFFECT_NONE
      EFFECT_BOOL                      GS_EFFECT_BOOL
      EFFECT_FLOAT                     GS_EFFECT_FLOAT
      EFFECT_COLOR                     GS_EFFECT_COLOR
      EFFECT_TEXTURE                   GS_EFFECT_TEXTURE
      effect_param_info                gs_effect_param_info
      effect_destroy                   gs_effect_destroy
      effect_gettechnique              gs_effect_get_technique
      technique_begin                  gs_technique_begin
      technique_end                    gs_technique_end
      technique_beginpass              gs_technique_begin_pass
      technique_beginpassbyname        gs_technique_begin_pass_by_name
      technique_endpass                gs_technique_end_pass
      effect_numparams                 gs_effect_get_num_params
      effect_getparambyidx             gs_effect_get_param_by_idx
      effect_getparambyname            gs_effect_get_param_by_name
      effect_updateparams              gs_effect_update_params
      effect_getviewprojmatrix         gs_effect_get_viewproj_matrix
      effect_getworldmatrix            gs_effect_get_world_matrix
      effect_getparaminfo              gs_effect_get_param_info
      effect_setbool                   gs_effect_set_bool
      effect_setfloat                  gs_effect_set_float
      effect_setint                    gs_effect_set_int
      effect_setmatrix4                gs_effect_set_matrix4
      effect_setvec2                   gs_effect_set_vec2
      effect_setvec3                   gs_effect_set_vec3
      effect_setvec4                   gs_effect_set_vec4
      effect_settexture                gs_effect_set_texture
      effect_setval                    gs_effect_set_val
      effect_setdefault                gs_effect_set_default
      texrender_create                 gs_texrender_create
      texrender_destroy                gs_texrender_destroy
      texrender_begin                  gs_texrender_begin
      texrender_end                    gs_texrender_end
      texrender_reset                  gs_texrender_reset
      texrender_gettexture             gs_texrender_get_texture
      GS_BUILDMIPMAPS                  GS_BUILD_MIPMAPS
      GS_RENDERTARGET                  GS_RENDER_TARGET
      gs_device_name                   gs_get_device_name
      gs_device_type                   gs_get_device_type
      gs_entercontext                  gs_enter_context
      gs_leavecontext                  gs_leave_context
      gs_getcontext                    gs_get_context
      gs_renderstart                   gs_render_start
      gs_renderstop                    gs_render_stop
      gs_rendersave                    gs_render_save
      gs_getinput                      gs_get_input
      gs_geteffect                     gs_get_effect
      gs_create_effect_from_file       gs_effect_create_from_file
      gs_create_effect                 gs_effect_create
      gs_create_vertexshader_from_file gs_vertexshader_create_from_file
      gs_create_pixelshader_from_file  gs_pixelshader_create_from_file
      gs_create_texture_from_file      gs_texture_create_from_file
      gs_resetviewport                 gs_reset_viewport
      gs_set2dmode                     gs_set_2d_mode
      gs_set3dmode                     gs_set_3d_mode
      gs_create_swapchain              gs_swapchain_create
      gs_getsize                       gs_get_size
      gs_getwidth                      gs_get_width
      gs_getheight                     gs_get_height
      gs_create_texture                gs_texture_create
      gs_create_cubetexture            gs_cubetexture_create
      gs_create_volumetexture          gs_voltexture_create
      gs_create_zstencil               gs_zstencil_create
      gs_create_stagesurface           gs_stagesurface_create
      gs_create_samplerstate           gs_samplerstate_create
      gs_create_vertexshader           gs_vertexshader_create
      gs_create_pixelshader            gs_pixelshader_create
      gs_create_vertexbuffer           gs_vertexbuffer_create
      gs_create_indexbuffer            gs_indexbuffer_create
      gs_gettexturetype                gs_get_texture_type
      gs_load_defaultsamplerstate      gs_load_default_samplerstate
      gs_getvertexshader               gs_get_vertex_shader
      gs_getpixelshader                gs_get_pixel_shader
      gs_getrendertarget               gs_get_render_target
      gs_getzstenciltarget             gs_get_zstencil_target
      gs_setrendertarget               gs_set_render_target
      gs_setcuberendertarget           gs_set_cube_render_target
      gs_beginscene                    gs_begin_scene
      gs_draw                          gs_draw
      gs_endscene                      gs_end_scene
      gs_setcullmode                   gs_set_cull_mode
      gs_getcullmode                   gs_get_cull_mode
      gs_enable_depthtest              gs_enable_depth_test
      gs_enable_stenciltest            gs_enable_stencil_test
      gs_enable_stencilwrite           gs_enable_stencil_write
      gs_blendfunction                 gs_blend_function
      gs_depthfunction                 gs_depth_function
      gs_stencilfunction               gs_stencil_function
      gs_stencilop                     gs_stencil_op
      gs_setviewport                   gs_set_viewport
      gs_getviewport                   gs_get_viewport
      gs_setscissorrect                gs_set_scissor_rect
      gs_create_texture_from_iosurface gs_texture_create_from_iosurface
      gs_create_gdi_texture            gs_texture_create_gdi
      gs_is_compressed_format          gs_is_compressed_format
      gs_num_total_levels              gs_get_total_levels
      texture_setimage                 gs_texture_set_image
      cubetexture_setimage             gs_cubetexture_set_image
      swapchain_destroy                gs_swapchain_destroy
      texture_destroy                  gs_texture_destroy
      texture_getwidth                 gs_texture_get_width
      texture_getheight                gs_texture_get_height
      texture_getcolorformat           gs_texture_get_color_format
      texture_map                      gs_texture_map
      texture_unmap                    gs_texture_unmap
      texture_isrect                   gs_texture_is_rect
      texture_getobj                   gs_texture_get_obj
      cubetexture_destroy              gs_cubetexture_destroy
      cubetexture_getsize              gs_cubetexture_get_size
      cubetexture_getcolorformat       gs_cubetexture_get_color_format
      volumetexture_destroy            gs_voltexture_destroy
      volumetexture_getwidth           gs_voltexture_get_width
      volumetexture_getheight          gs_voltexture_get_height
      volumetexture_getdepth           gs_voltexture_getdepth
      volumetexture_getcolorformat     gs_voltexture_get_color_format
      stagesurface_destroy             gs_stagesurface_destroy
      stagesurface_getwidth            gs_stagesurface_get_width
      stagesurface_getheight           gs_stagesurface_get_height
      stagesurface_getcolorformat      gs_stagesurface_get_color_format
      stagesurface_map                 gs_stagesurface_map
      stagesurface_unmap               gs_stagesurface_unmap
      zstencil_destroy                 gs_zstencil_destroy
      samplerstate_destroy             gs_samplerstate_destroy
      vertexbuffer_destroy             gs_vertexbuffer_destroy
      vertexbuffer_flush               gs_vertexbuffer_flush
      vertexbuffer_getdata             gs_vertexbuffer_get_data
      indexbuffer_destroy              gs_indexbuffer_destroy
      indexbuffer_flush                gs_indexbuffer_flush
      indexbuffer_getdata              gs_indexbuffer_get_data
      indexbuffer_numindices           gs_indexbuffer_get_num_indices
      indexbuffer_gettype              gs_indexbuffer_get_type
      texture_rebind_iosurface         gs_texture_rebind_iosurface
      texture_get_dc                   gs_texture_get_dc
      texture_release_dc               gs_texture_release_dc
      5780f3f1
  11. 21 7月, 2014 3 次提交
    • J
      (API Change) obs_reset_video: Use return codes · 778cc2b3
      jp9000 提交于
      Changed API functions:
      libobs: obs_reset_video
      
      Before, video initialization returned a boolean, but "failed" is too
      little information, if it fails due to lack of device capabilities or
      bad video device parameters, the front-end needs to know that.
      
      The OBS Basic UI has also been updated to reflect this API change.
      778cc2b3
    • J
      Add gs_device_type function · 89a5bdbc
      jp9000 提交于
      This allows a programatic way of determining the type of graphics module
      currently active.
      89a5bdbc
    • J
      Add gs_device_name function · a446dd74
      jp9000 提交于
      This returns the name of the device, "Direct3D 11" or "OpenGL"
      respectively.
      a446dd74
  12. 11 7月, 2014 1 次提交
  13. 10 7月, 2014 1 次提交
  14. 29 6月, 2014 1 次提交
    • J
      Use uint8_t* instead of void* for texture data · 7b12133a
      jp9000 提交于
      NOTE: In texture_setimage, I had to move variables to the top of the
      scope because microsoft's C compiler will give the legacy C90 error of:
      'illegal use of this type as an expression'.
      
      To sum it up, microsoft's C compiler is still utter garbage.
      7b12133a
  15. 26 6月, 2014 3 次提交
    • J
      GL: Mark unused 'device' parameter for flush · f025cd6f
      jp9000 提交于
      f025cd6f
    • J
      Remove 'shader' param from shader param functions · caf8ca9b
      jp9000 提交于
      caf8ca9b
    • J
      Add a 'flush' command to graphics subsystem · 27010a2f
      jp9000 提交于
      ...I'm actually concerned that I went a bit overkill trying to prevent
      backwards compatibility issues with this abstraction design, because
      this is a large number of files that have to be modified just to add a
      single graphics subsystem export.  Someone's going to strangle me, and
      when you know that someone might strangle you, that means that you did
      something wrong.  We'll have to look in to simplifying this in the
      future without killing backward compatibility safety.
      27010a2f
  16. 25 6月, 2014 1 次提交
    • J
      Remove unused graphics subsystem functions · 8aa49cc9
      jp9000 提交于
      These functions were mostly related to being able to set true fullscreen
      mode -- however, this has no place for our purposes, and these functions
      were just sitting empty and unused, so they should be removed.
      
      Besides, fullscreen mode only applies to the windows operating system.
      8aa49cc9
  17. 15 6月, 2014 1 次提交
    • J
      Change graphics subsystem to 4x4 matrices · 1c2a0524
      jp9000 提交于
      4x4 matrices aren't as optimal, but are much more sensible to handle
      when you want to do more advanced stuff like scaling, skewing, or
      inversion.
      1c2a0524
  18. 02 5月, 2014 1 次提交
  19. 19 4月, 2014 1 次提交
  20. 16 4月, 2014 2 次提交
  21. 15 4月, 2014 1 次提交
  22. 13 4月, 2014 2 次提交
  23. 12 4月, 2014 3 次提交
  24. 17 2月, 2014 1 次提交
    • J
      Make a number of key optimizations · 2dbbffe4
      jp9000 提交于
       - 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.
      2dbbffe4
  25. 15 2月, 2014 1 次提交
    • J
      Remove majority of warnings · 966b943d
      jp9000 提交于
      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.
      966b943d
  26. 10 2月, 2014 2 次提交
  27. 07 2月, 2014 1 次提交
    • J
      Add planar audio support, improve test output · 3d6d4322
      jp9000 提交于
      - 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.
      3d6d4322