summaryrefslogtreecommitdiffstats
path: root/src/angle/patches/0015-ANGLE-Fix-angle-d3d11-on-MSVC2010.patch
blob: 7d914766a0c3671b4ff0766c708a424a5d6e3920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
From 373b3f67352e9a6f599c6a9dd9aee3b4836e0a3f Mon Sep 17 00:00:00 2001
From: Andrew Knight <andrew.knight@digia.com>
Date: Mon, 22 Sep 2014 23:41:48 +0300
Subject: [PATCH 15/16] ANGLE: Fix -angle-d3d11 on MSVC2010

Allow the D3D11 renderer to build with the June 2010 DirectX SDK.

Change-Id: I2343acedab16845d6a0d4a53cf3145f583efc4a7
---
 src/3rdparty/angle/src/common/platform.h           |  6 ++
 .../renderer/d3d/d3d11/renderer11_utils.cpp        | 89 ++++++++++++++++++++++
 2 files changed, 95 insertions(+)

diff --git a/src/3rdparty/angle/src/common/platform.h b/src/3rdparty/angle/src/common/platform.h
index 7d0d957..3c619f3 100644
--- a/src/3rdparty/angle/src/common/platform.h
+++ b/src/3rdparty/angle/src/common/platform.h
@@ -52,7 +52,9 @@
 
 #   if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_PERF)
 #       include <d3d9.h>
+#      if !defined(COMPILER_IMPLEMENTATION)
 #       include <d3dcompiler.h>
+#      endif
 #   endif
 
 #   if defined(ANGLE_ENABLE_D3D11)
@@ -60,8 +62,12 @@
 #       include <d3d10.h>
 #       include <d3d11.h>
 #       include <dxgi.h>
+#      if _MSC_VER >= 1700
 #       include <dxgi1_2.h>
+#      endif
+#      if !defined(COMPILER_IMPLEMENTATION)
 #       include <d3dcompiler.h>
+#      endif
 #   endif
 
 #   undef near
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
index 06a22eb..345fd24 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
@@ -17,6 +17,37 @@
 
 #include <algorithm>
 
+#ifndef D3D_FL9_1_DEFAULT_MAX_ANISOTROPY
+#  define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2
+#endif
+#ifndef D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT
+#  define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1
+#endif
+#ifndef D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT
+#  define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4
+#endif
+#ifndef D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT
+#  define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535
+#endif
+#ifndef D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT
+#  define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575
+#endif
+#ifndef D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION
+#  define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512
+#endif
+#ifndef D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION
+#  define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096
+#endif
+#ifndef D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION
+#  define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048
+#endif
+#ifndef D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
+#  define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256
+#endif
+#ifndef D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION
+#  define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096
+#endif
+
 namespace rx
 {
 
@@ -275,7 +306,9 @@ static bool GetNPOTTextureSupport(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0: return true;
@@ -293,7 +326,9 @@ static float GetMaximumAnisotropy(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_MAX_MAXANISOTROPY;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -313,7 +348,9 @@ static bool GetOcclusionQuerySupport(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0: return true;
@@ -333,7 +370,9 @@ static bool GetEventQuerySupport(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0:
@@ -351,7 +390,9 @@ static bool GetInstancingSupport(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0:
@@ -374,7 +415,9 @@ static bool GetDerivativeInstructionSupport(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0:
@@ -392,7 +435,9 @@ static size_t GetMaximumSimultaneousRenderTargets(D3D_FEATURE_LEVEL featureLevel
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -410,7 +455,9 @@ static size_t GetMaximum2DTextureSize(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -428,7 +475,9 @@ static size_t GetMaximumCubeMapTextureSize(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_REQ_TEXTURECUBE_DIMENSION;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -446,7 +495,9 @@ static size_t GetMaximum2DTextureArraySize(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -464,7 +515,9 @@ static size_t GetMaximum3DTextureSize(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -482,7 +535,9 @@ static size_t GetMaximumViewportSize(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_VIEWPORT_BOUNDS_MAX;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -506,7 +561,9 @@ static size_t GetMaximumDrawIndexedIndexCount(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0: return std::numeric_limits<GLint>::max();
@@ -528,7 +585,9 @@ static size_t GetMaximumDrawVertexCount(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0: return std::numeric_limits<GLint>::max();
@@ -545,7 +604,9 @@ static size_t GetMaximumVertexInputSlots(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_STANDARD_VERTEX_ELEMENT_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1: return D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT;
@@ -565,7 +626,9 @@ static size_t GetMaximumVertexUniformVectors(D3D_FEATURE_LEVEL featureLevel)
     // TODO(geofflang): Remove hard-coded limit once the gl-uniform-arrays test can pass
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return 1024; // D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -590,7 +653,9 @@ static size_t GetMaximumVertexUniformBlocks(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - GetReservedVertexUniformBuffers();
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -617,7 +682,9 @@ static size_t GetMaximumVertexOutputVectors(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_VS_OUTPUT_REGISTER_COUNT - GetReservedVertexOutputVectors();
 
       case D3D_FEATURE_LEVEL_10_1: return D3D10_1_VS_OUTPUT_REGISTER_COUNT - GetReservedVertexOutputVectors();
@@ -636,7 +703,9 @@ static size_t GetMaximumVertexTextureUnits(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -658,7 +727,9 @@ static size_t GetMaximumPixelUniformVectors(D3D_FEATURE_LEVEL featureLevel)
     // TODO(geofflang): Remove hard-coded limit once the gl-uniform-arrays test can pass
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return 1024; // D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -683,7 +754,9 @@ static size_t GetMaximumPixelUniformBlocks(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - GetReservedPixelUniformBuffers();
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -702,7 +775,9 @@ static size_t GetMaximumPixelInputVectors(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_PS_INPUT_REGISTER_COUNT - GetReservedVertexOutputVectors();
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -721,7 +796,9 @@ static size_t GetMaximumPixelTextureUnits(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -740,7 +817,9 @@ static int GetMinimumTexelOffset(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -759,7 +838,9 @@ static int GetMaximumTexelOffset(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE;
       case D3D_FEATURE_LEVEL_10_1:
       case D3D_FEATURE_LEVEL_10_0: return D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE;
@@ -782,7 +863,9 @@ static size_t GetMaximumConstantBufferSize(D3D_FEATURE_LEVEL featureLevel)
 
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * bytesPerComponent;
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -801,7 +884,9 @@ static size_t GetMaximumStreamOutputBuffers(D3D_FEATURE_LEVEL featureLevel)
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return D3D11_SO_BUFFER_SLOT_COUNT;
 
       case D3D_FEATURE_LEVEL_10_1: return D3D10_1_SO_BUFFER_SLOT_COUNT;
@@ -819,7 +904,9 @@ static size_t GetMaximumStreamOutputInterleavedComponenets(D3D_FEATURE_LEVEL fea
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0:
 
       case D3D_FEATURE_LEVEL_10_1:
@@ -837,7 +924,9 @@ static size_t GetMaximumStreamOutputSeparateCompeonents(D3D_FEATURE_LEVEL featur
 {
     switch (featureLevel)
     {
+#if _MSC_VER >= 1700
       case D3D_FEATURE_LEVEL_11_1:
+#endif
       case D3D_FEATURE_LEVEL_11_0: return GetMaximumStreamOutputInterleavedComponenets(featureLevel) /
                                           GetMaximumStreamOutputBuffers(featureLevel);
 
-- 
1.9.0.msysgit.0