summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2014-06-17 08:52:34 -0700
committerTom Stellard <[email protected]>2014-07-02 15:31:52 -0400
commitfea996c2aaf47707bd3f89ef493ae5760b4fe608 (patch)
treed14b8b72cf97d52918b57cfdc1fc5aaf05653c72
parent2ab44f657e3c8800aa610d39a04e88d6bf3bad01 (diff)
gallium: Add PIPE_SHADER_CAP_DOUBLES
This is for reporting whether or not double precision floating-point operations are supported. Reviewed-by: Francisco Jerez <[email protected]>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_limits.h2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.h2
-rw-r--r--src/gallium/docs/source/screen.rst2
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c2
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c5
-rw-r--r--src/gallium/include/pipe/p_defines.h3
6 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_limits.h b/src/gallium/auxiliary/gallivm/lp_bld_limits.h
index 6cb09490bc8..9ccaf46ead2 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_limits.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_limits.h
@@ -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.)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index d53c4ba5502..56a7034a313 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -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.)
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index a01810f2458..2ea0da83f48 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -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:
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 647d055a7cb..9fc4c98808e 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -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;
}
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index d4dfdd69174..184235d6cf6 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -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;
}
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 166391d6988..4d941a03ce6 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -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
};
/**