Commit Graph

13 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks ec19f44f96 project: Don't prefix includes with "libobs/" 2018-04-23 17:53:27 +02:00
Michael Fabian 'Xaymar' Dirks 2adfa5765c gs: Rename to snake_case instead of PascalCase
This should prevent mishaps with upper/lowercase typos and fits in better with the C++ standard code, which is also in snake_case.
2018-03-20 12:44:02 +01:00
Michael Fabian 'Xaymar' Dirks 5e0b387dc1 gs-vertexbuffer: Functions to directly access internal buffers
Skips the previously necessary step to call At(0) and use the pointers stored in GS::Vertex to directly write to the buffers.
2018-01-19 03:15:12 +01:00
Michael Fabian 'Xaymar' Dirks fe3186220c gs-vertexbuffer: Slight Refactor to unify code style 2018-01-19 03:13:02 +01:00
Michael Fabian 'Xaymar' Dirks 3a05c08daf gs-vertexbuffer: Implement copy and move constructor/assignment 2018-01-19 03:05:24 +01:00
Michael Fabian 'Xaymar' Dirks 82ec6b93ec gs-vertexbuffer: Also free layer data
Fixes a tiny memory leak caused by a missing free.

Related: #9
2018-01-18 05:22:57 +01:00
Michael Fabian 'Xaymar' Dirks 1ebb0beac4 gs-vertexbuffer: Avoid relying on std for aligned types
Changes the GS::VertexBuffer storage to be one continuous buffer that is properly aligned and is also now used for GS::Vertex. This halves the necessary memory, removes reallocation cost and removes the copy necessary to get things onto the GPU.

Related: #9
2018-01-18 05:02:10 +01:00
Michael Fabian 'Xaymar' Dirks cb1ae28b07 gs-vertexbuffer: Use aligned memory and fix null pointer
This fixes the crash on creation issues, but a crash on exit still happens with the plugin installed. Unsure what exactly is causing it but it looks like something is writing into heap memory.

Related: #9
2018-01-08 19:08:49 +01:00
Michael Fabian 'Xaymar' Dirks 762c961ed3 gs-vertexbuffer: Fix incorrect vertex buffer size on GPU crash 2017-12-14 03:09:02 +01:00
Michael Fabian 'Xaymar' Dirks 09d5ac4635 gs-vertexbuffer: Fix support for 20.x graphics API
Reverts an earlier change that made the plugin rely on 21.x features.
2017-12-14 02:59:50 +01:00
Michael Fabian 'Xaymar' Dirks 9e813d98f1 gs-vertexbuffer: Update to new API adding flush_direct functionality
This fixes the crashes on deleting a filter without requiring painful memory editing.
2017-12-14 00:22:27 +01:00
Michael Fabian 'Xaymar' Dirks c7cfbff7dd gs-vertexbuffer: Workaround for a foreign deallocation bug in libobs
The graphics subsystem in OBS is freeing memory it didn't allocate, resulting in stack/heap corruption and other kinds of messy situations. The official "fix" for this is to use bmalloc, but then you lose any kind of ability to re-use the same buffer for multiple vertex buffers or update on the fly without adjusting code that is possibly outside of your control (such as in libraries).

This works around the issues by "patching" the gs_vertexbuffer object to no longer hold a reference to the gs_vb_data object. Currently only D3D11 is supported for this kind of hack and it might break in a future obs-studio release.

PR fixing this Issue: https://github.com/jp9000/obs-studio/pull/993
2017-11-03 00:13:07 +01:00
Michael Fabian Dirks eb1612c6ee gs: Wrap OBS Graphics Subsystem in proper C++ classes 2017-09-18 00:05:28 +02:00