gallium: Add PIPE_SHADER_CAP_DOUBLES
authorTom Stellard <thomas.stellard@amd.com>
Tue, 17 Jun 2014 15:52:34 +0000 (08:52 -0700)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 2 Jul 2014 19:31:52 +0000 (15:31 -0400)
This is for reporting whether or not double precision floating-point
operations are supported.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/auxiliary/gallivm/lp_bld_limits.h
src/gallium/auxiliary/tgsi/tgsi_exec.h
src/gallium/docs/source/screen.rst
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/include/pipe/p_defines.h

index 6cb09490bc8e55213b1e98b2351db39825132c2c..9ccaf46ead229e896cfd95bedf970fdf285fcdba 100644 (file)
@@ -126,6 +126,8 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
       return PIPE_SHADER_IR_TGSI;
    case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
       return 1;
+   case PIPE_SHADER_CAP_DOUBLES:
+      return 0;
    }
    /* if we get here, we missed a shader cap above (and should have seen
     * a compiler warning.)
index d53c4ba550279d096daf393570f113906b5aecfe..56a7034a313c36080041c3eb5f9d40c945bd35ec 100644 (file)
@@ -456,6 +456,8 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
       return PIPE_SHADER_IR_TGSI;
    case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
       return 1;
+   case PIPE_SHADER_CAP_DOUBLES:
+      return 0;
    }
    /* if we get here, we missed a shader cap above (and should have seen
     * a compiler warning.)
index a01810f24585d6ce39f7ea47f228c7c2250c3e4f..2ea0da83f4837ddf51489f4f734fa7b9b82e3dda 100644 (file)
@@ -288,6 +288,8 @@ to be 0.
   program.  It should be one of the ``pipe_shader_ir`` enum values.
 * ``PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS``: The maximum number of texture
   sampler views. Must not be lower than PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS.
+* ``PIPE_SHADER_CAP_DOUBLES``: Whether double precision floating-point
+  operations are supported.
 
 
 .. _pipe_compute_cap:
index 647d055a7cb7d72db701693566549a967147dcba..9fc4c98808eb2a03c29b539492254593302e6477 100644 (file)
@@ -447,6 +447,8 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
                } else {
                        return PIPE_SHADER_IR_TGSI;
                }
+       case PIPE_SHADER_CAP_DOUBLES:
+               return 0;
        }
        return 0;
 }
index d4dfdd6917460220c240ee9238775a86cfd8290c..184235d6cf60b4c18588f188f2eab82473c757f5 100644 (file)
@@ -327,6 +327,9 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
                switch (param) {
                case PIPE_SHADER_CAP_PREFERRED_IR:
                        return PIPE_SHADER_IR_LLVM;
+               case PIPE_SHADER_CAP_DOUBLES:
+                       return 0; /* XXX: Enable doubles once the compiler can
+                                    handle them. */
                default:
                        return 0;
                }
@@ -378,6 +381,8 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
                return 16;
        case PIPE_SHADER_CAP_PREFERRED_IR:
                return PIPE_SHADER_IR_TGSI;
+       case PIPE_SHADER_CAP_DOUBLES:
+               return 0;
        }
        return 0;
 }
index 166391d698863a6eae5bb34937cc927019bd51df..4d941a03ce6e80c56a74c6848ef33225bd609ba3 100644 (file)
@@ -620,7 +620,8 @@ enum pipe_shader_cap
    PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS,
    PIPE_SHADER_CAP_PREFERRED_IR,
    PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED,
-   PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS
+   PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS,
+   PIPE_SHADER_CAP_DOUBLES
 };
 
 /**