Răsfoiți Sursa

win-capture/graphics-hook: Fix vs2015 internal compiler error

Removing this union fixes the internal compile error that would occur on
visual studio 2015 update 2 and above when these variables were all in a
union.
jp9000 9 ani în urmă
părinte
comite
b012c7280a
1 a modificat fișierele cu 18 adăugiri și 24 ștergeri
  1. 18 24
      plugins/win-capture/graphics-hook/d3d9-capture.cpp

+ 18 - 24
plugins/win-capture/graphics-hook/d3d9-capture.cpp

@@ -36,31 +36,25 @@ struct d3d9_data {
 	bool                   using_shtex : 1;
 	bool                   using_scale : 1;
 
+	/* shared texture */
+	IDirect3DSurface9      *d3d9_copytex;
+	ID3D11Device           *d3d11_device;
+	ID3D11DeviceContext    *d3d11_context;
+	ID3D11Resource         *d3d11_tex;
+	struct shtex_data      *shtex_info;
+	HANDLE                 handle;
+	int                    patch;
+
+	/* shared memory */
+	IDirect3DSurface9      *copy_surfaces[NUM_BUFFERS];
+	IDirect3DSurface9      *render_targets[NUM_BUFFERS];
+	IDirect3DQuery9        *queries[NUM_BUFFERS];
+	struct shmem_data      *shmem_info;
+	bool                   texture_mapped[NUM_BUFFERS];
 	volatile bool          issued_queries[NUM_BUFFERS];
-
-	union {
-		/* shared texture */
-		struct {
-			IDirect3DSurface9      *d3d9_copytex;
-			ID3D11Device           *d3d11_device;
-			ID3D11DeviceContext    *d3d11_context;
-			ID3D11Resource         *d3d11_tex;
-			struct shtex_data      *shtex_info;
-			HANDLE                 handle;
-			int                    patch;
-		};
-		/* shared memory */
-		struct {
-			IDirect3DSurface9      *copy_surfaces[NUM_BUFFERS];
-			IDirect3DSurface9      *render_targets[NUM_BUFFERS];
-			IDirect3DQuery9        *queries[NUM_BUFFERS];
-			struct shmem_data      *shmem_info;
-			bool                   texture_mapped[NUM_BUFFERS];
-			uint32_t               pitch;
-			int                    cur_tex;
-			int                    copy_wait;
-		};
-	};
+	uint32_t               pitch;
+	int                    cur_tex;
+	int                    copy_wait;
 };
 
 static struct d3d9_data data = {};