diff --git a/libobs-d3d11/d3d11-subsystem.cpp b/libobs-d3d11/d3d11-subsystem.cpp index 2c495e746..b76d3d27a 100644 --- a/libobs-d3d11/d3d11-subsystem.cpp +++ b/libobs-d3d11/d3d11-subsystem.cpp @@ -421,20 +421,7 @@ void gs_device::UpdateViewProjMatrix() } gs_device::gs_device(const gs_init_data *data) - : curRenderTarget (NULL), - curZStencilBuffer (NULL), - curRenderSide (0), - curIndexBuffer (NULL), - curVertexBuffer (NULL), - curVertexShader (NULL), - curPixelShader (NULL), - curSwapChain (&defaultSwap), - zstencilStateChanged (true), - rasterStateChanged (true), - blendStateChanged (true), - curDepthStencilState (NULL), - curRasterState (NULL), - curBlendState (NULL), + : curSwapChain (&defaultSwap), curToplogy (D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED) { ComPtr adapter; diff --git a/libobs-d3d11/d3d11-subsystem.hpp b/libobs-d3d11/d3d11-subsystem.hpp index 8257c8a49..dd6f30a86 100644 --- a/libobs-d3d11/d3d11-subsystem.hpp +++ b/libobs-d3d11/d3d11-subsystem.hpp @@ -279,14 +279,14 @@ struct gs_texture_2d : gs_texture { ComPtr renderTarget[6]; ComPtr gdiSurface; - uint32_t width, height; - DXGI_FORMAT dxgiFormat; - bool isRenderTarget; - bool isGDICompatible; - bool isDynamic; - bool isShared; - bool genMipmaps; - uint32_t sharedHandle; + uint32_t width = 0, height = 0; + DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN; + bool isRenderTarget = false; + bool isGDICompatible = false; + bool isDynamic = false; + bool isShared = false; + bool genMipmaps = false; + uint32_t sharedHandle = 0; void InitSRD(vector &srd, const uint8_t **data); void InitTexture(const uint8_t **data); @@ -294,16 +294,7 @@ struct gs_texture_2d : gs_texture { void InitRenderTargets(); inline gs_texture_2d() - : gs_texture (NULL, GS_TEXTURE_2D, 0, GS_UNKNOWN), - width (0), - height (0), - dxgiFormat (DXGI_FORMAT_UNKNOWN), - isRenderTarget (false), - isGDICompatible (false), - isDynamic (false), - isShared (false), - genMipmaps (false), - sharedHandle (NULL) + : gs_texture (NULL, GS_TEXTURE_2D, 0, GS_UNKNOWN) { } @@ -619,32 +610,32 @@ struct gs_device { ComPtr context; gs_swap_chain defaultSwap; - gs_texture_2d *curRenderTarget; - gs_zstencil_buffer *curZStencilBuffer; - int curRenderSide; + gs_texture_2d *curRenderTarget = nullptr; + gs_zstencil_buffer *curZStencilBuffer = nullptr; + int curRenderSide = 0; gs_texture *curTextures[GS_MAX_TEXTURES]; gs_sampler_state *curSamplers[GS_MAX_TEXTURES]; - gs_vertex_buffer *curVertexBuffer; - gs_index_buffer *curIndexBuffer; - gs_vertex_shader *curVertexShader; - gs_pixel_shader *curPixelShader; + gs_vertex_buffer *curVertexBuffer = nullptr; + gs_index_buffer *curIndexBuffer = nullptr; + gs_vertex_shader *curVertexShader = nullptr; + gs_pixel_shader *curPixelShader = nullptr; gs_swap_chain *curSwapChain; - bool zstencilStateChanged; - bool rasterStateChanged; - bool blendStateChanged; + bool zstencilStateChanged = true; + bool rasterStateChanged = true; + bool blendStateChanged = true; ZStencilState zstencilState; RasterState rasterState; BlendState blendState; vector zstencilStates; vector rasterStates; vector blendStates; - ID3D11DepthStencilState *curDepthStencilState; - ID3D11RasterizerState *curRasterState; - ID3D11BlendState *curBlendState; + ID3D11DepthStencilState *curDepthStencilState = nullptr; + ID3D11RasterizerState *curRasterState = nullptr; + ID3D11BlendState *curBlendState = nullptr; D3D11_PRIMITIVE_TOPOLOGY curToplogy; - pD3DCompile d3dCompile; + pD3DCompile d3dCompile = nullptr; gs_rect viewport; diff --git a/libobs-d3d11/d3d11-texture2d.cpp b/libobs-d3d11/d3d11-texture2d.cpp index 10b3a98f4..4b00b4936 100644 --- a/libobs-d3d11/d3d11-texture2d.cpp +++ b/libobs-d3d11/d3d11-texture2d.cpp @@ -163,11 +163,7 @@ gs_texture_2d::gs_texture_2d(gs_device_t *device, uint32_t width, } gs_texture_2d::gs_texture_2d(gs_device_t *device, uint32_t handle) - : isRenderTarget (false), - isGDICompatible (false), - isDynamic (false), - isShared (true), - genMipmaps (false), + : isShared (true), sharedHandle (handle) { HRESULT hr;