1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "Capabilities.hpp"
16 
17 #include "Main/Config.hpp"
18 
19 namespace D3D8
20 {
21 	bool Capabilities::Surface::RenderTarget::R8G8B8 = false;
22 	bool Capabilities::Surface::RenderTarget::R5G6B5 = true;
23 	bool Capabilities::Surface::RenderTarget::X1R5G5B5 = true;
24 	bool Capabilities::Surface::RenderTarget::A1R5G5B5 = true;
25 	bool Capabilities::Surface::RenderTarget::A4R4G4B4 = true;
26 	bool Capabilities::Surface::RenderTarget::R3G3B2 = false;
27 	bool Capabilities::Surface::RenderTarget::A8R3G3B2 = false;
28 	bool Capabilities::Surface::RenderTarget::X4R4G4B4 = true;
29 	bool Capabilities::Surface::RenderTarget::A8R8G8B8 = true;
30 	bool Capabilities::Surface::RenderTarget::X8R8G8B8 = true;
31 	bool Capabilities::Surface::RenderTarget::A8B8G8R8 = true;
32 	bool Capabilities::Surface::RenderTarget::X8B8G8R8 = true;
33 	bool Capabilities::Surface::RenderTarget::G16R16 = true;
34 	bool Capabilities::Surface::RenderTarget::A2B10G10R10 = true;
35 
36 	bool Capabilities::Surface::DepthStencil::D32 = true;
37 	bool Capabilities::Surface::DepthStencil::D24S8 = true;
38 	bool Capabilities::Surface::DepthStencil::D24X8 = true;
39 	bool Capabilities::Surface::DepthStencil::D16 = true;
40 
41 	bool Capabilities::Surface::A8 = true;
42 	bool Capabilities::Surface::R5G6B5 = true;
43 	bool Capabilities::Surface::X1R5G5B5 = true;
44 	bool Capabilities::Surface::A1R5G5B5 = true;
45 	bool Capabilities::Surface::A4R4G4B4 = true;
46 	bool Capabilities::Surface::R3G3B2 = true;
47 	bool Capabilities::Surface::A8R3G3B2 = true;
48 	bool Capabilities::Surface::X4R4G4B4 = true;
49 	bool Capabilities::Surface::R8G8B8 = false;
50 	bool Capabilities::Surface::X8R8G8B8 = true;
51 	bool Capabilities::Surface::A8R8G8B8 = true;
52 	bool Capabilities::Surface::X8B8G8R8 = true;
53 	bool Capabilities::Surface::A8B8G8R8 = true;
54 	bool Capabilities::Surface::P8 = false;
55 	bool Capabilities::Surface::A8P8 = false;
56 	bool Capabilities::Surface::G16R16 = true;
57 	bool Capabilities::Surface::A2B10G10R10 = true;
58 	bool Capabilities::Surface::DXT1 = true;
59 	bool Capabilities::Surface::DXT2 = true;
60 	bool Capabilities::Surface::DXT3 = true;
61 	bool Capabilities::Surface::DXT4 = true;
62 	bool Capabilities::Surface::DXT5 = true;
63 	bool Capabilities::Surface::V8U8 = true;
64 	bool Capabilities::Surface::L6V5U5 = true;
65 	bool Capabilities::Surface::X8L8V8U8 = true;
66 	bool Capabilities::Surface::Q8W8V8U8 = true;
67 	bool Capabilities::Surface::V16U16 = true;
68 	bool Capabilities::Surface::A2W10V10U10 = true;
69 	bool Capabilities::Surface::L8 = true;
70 	bool Capabilities::Surface::A4L4 = true;
71 	bool Capabilities::Surface::A8L8 = true;
72 
73 	bool Capabilities::Volume::A8 = true;
74 	bool Capabilities::Volume::R5G6B5 = true;
75 	bool Capabilities::Volume::X1R5G5B5 = true;
76 	bool Capabilities::Volume::A1R5G5B5 = true;
77 	bool Capabilities::Volume::A4R4G4B4 = true;
78 	bool Capabilities::Volume::R3G3B2 = true;
79 	bool Capabilities::Volume::A8R3G3B2 = true;
80 	bool Capabilities::Volume::X4R4G4B4 = true;
81 	bool Capabilities::Volume::R8G8B8 = false;
82 	bool Capabilities::Volume::X8R8G8B8 = true;
83 	bool Capabilities::Volume::A8R8G8B8 = true;
84 	bool Capabilities::Volume::X8B8G8R8 = true;
85 	bool Capabilities::Volume::A8B8G8R8 = true;
86 	bool Capabilities::Volume::P8 = false;
87 	bool Capabilities::Volume::A8P8 = false;
88 	bool Capabilities::Volume::G16R16 = true;
89 	bool Capabilities::Volume::A2B10G10R10 = true;
90 	bool Capabilities::Volume::DXT1 = true;
91 	bool Capabilities::Volume::DXT2 = true;
92 	bool Capabilities::Volume::DXT3 = true;
93 	bool Capabilities::Volume::DXT4 = true;
94 	bool Capabilities::Volume::DXT5 = true;
95 	bool Capabilities::Volume::V8U8 = true;
96 	bool Capabilities::Volume::L6V5U5 = true;
97 	bool Capabilities::Volume::X8L8V8U8 = true;
98 	bool Capabilities::Volume::Q8W8V8U8 = true;
99 	bool Capabilities::Volume::V16U16 = true;
100 	bool Capabilities::Volume::A2W10V10U10 = true;
101 	bool Capabilities::Volume::L8 = true;
102 	bool Capabilities::Volume::A4L4 = true;
103 	bool Capabilities::Volume::A8L8 = true;
104 
105 	bool Capabilities::CubeMap::RenderTarget::R8G8B8 = false;
106 	bool Capabilities::CubeMap::RenderTarget::R5G6B5 = true;
107 	bool Capabilities::CubeMap::RenderTarget::X1R5G5B5 = true;
108 	bool Capabilities::CubeMap::RenderTarget::A1R5G5B5 = true;
109 	bool Capabilities::CubeMap::RenderTarget::A4R4G4B4 = true;
110 	bool Capabilities::CubeMap::RenderTarget::R3G3B2 = false;
111 	bool Capabilities::CubeMap::RenderTarget::A8R3G3B2 = false;
112 	bool Capabilities::CubeMap::RenderTarget::X4R4G4B4 = true;
113 	bool Capabilities::CubeMap::RenderTarget::A8R8G8B8 = true;
114 	bool Capabilities::CubeMap::RenderTarget::X8R8G8B8 = true;
115 	bool Capabilities::CubeMap::RenderTarget::A8B8G8R8 = true;
116 	bool Capabilities::CubeMap::RenderTarget::X8B8G8R8 = true;
117 	bool Capabilities::CubeMap::RenderTarget::G16R16 = true;
118 	bool Capabilities::CubeMap::RenderTarget::A2B10G10R10 = true;
119 
120 	bool Capabilities::CubeMap::DepthStencil::D32 = false;
121 	bool Capabilities::CubeMap::DepthStencil::D24S8 = false;
122 	bool Capabilities::CubeMap::DepthStencil::D24X8 = false;
123 	bool Capabilities::CubeMap::DepthStencil::D16 = false;
124 
125 	bool Capabilities::CubeMap::A8 = true;
126 	bool Capabilities::CubeMap::R5G6B5 = true;
127 	bool Capabilities::CubeMap::X1R5G5B5 = true;
128 	bool Capabilities::CubeMap::A1R5G5B5 = true;
129 	bool Capabilities::CubeMap::A4R4G4B4 = true;
130 	bool Capabilities::CubeMap::R3G3B2 = true;
131 	bool Capabilities::CubeMap::A8R3G3B2 = true;
132 	bool Capabilities::CubeMap::X4R4G4B4 = true;
133 	bool Capabilities::CubeMap::R8G8B8 = false;
134 	bool Capabilities::CubeMap::X8R8G8B8 = true;
135 	bool Capabilities::CubeMap::A8R8G8B8 = true;
136 	bool Capabilities::CubeMap::X8B8G8R8 = true;
137 	bool Capabilities::CubeMap::A8B8G8R8 = true;
138 	bool Capabilities::CubeMap::P8 = false;
139 	bool Capabilities::CubeMap::A8P8 = false;
140 	bool Capabilities::CubeMap::G16R16 = true;
141 	bool Capabilities::CubeMap::A2B10G10R10 = true;
142 	bool Capabilities::CubeMap::DXT1 = true;
143 	bool Capabilities::CubeMap::DXT2 = true;
144 	bool Capabilities::CubeMap::DXT3 = true;
145 	bool Capabilities::CubeMap::DXT4 = true;
146 	bool Capabilities::CubeMap::DXT5 = true;
147 	bool Capabilities::CubeMap::V8U8 = true;
148 	bool Capabilities::CubeMap::L6V5U5 = true;
149 	bool Capabilities::CubeMap::X8L8V8U8 = true;
150 	bool Capabilities::CubeMap::Q8W8V8U8 = true;
151 	bool Capabilities::CubeMap::V16U16 = true;
152 	bool Capabilities::CubeMap::A2W10V10U10 = true;
153 	bool Capabilities::CubeMap::L8 = true;
154 	bool Capabilities::CubeMap::A4L4 = true;
155 	bool Capabilities::CubeMap::A8L8 = true;
156 
157 	bool Capabilities::VolumeTexture::A8 = true;
158 	bool Capabilities::VolumeTexture::R5G6B5 = true;
159 	bool Capabilities::VolumeTexture::X1R5G5B5 = true;
160 	bool Capabilities::VolumeTexture::A1R5G5B5 = true;
161 	bool Capabilities::VolumeTexture::A4R4G4B4 = true;
162 	bool Capabilities::VolumeTexture::R3G3B2 = true;
163 	bool Capabilities::VolumeTexture::A8R3G3B2 = true;
164 	bool Capabilities::VolumeTexture::X4R4G4B4 = true;
165 	bool Capabilities::VolumeTexture::R8G8B8 = false;
166 	bool Capabilities::VolumeTexture::X8R8G8B8 = true;
167 	bool Capabilities::VolumeTexture::A8R8G8B8 = true;
168 	bool Capabilities::VolumeTexture::X8B8G8R8 = true;
169 	bool Capabilities::VolumeTexture::A8B8G8R8 = true;
170 	bool Capabilities::VolumeTexture::P8 = false;
171 	bool Capabilities::VolumeTexture::A8P8 = false;
172 	bool Capabilities::VolumeTexture::G16R16 = true;
173 	bool Capabilities::VolumeTexture::A2B10G10R10 = true;
174 	bool Capabilities::VolumeTexture::DXT1 = true;
175 	bool Capabilities::VolumeTexture::DXT2 = true;
176 	bool Capabilities::VolumeTexture::DXT3 = true;
177 	bool Capabilities::VolumeTexture::DXT4 = true;
178 	bool Capabilities::VolumeTexture::DXT5 = true;
179 	bool Capabilities::VolumeTexture::V8U8 = true;
180 	bool Capabilities::VolumeTexture::L6V5U5 = true;
181 	bool Capabilities::VolumeTexture::X8L8V8U8 = true;
182 	bool Capabilities::VolumeTexture::Q8W8V8U8 = true;
183 	bool Capabilities::VolumeTexture::V16U16 = true;
184 	bool Capabilities::VolumeTexture::A2W10V10U10 = true;
185 	bool Capabilities::VolumeTexture::L8 = true;
186 	bool Capabilities::VolumeTexture::A4L4 = true;
187 	bool Capabilities::VolumeTexture::A8L8 = true;
188 
189 	bool Capabilities::Texture::RenderTarget::R8G8B8 = false;
190 	bool Capabilities::Texture::RenderTarget::R5G6B5 = true;
191 	bool Capabilities::Texture::RenderTarget::X1R5G5B5 = true;
192 	bool Capabilities::Texture::RenderTarget::A1R5G5B5 = true;
193 	bool Capabilities::Texture::RenderTarget::A4R4G4B4 = true;
194 	bool Capabilities::Texture::RenderTarget::R3G3B2 = false;
195 	bool Capabilities::Texture::RenderTarget::A8R3G3B2 = false;
196 	bool Capabilities::Texture::RenderTarget::X4R4G4B4 = true;
197 	bool Capabilities::Texture::RenderTarget::A8R8G8B8 = true;
198 	bool Capabilities::Texture::RenderTarget::X8R8G8B8 = true;
199 	bool Capabilities::Texture::RenderTarget::A8B8G8R8 = true;
200 	bool Capabilities::Texture::RenderTarget::X8B8G8R8 = true;
201 	bool Capabilities::Texture::RenderTarget::G16R16 = true;
202 	bool Capabilities::Texture::RenderTarget::A2B10G10R10 = true;
203 
204 	bool Capabilities::Texture::DepthStencil::D32 = false;
205 	bool Capabilities::Texture::DepthStencil::D24S8 = false;
206 	bool Capabilities::Texture::DepthStencil::D24X8 = false;
207 	bool Capabilities::Texture::DepthStencil::D16 = false;
208 
209 	bool Capabilities::Texture::A8 = true;
210 	bool Capabilities::Texture::R5G6B5 = true;
211 	bool Capabilities::Texture::X1R5G5B5 = true;
212 	bool Capabilities::Texture::A1R5G5B5 = true;
213 	bool Capabilities::Texture::A4R4G4B4 = true;
214 	bool Capabilities::Texture::R3G3B2 = true;
215 	bool Capabilities::Texture::A8R3G3B2 = true;
216 	bool Capabilities::Texture::X4R4G4B4 = true;
217 	bool Capabilities::Texture::R8G8B8 = false;
218 	bool Capabilities::Texture::X8R8G8B8 = true;
219 	bool Capabilities::Texture::A8R8G8B8 = true;
220 	bool Capabilities::Texture::X8B8G8R8 = true;
221 	bool Capabilities::Texture::A8B8G8R8 = true;
222 	bool Capabilities::Texture::P8 = false;
223 	bool Capabilities::Texture::A8P8 = false;
224 	bool Capabilities::Texture::G16R16 = true;
225 	bool Capabilities::Texture::A2B10G10R10 = true;
226 	bool Capabilities::Texture::DXT1 = true;
227 	bool Capabilities::Texture::DXT2 = true;
228 	bool Capabilities::Texture::DXT3 = true;
229 	bool Capabilities::Texture::DXT4 = true;
230 	bool Capabilities::Texture::DXT5 = true;
231 	bool Capabilities::Texture::V8U8 = true;
232 	bool Capabilities::Texture::L6V5U5 = true;
233 	bool Capabilities::Texture::X8L8V8U8 = true;
234 	bool Capabilities::Texture::Q8W8V8U8 = true;
235 	bool Capabilities::Texture::V16U16 = true;
236 	bool Capabilities::Texture::A2W10V10U10 = true;
237 	bool Capabilities::Texture::L8 = true;
238 	bool Capabilities::Texture::A4L4 = true;
239 	bool Capabilities::Texture::A8L8 = true;
240 
241 	unsigned int pixelShaderVersion = D3DPS_VERSION(1, 4);
242 	unsigned int vertexShaderVersion = D3DVS_VERSION(1, 1);
243 
244 	unsigned int textureMemory = 256 * 1024 * 1024;
245 	unsigned int maxAnisotropy = 16;
246 }
247