gallium: add PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY
authorMarek Olšák <marek.olsak@amd.com>
Sat, 31 Dec 2016 12:34:11 +0000 (13:34 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 5 Jan 2017 12:07:12 +0000 (13:07 +0100)
Drivers with good compilers don't need aggressive optimizations before TGSI.

Reviewed-by: Eric Anholt <eric@anholt.net>
17 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_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_pipe.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/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index 86aa2591abef6923fe2f89e999905e12e7ebd966..000551aac7976e84519e422bede7eb0893d89509 100644 (file)
@@ -366,6 +366,9 @@ The integer capabilities:
   ARB_transform_feedback3.
 * ``PIPE_CAP_TGSI_CAN_READ_OUTPUTS``: Whether every TGSI shader stage can read
   from the output file.
+* ``PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY``: Tell the GLSL compiler to use
+  the minimum amount of optimizations just to be able to do all the linking
+  and lowering.
 
 
 .. _pipe_capf:
index d84cd82777a5cbef7b4241026c54c4cd37b2662b..3b631372e9946d4fe913a906c18e9532c92c9e20 100644 (file)
@@ -295,6 +295,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
        case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
        case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
+        case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 14f42717b1d517d636735ae82412fede5e1a8b8b..18578c09027f8464a40b5e503ea9b8f6c3f31f0e 100644 (file)
@@ -296,6 +296,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
 
    case PIPE_CAP_MAX_VIEWPORTS:
index c3fad7314edf0ae581475fb806de106b2d96a94d..20a0e8d55fad7860fc1b4b42b7a9e4fbd4f4d0e2 100644 (file)
@@ -519,6 +519,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 83045cd5e3592737e29e4a0494ffffeb54c104bf..4501df46316a60713e62e0313bb06a23a02c3372 100644 (file)
@@ -340,6 +340,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
    }
    /* should only get here on unhandled cases */
index beffeac7a1fb576b7f1d8aa1e3d3d810fa553e4a..19df068e39bcd1213014aa068263fad3e864aa80 100644 (file)
@@ -205,6 +205,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 5b388b5aa1792a288768b4d5a1cce3aef811470e..56370014bc237cdcd8b54dc3584db7b537cc84cb 100644 (file)
@@ -257,6 +257,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 2526a14c5048a58870fbaa4c7399a622a23aa16b..25315913490b6bd307a1f5d1975bc469c903b7bb 100644 (file)
@@ -276,6 +276,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d6e3aa4a7bf91c62208f2c495a61562a44d85953..50a42efef0ee965b24a1e0a9a3bd498661bedf9d 100644 (file)
@@ -227,6 +227,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
         case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
         case PIPE_CAP_NATIVE_FENCE_FD:
+        case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
             return 0;
 
         /* SWTCL-only features. */
index b99da2212dd91ec35a8f8fef02dac12d043b474f..a0da24f096713f059547a5c001a0e0026c41c605 100644 (file)
@@ -376,6 +376,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
        case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
        case PIPE_CAP_NATIVE_FENCE_FD:
+        case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 11cca6ff5219a4d2068d1cc5a4a40bd86056a851..842eb5994d337ed0e5eb517bbf1d8f18c4eb65d2 100644 (file)
@@ -413,6 +413,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_CULL_DISTANCE:
        case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
        case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
+        case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
                return 1;
 
        case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
index 824e86788237fd02da93f8675c8ce7fd62c6b361..93c75032b4d601800d01f9e87f1f71290e17757e 100644 (file)
@@ -290,6 +290,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index 91484aaa717b47f396304eb40adaaa15ba08367b..3e274749e18680e119bf9b59d7308cfc89f992c3 100644 (file)
@@ -421,6 +421,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
    }
 
index a9905d79b4ed69f6e5a2c6805d64bb25b4e83e84..ad270e5bea27f78261d71541d16b2ca264124a95 100644 (file)
@@ -318,6 +318,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
    case PIPE_CAP_NATIVE_FENCE_FD:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 2a640b1c87d955d693f06afb4062a18a65b29573..3da6202e0203bf45731891b55095289829d40272 100644 (file)
@@ -241,6 +241,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
         case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
         case PIPE_CAP_NATIVE_FENCE_FD:
+        case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
                 return 0;
 
                 /* Stream output. */
index 8c062ba10b72f5be1deea56009566024485f9492..0a18aa03f028586fc0ef04c1291b367e75bfa682 100644 (file)
@@ -251,6 +251,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
    case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
    case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
+   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index f1dd7935a780a2f0ebee199a121a54e0cfcbc37a..7dfd7dd5b32a1e1f66cc526880d0d39d8c830cac 100644 (file)
@@ -743,6 +743,7 @@ enum pipe_cap
    PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS,
    PIPE_CAP_TGSI_CAN_READ_OUTPUTS,
    PIPE_CAP_NATIVE_FENCE_FD,
+   PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)