Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 757 vs 772 for /trunk/Source Code/Platform/Video/OpenGL/SDLWindowWrapper.cpp

Diff revisions: vs.
  @@ -161,22 +161,63 @@
161 161 // Maximum number of colour attachments per framebuffer
162 162 par.setParam<I32>(_ID("rendering.maxRenderTargetOutputs"),
163 163 GLUtil::getIntegerv(GL_MAX_COLOR_ATTACHMENTS));
164 +
164 165 // Query GPU vendor to enable/disable vendor specific features
165 - const char* gpuVendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
166 - if (gpuVendor != nullptr) {
167 - if (strstr(gpuVendor, "Intel") != nullptr) {
168 - GFX_DEVICE.setGPUVendor(GPUVendor::INTEL);
169 - } else if (strstr(gpuVendor, "NVIDIA") != nullptr) {
170 - GFX_DEVICE.setGPUVendor(GPUVendor::NVIDIA);
171 - } else if (strstr(gpuVendor, "ATI") != nullptr ||
172 - strstr(gpuVendor, "AMD") != nullptr) {
173 - GFX_DEVICE.setGPUVendor(GPUVendor::AMD);
166 + GPUVendor vendor = GPUVendor::COUNT;
167 + const char* gpuVendorStr = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
168 + if (gpuVendorStr != nullptr) {
169 + if (strstr(gpuVendorStr, "Intel") != nullptr) {
170 + vendor = GPUVendor::INTEL;
171 + } else if (strstr(gpuVendorStr, "NVIDIA") != nullptr) {
172 + vendor = GPUVendor::NVIDIA;
173 + } else if (strstr(gpuVendorStr, "ATI") != nullptr || strstr(gpuVendorStr, "AMD") != nullptr) {
174 + vendor = GPUVendor::AMD;
175 + } else if(strstr(gpuVendorStr, "Microsoft") != nullptr) {
176 + vendor = GPUVendor::MICROSOFT;
177 + } else {
178 + vendor = GPUVendor::OTHER;
179 + }
180 + } else {
181 + gpuVendorStr = "Unknown GPU Vendor";
182 + vendor = GPUVendor::OTHER;
183 + }
184 + GPURenderer renderer = GPURenderer::COUNT;
185 + const char* gpuRendererStr = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
186 + if (gpuRendererStr != nullptr) {
187 + if (strstr(gpuRendererStr,"Tegra") || strstr(gpuRendererStr, "GeForce") || strstr(gpuRendererStr, "NV")) {
188 + renderer = GPURenderer::GEFORCE;
189 + } else if(strstr(gpuRendererStr, "PowerVR") || strstr(gpuRendererStr, "Apple")) {
190 + renderer = GPURenderer::POWERVR;
191 + vendor = GPUVendor::IMAGINATION_TECH;
192 + } else if(strstr(gpuRendererStr, "Mali")) {
193 + renderer = GPURenderer::MALI;
194 + vendor = GPUVendor::ARM;
195 + } else if (strstr(gpuRendererStr, "Adreno")) {
196 + renderer = GPURenderer::ADRENO;
197 + vendor = GPUVendor::QUALCOMM;
198 + } else if(strstr(gpuRendererStr, "AMD") || strstr(gpuRendererStr, "ATI")) {
199 + renderer = GPURenderer::RADEON;
200 + } else if (strstr(gpuRendererStr, "Intel")) {
201 + renderer = GPURenderer::INTEL;
202 + } else if(strstr(gpuRendererStr, "Vivante")) {
203 + renderer = GPURenderer::VIVANTE;
204 + vendor = GPUVendor::VIVANTE;
205 + } else if(strstr(gpuRendererStr, "VideoCore")) {
206 + renderer = GPURenderer::VIDEOCORE;
207 + vendor = GPUVendor::ALPHAMOSAIC;
208 + } else if(strstr(gpuRendererStr, "WebKit") || strstr(gpuRendererStr, "Mozilla") || strstr(gpuRendererStr, "ANGLE")) {
209 + renderer = GPURenderer::WEBGL;
210 + vendor = GPUVendor::WEBGL;
211 + } else {
212 + renderer = GPURenderer::UNKNOWN;
174 213 }
175 214 } else {
176 - gpuVendor = "Unknown GPU Vendor";
177 - GFX_DEVICE.setGPUVendor(GPUVendor::OTHER);
215 + gpuRendererStr = "Unknown GPU Renderer";
216 + renderer = GPURenderer::UNKNOWN;
178 217 }
179 218
219 + GFX_DEVICE.setGPURenderer(renderer);
220 + GFX_DEVICE.setGPUVendor(vendor);
180 221 // Cap max anisotropic level to what the hardware supports
181 222 par.setParam(
182 223 _ID("rendering.anisotropicFilteringLevel"),
  @@ -218,8 +259,8 @@
218 259 Console::printfn(Locale::get(_ID("GL_GLSL_SUPPORT")),
219 260 glGetString(GL_SHADING_LANGUAGE_VERSION));
220 261 // GPU info, including vendor, gpu and driver
221 - Console::printfn(Locale::get(_ID("GL_VENDOR_STRING")), gpuVendor,
222 - glGetString(GL_RENDERER), glGetString(GL_VERSION));
262 + Console::printfn(Locale::get(_ID("GL_VENDOR_STRING")),
263 + gpuVendorStr, gpuRendererStr, glGetString(GL_VERSION));
223 264 // In order: Maximum number of uniform buffer binding points,
224 265 // maximum size in basic machine units of a uniform block and
225 266 // minimum required alignment for uniform buffer sizes and offset