[PATCH v2 14/14] etnaviv: add float formats

Christian Gmeiner christian.gmeiner at gmail.com
Tue May 1 14:48:43 UTC 2018


v1 -> v2:
 - rebased to master
 - added I16_FLOAT and I32_FLOAT as suggested by
   Wladimir J. van der Laan

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
 src/gallium/drivers/etnaviv/etnaviv_format.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c b/src/gallium/drivers/etnaviv/etnaviv_format.c
index 4be397e3bc..5b29c9126a 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_format.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
@@ -123,6 +123,11 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
    V_(R16_USCALED, UNSIGNED_SHORT, NONE, NONE),
    V_(R16_SSCALED, SHORT,          NONE, NONE),
    V_(R16_FLOAT,   HALF_FLOAT,     NONE, NONE),
+   VT(R16_FLOAT,   HALF_FLOAT,     EXT_R16F | EXT_FORMAT, SWIZ(X, Y, Z, W), A4R4G4B4 | RS_LAYER(1), NONE, R16F),
+
+   _T(A16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(0, 0, 0, X), A4R4G4B4 | RS_LAYER(1), NONE, NONE),
+   _T(L16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, X, X, 1), A4R4G4B4 | RS_LAYER(1), NONE, NONE),
+   _T(I16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, X, X, X), A4R4G4B4 | RS_LAYER(1), NONE, NONE),
 
    _T(B4G4R4A4_UNORM, A4R4G4B4, SWIZ(X, Y, Z, W), A4R4G4B4 | RS_LAYER(1), A4R4G4B4, A4R4G4B4),
    _T(B4G4R4X4_UNORM, X4R4G4B4, SWIZ(X, Y, Z, W), X4R4G4B4 | RS_LAYER(1), A4R4G4B4, X4R4G4B4),
@@ -156,9 +161,13 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
    V_(R32_UINT,    UNSIGNED_INT, NONE, NONE),
    V_(R32_USCALED, UNSIGNED_INT, NONE, NONE),
    V_(R32_SSCALED, INT,          NONE, NONE),
-   V_(R32_FLOAT,   FLOAT,        NONE, NONE),
+   VT(R32_FLOAT,   FLOAT,        EXT_R32F | EXT_FORMAT, SWIZ(X, Y, Z, W), A8R8G8B8 | RS_LAYER(1), NONE, R32F),
    V_(R32_FIXED,   FIXED,        NONE, NONE),
 
+   _T(A32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(0, 0, 0, X), A8R8G8B8 | RS_LAYER(1), NONE, NONE),
+   _T(L32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(X, X, X, 1), A8R8G8B8 | RS_LAYER(1), NONE, NONE),
+   _T(I32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(X, X, X, X), A8R8G8B8 | RS_LAYER(1), NONE, NONE),
+
    V_(R16G16_UNORM,   UNSIGNED_SHORT, NONE, NONE),
    V_(R16G16_SNORM,   SHORT,          NONE, NONE),
    V_(R16G16_UINT,    UNSIGNED_SHORT, NONE, NONE),
@@ -206,7 +215,8 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
    V_(R16G16B16A16_SINT,    SHORT,          NONE, NONE),
    V_(R16G16B16A16_USCALED, UNSIGNED_SHORT, NONE, NONE),
    V_(R16G16B16A16_SSCALED, SHORT,          NONE, NONE),
-   V_(R16G16B16A16_FLOAT,   HALF_FLOAT,     NONE, NONE),
+   VT(R16G16B16A16_FLOAT,   HALF_FLOAT,     EXT_A16B16G16R16F | EXT_FORMAT, SWIZ(X, Y, Z, W), A8R8G8B8 | RS_LAYER(2), NONE, A16B16G16R16F),
+   VT(R16G16B16X16_FLOAT,   HALF_FLOAT,     EXT_A16B16G16R16F | EXT_FORMAT, SWIZ(X, Y, Z, 1), A8R8G8B8 | RS_LAYER(2), NONE, A16B16G16R16F),
 
    V_(R32G32_UNORM,   UNSIGNED_INT, NONE, NONE),
    V_(R32G32_SNORM,   INT,          NONE, NONE),
@@ -214,7 +224,7 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
    V_(R32G32_SINT,    INT,          NONE, NONE),
    V_(R32G32_USCALED, UNSIGNED_INT, NONE, NONE),
    V_(R32G32_SSCALED, INT,          NONE, NONE),
-   V_(R32G32_FLOAT,   FLOAT,        NONE, NONE),
+   VT(R32G32_FLOAT,   FLOAT,        EXT_G32R32F | EXT_FORMAT, SWIZ(X, Y, Z, W), A8R8G8B8 | RS_LAYER(2), NONE, G32R32F),
    V_(R32G32_FIXED,   FIXED,        NONE, NONE),
 
    /* 96-bit */
-- 
2.17.0



More information about the etnaviv mailing list