dri/common: Move __DRI2_RENDERER_PREFFERED_PROFILE handling to driQueryRendererIntege...
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 23 Feb 2014 22:03:48 +0000 (22:03 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 15 Aug 2014 16:35:37 +0000 (17:35 +0100)
Essentially all drivers would like to use to opengl core profile if
available, so avoid duplication by moving the code to a common fallback
within driQueryRendererIntegerCommon.

If a driver uses different approach they can handle it separately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.c

index eee77ec690c0de85243800b5a1294a39586c3613..e0b3db8cf14267e9615d3569986fc83c025caa8f 100644 (file)
@@ -519,6 +519,10 @@ driQueryRendererIntegerCommon(__DRIscreen *psp, int param, unsigned int *value)
       value[2] = v[2];
       return 0;
    }
+   case __DRI2_RENDERER_PREFERRED_PROFILE:
+      value[0] = (psp->max_gl_core_version != 0)
+         ? (1U << __DRI_API_OPENGL_CORE) : (1U << __DRI_API_OPENGL);
+      return 0;
    case __DRI2_RENDERER_OPENGL_CORE_PROFILE_VERSION:
       value[0] = psp->max_gl_core_version / 10;
       value[1] = psp->max_gl_core_version % 10;
index 4c9726c299fb5843c40e8697f37d9251e84ecd71..3aaa45f88bba96b090eb1224daf4b2e91d5ea9ea 100644 (file)
@@ -748,9 +748,6 @@ i915_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
    case __DRI2_RENDERER_UNIFIED_MEMORY_ARCHITECTURE:
       value[0] = 1;
       return 0;
-   case __DRI2_RENDERER_PREFERRED_PROFILE:
-      value[0] = (1U << __DRI_API_OPENGL);
-      return 0;
    default:
       return driQueryRendererIntegerCommon(psp, param, value);
    }
index ea0fc5814ff3d9419e249264f6103e14d6a50eec..9e743ee0b7b49f4476f3856984869009bc7cf9ce 100644 (file)
@@ -846,10 +846,6 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
    case __DRI2_RENDERER_UNIFIED_MEMORY_ARCHITECTURE:
       value[0] = 1;
       return 0;
-   case __DRI2_RENDERER_PREFERRED_PROFILE:
-      value[0] = (psp->max_gl_core_version != 0)
-         ? (1U << __DRI_API_OPENGL_CORE) : (1U << __DRI_API_OPENGL);
-      return 0;
    default:
       return driQueryRendererIntegerCommon(psp, param, value);
    }