gallium: add PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY
authorMarek Olšák <marek.olsak@amd.com>
Thu, 15 Feb 2018 00:32:08 +0000 (01:32 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 30 May 2018 00:13:24 +0000 (20:13 -0400)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
18 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_get.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index 5bc6ee99f0885abdff83f1ddfed952ae863723d1..0f18b7a94b91634c88865ef1026364d3ed49779f 100644 (file)
@@ -93,6 +93,12 @@ The integer capabilities:
   shader.
 * ``PIPE_CAP_GLSL_FEATURE_LEVEL``: Whether the driver supports features
   equivalent to a specific GLSL version. E.g. for GLSL 1.3, report 130.
+* ``PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY``: Whether the driver supports
+  features equivalent to a specific GLSL version including all legacy OpenGL
+  features only present in the OpenGL compatibility profile.
+  The only legacy features that Gallium drivers must implement are
+  the legacy shader inputs and outputs (colors, texcoords, fog, clipvertex,
+  edgeflag).
 * ``PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION``: Whether quads adhere to
   the flatshade_first setting in ``pipe_rasterizer_state``.
 * ``PIPE_CAP_USER_VERTEX_BUFFERS``: Whether the driver supports user vertex
index 10e60f5f9e533b8dacff53cd286975b1fa426838..e031807117c0afd4dbad988fb44af7652fc6b0ef 100644 (file)
@@ -154,6 +154,7 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
       return 4; /* XXX could easily be supported */
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
       return 120;
 
    case PIPE_CAP_NPOT_TEXTURES:
index 7b97b79557dad1e6e3c496cd7ff0c012ae269558..a414cb6d60ef9f659dea6ed348682b99245cdc78 100644 (file)
@@ -261,6 +261,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return 64;
 
        case PIPE_CAP_GLSL_FEATURE_LEVEL:
+       case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
                if (glsl120)
                        return 120;
                return is_ir3(screen) ? 140 : 120;
index 1b8c0ad9a2994f8c0285870ba0921d8b3de23fc6..b08d2283e7ebb707d4aec5a50cc32f4d6187c5ac 100644 (file)
@@ -342,6 +342,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
       return 64;
 
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
       return 120;
 
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
index af1aff4e1e0655e0a785ed1785010182b58c1d1f..f12ad09298daeb1d16516007d07df07d65976627 100644 (file)
@@ -205,6 +205,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return 330;
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return 140;
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
       return 0;
    case PIPE_CAP_COMPUTE:
index a24176a8e94790c3dde3dab06470f1cb6ab4c442..99249d26b3c8da7ae08176d2711fd650abb16086 100644 (file)
@@ -64,6 +64,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
       return 13;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
       return 120;
    case PIPE_CAP_ENDIANNESS:
       return PIPE_ENDIAN_LITTLE;
index b278a2f11b4120f965cd8df75b36440b9b136a4c..2495a545fde81287becf40ef135724ceb2a00aec 100644 (file)
@@ -109,6 +109,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 128 * 1024 * 1024;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return 330;
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return 140;
    case PIPE_CAP_MAX_RENDER_TARGETS:
       return 8;
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index e1c7b3a2364fbdb5ca1e0df7351b95621f17c5b1..f679cbdba3e3a29508d7b629ec7bb6ddefeb373c 100644 (file)
@@ -134,6 +134,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 128 * 1024 * 1024;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return 430;
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return 140;
    case PIPE_CAP_MAX_RENDER_TARGETS:
       return 8;
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 8a6e0c2f21fb55462d6dedcbe19069e134e9f967..459349e821cd372cf3a6712ac842a9fb3de7b16f 100644 (file)
@@ -120,6 +120,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
             return 16;
 
         case PIPE_CAP_GLSL_FEATURE_LEVEL:
+        case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
             return 120;
 
         /* r300 cannot do swizzling of compressed textures. Supported otherwise. */
index 1a293ea69870c7e4f55bb1d3eb3c65baf099b5d2..ff7306998bbd2aa33660abba4a558d9d1a0e822d 100644 (file)
@@ -343,6 +343,9 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                   return 330;
                return 140;
 
+       case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+               return 140;
+
        /* Supported except the original R600. */
        case PIPE_CAP_INDEP_BLEND_ENABLE:
        case PIPE_CAP_INDEP_BLEND_FUNC:
index 5379ba9ade5063a037ff259efa9474aa4eb89aa2..01050cf02b4dd9beea5fe4c9b084882b3acfeb75 100644 (file)
@@ -214,6 +214,9 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                        return 450;
                return 420;
 
+       case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+               return 140;
+
        case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
                return MIN2(sscreen->info.max_alloc_size, INT_MAX);
 
index f9c786ae75df3929af6e050c8042e62257ad33ff..f9c916d9382ca070e37c893bf1d68088f1744fd9 100644 (file)
@@ -151,6 +151,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return 330;
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return 140;
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
    case PIPE_CAP_TGSI_TEX_TXF_LZ:
       return 0;
index 82d7c98b685ef426ca9323e0fc9527064750c84c..2744f3100ebca8a9c8515a63038b0574b2dcc470 100644 (file)
@@ -278,6 +278,9 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return sws->have_vgpu10 ? 330 : 120;
 
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return sws->have_vgpu10 ? 140 : 120;
+
    case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
       return 0;
 
index 738792bf08be5e992f0be99755a404117d8fa5ca..091d322d38cd775360b74c49e184cc8ce380e397 100644 (file)
@@ -183,6 +183,8 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 7;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return 330;
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return 140;
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
       return 16;
    case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
index 3777802a6d75d50de0d1fb7fef80c526d18864a6..d578265eef0c5db4c2739974abfa88925c8e4b27 100644 (file)
@@ -123,6 +123,9 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_GLSL_FEATURE_LEVEL:
                 return 400;
 
+       case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+               return 140;
+
         case PIPE_CAP_MAX_VIEWPORTS:
                 return 1;
 
index d497cd2e8694cafd1f601f2f16c424de31a0859a..6415d95746b6901c00c02cbb822e8d3114bb7415 100644 (file)
@@ -164,6 +164,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                 return 256;
 
         case PIPE_CAP_GLSL_FEATURE_LEVEL:
+       case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
                 return 120;
 
         case PIPE_CAP_MAX_VIEWPORTS:
index 1ca9e85de73b09f854b2a9fabd5b5e5e6aaf64c7..5e764ff16b29075866d3ef7ebde33cdd2ddfebe5 100644 (file)
@@ -133,6 +133,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return vscreen->caps.caps.v1.glsl_level;
+   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+      return MIN2(vscreen->caps.caps.v1.glsl_level, 140);
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
       return 0;
    case PIPE_CAP_COMPUTE:
index 6b2f33b9e3729f0d2d8c709f2e651f942d7da3c8..6cc73a31bfc4fb04dcd18a100271382c5c2883e6 100644 (file)
@@ -686,6 +686,7 @@ enum pipe_cap
    PIPE_CAP_VERTEX_COLOR_UNCLAMPED,
    PIPE_CAP_VERTEX_COLOR_CLAMPED,
    PIPE_CAP_GLSL_FEATURE_LEVEL,
+   PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY,
    PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION,
    PIPE_CAP_USER_VERTEX_BUFFERS,
    PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY,