1
0
Fork 0
mutter-performance-source/cogl/cogl-gpu-info-private.h
Robert Bragg b8e380edc3 gpu-info: Detect more info including architecture
The GPU info api previously told us a driver package name and a driver
vendor name, but now we have introduced detection for the gpu
architecture too and started to track architecture feature flags that
can tell us whether a gpu is a deferred or immediate mode renderer for
example or if a software rasterizer is being used.

This also adds support for checking more vendor names. We should now
detect the following cases:

Vendors: Intel, Imagination Technologies, ARM, Qualcomm, Nvidia, ATI
Architectures: Sandybridge, SGX, Mali
Architecture flags:
  - vertex tiled
  - vertex immediate mode
  - vertex software
  - fragment deferred
  - fragment immediate mode
  - fragment software

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit b3803a0a7c9e663ed219e83626841895c7d95ad7)
2012-08-06 14:27:42 +01:00

110 lines
3.1 KiB
C

/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2012 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __COGL_GPU_INFO_PRIVATE_H
#define __COGL_GPU_INFO_PRIVATE_H
#include "cogl-context.h"
typedef enum _CoglGpuInfoArchitectureFlag
{
COGL_GPU_INFO_ARCHITECTURE_FLAG_VERTEX_IMMEDIATE_MODE,
COGL_GPU_INFO_ARCHITECTURE_FLAG_VERTEX_TILED,
COGL_GPU_INFO_ARCHITECTURE_FLAG_VERTEX_SOFTWARE,
COGL_GPU_INFO_ARCHITECTURE_FLAG_FRAGMENT_IMMEDIATE_MODE,
COGL_GPU_INFO_ARCHITECTURE_FLAG_FRAGMENT_DEFERRED,
COGL_GPU_INFO_ARCHITECTURE_FLAG_FRAGMENT_SOFTWARE
} CoglGpuInfoArchitectureFlag;
typedef enum _CoglGpuInfoArchitecture
{
COGL_GPU_INFO_ARCHITECTURE_UNKNOWN,
COGL_GPU_INFO_ARCHITECTURE_SANDYBRIDGE,
COGL_GPU_INFO_ARCHITECTURE_SGX,
COGL_GPU_INFO_ARCHITECTURE_MALI,
COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE,
COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE,
COGL_GPU_INFO_ARCHITECTURE_SWRAST
} CoglGpuInfoArchitecture;
typedef enum
{
COGL_GPU_INFO_VENDOR_UNKNOWN,
COGL_GPU_INFO_VENDOR_INTEL,
COGL_GPU_INFO_VENDOR_IMAGINATION_TECHNOLOGIES,
COGL_GPU_INFO_VENDOR_ARM,
COGL_GPU_INFO_VENDOR_QUALCOMM,
COGL_GPU_INFO_VENDOR_NVIDIA,
COGL_GPU_INFO_VENDOR_ATI,
COGL_GPU_INFO_VENDOR_MESA
} CoglGpuInfoVendor;
typedef enum
{
COGL_GPU_INFO_DRIVER_PACKAGE_UNKNOWN,
COGL_GPU_INFO_DRIVER_PACKAGE_MESA
} CoglGpuInfoDriverPackage;
typedef enum
{
/* If this bug is present then it is faster to read pixels into a
* PBO and then memcpy out of the PBO into system memory rather than
* directly read into system memory.
* https://bugs.freedesktop.org/show_bug.cgi?id=46631
*/
COGL_GPU_INFO_DRIVER_BUG_MESA_46631_SLOW_READ_PIXELS = 1 << 0
} CoglGpuInfoDriverBug;
typedef struct _CoglGpuInfoVersion CoglGpuInfoVersion;
typedef struct _CoglGpuInfo CoglGpuInfo;
struct _CoglGpuInfo
{
CoglGpuInfoVendor vendor;
const char *vendor_name;
CoglGpuInfoDriverPackage driver_package;
const char *driver_package_name;
int driver_package_version;
CoglGpuInfoArchitecture architecture;
const char *architecture_name;
CoglGpuInfoArchitectureFlag architecture_flags;
CoglGpuInfoDriverBug driver_bugs;
};
/*
* _cogl_gpu_info_init:
* @ctx: A #CoglContext
* @gpu: A return location for the GPU information
*
* Determines information about the GPU and driver from the given
* context.
*/
void
_cogl_gpu_info_init (CoglContext *ctx,
CoglGpuInfo *gpu);
#endif /* __COGL_GPU_INFO_PRIVATE_H */