From 1b2c3a61769418a1ebedcc0004f62975c1646626 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 9 Feb 2015 01:03:33 -0800 Subject: [PATCH] libobs-d3d11: Fix initializer list ordering Microsoft's compiler doesn't seem to care about warning about things like initializer list ordering. Mingw actually reports on this to prevent potential confusion about ordering. --- libobs-d3d11/d3d11-duplicator.cpp | 2 +- libobs-d3d11/d3d11-indexbuffer.cpp | 4 ++-- libobs-d3d11/d3d11-shaderprocessor.cpp | 4 ++-- libobs-d3d11/d3d11-subsystem.hpp | 4 ++-- libobs-d3d11/d3d11-texture2d.cpp | 6 +++--- libobs-d3d11/d3d11-vertexbuffer.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libobs-d3d11/d3d11-duplicator.cpp b/libobs-d3d11/d3d11-duplicator.cpp index 493646062..25618842b 100644 --- a/libobs-d3d11/d3d11-duplicator.cpp +++ b/libobs-d3d11/d3d11-duplicator.cpp @@ -45,7 +45,7 @@ static inline bool get_monitor(gs_device_t *device, int monitor_idx, } gs_duplicator::gs_duplicator(gs_device_t *device_, int monitor_idx) - : device(device_), texture(nullptr) + : texture(nullptr), device(device_) { ComPtr output1; ComPtr output; diff --git a/libobs-d3d11/d3d11-indexbuffer.cpp b/libobs-d3d11/d3d11-indexbuffer.cpp index 0c68f4aea..ccb92a8a8 100644 --- a/libobs-d3d11/d3d11-indexbuffer.cpp +++ b/libobs-d3d11/d3d11-indexbuffer.cpp @@ -40,10 +40,10 @@ void gs_index_buffer::InitBuffer() gs_index_buffer::gs_index_buffer(gs_device_t *device, enum gs_index_type type, void *indices, size_t num, uint32_t flags) : device (device), + dynamic ((flags & GS_DYNAMIC) != 0), type (type), - indices (indices), num (num), - dynamic ((flags & GS_DYNAMIC) != 0) + indices (indices) { switch (type) { case GS_UNSIGNED_SHORT: indexSize = 2; break; diff --git a/libobs-d3d11/d3d11-shaderprocessor.cpp b/libobs-d3d11/d3d11-shaderprocessor.cpp index 884d77c53..9bee68716 100644 --- a/libobs-d3d11/d3d11-shaderprocessor.cpp +++ b/libobs-d3d11/d3d11-shaderprocessor.cpp @@ -147,8 +147,8 @@ void ShaderProcessor::BuildInputLayout( } gs_shader_param::gs_shader_param(shader_var &var, uint32_t &texCounter) - : type (get_shader_param_type(var.type)), - name (var.name), + : name (var.name), + type (get_shader_param_type(var.type)), textureID (texCounter), arrayCount (var.array_count), changed (false) diff --git a/libobs-d3d11/d3d11-subsystem.hpp b/libobs-d3d11/d3d11-subsystem.hpp index dd6f30a86..619509027 100644 --- a/libobs-d3d11/d3d11-subsystem.hpp +++ b/libobs-d3d11/d3d11-subsystem.hpp @@ -264,8 +264,8 @@ struct gs_texture { inline gs_texture(gs_device *device, gs_texture_type type, uint32_t levels, gs_color_format format) - : device (device), - type (type), + : type (type), + device (device), levels (levels), format (format) { diff --git a/libobs-d3d11/d3d11-texture2d.cpp b/libobs-d3d11/d3d11-texture2d.cpp index 4b00b4936..c76fd2367 100644 --- a/libobs-d3d11/d3d11-texture2d.cpp +++ b/libobs-d3d11/d3d11-texture2d.cpp @@ -149,10 +149,10 @@ gs_texture_2d::gs_texture_2d(gs_device_t *device, uint32_t width, width (width), height (height), dxgiFormat (ConvertGSTextureFormat(format)), - isGDICompatible (gdiCompatible), - isShared (shared), - isDynamic ((flags & GS_DYNAMIC) != 0), isRenderTarget ((flags & GS_RENDER_TARGET) != 0), + isGDICompatible (gdiCompatible), + isDynamic ((flags & GS_DYNAMIC) != 0), + isShared (shared), genMipmaps ((flags & GS_BUILD_MIPMAPS) != 0) { InitTexture(data); diff --git a/libobs-d3d11/d3d11-vertexbuffer.cpp b/libobs-d3d11/d3d11-vertexbuffer.cpp index 3fd1265d1..4d15a88e0 100644 --- a/libobs-d3d11/d3d11-vertexbuffer.cpp +++ b/libobs-d3d11/d3d11-vertexbuffer.cpp @@ -96,9 +96,9 @@ inline void gs_vertex_buffer::InitBuffer(const size_t elementSize, gs_vertex_buffer::gs_vertex_buffer(gs_device_t *device, struct gs_vb_data *data, uint32_t flags) : device (device), + dynamic ((flags & GS_DYNAMIC) != 0), vbd (data), - numVerts (data->num), - dynamic ((flags & GS_DYNAMIC) != 0) + numVerts (data->num) { if (!data->num) throw "Cannot initialize vertex buffer with 0 vertices";