summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKevin Strasser <[email protected]>2019-01-24 17:10:02 -0800
committerAdam Jackson <[email protected]>2019-08-21 18:36:57 +0000
commita427c200801d8f0b3b15f3238e0767504d5bc4c0 (patch)
tree3db39bfb20158bedd28e198efc7219bb714cf1f7 /src/mesa/drivers
parent482ed4347d2c672423fcc4659cb20aee19dad7fd (diff)
dri: Add fp16 formats
Add dri formats for RGBA ordered 64 bpp IEEE 754 half precision floating point. Leverage existing offscreen render support for MESA_FORMAT_RGBA_FLOAT16 and MESA_FORMAT_RGBX_FLOAT16. Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c8
-rw-r--r--src/mesa/drivers/dri/common/utils.c14
2 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index ac3a04bceff..a384cadd557 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -887,6 +887,14 @@ static const struct {
.mesa_format = MESA_FORMAT_B8G8R8X8_UNORM,
},
{
+ .image_format = __DRI_IMAGE_FORMAT_ABGR16161616F,
+ .mesa_format = MESA_FORMAT_RGBA_FLOAT16,
+ },
+ {
+ .image_format = __DRI_IMAGE_FORMAT_XBGR16161616F,
+ .mesa_format = MESA_FORMAT_RGBX_FLOAT16,
+ },
+ {
.image_format = __DRI_IMAGE_FORMAT_ARGB2101010,
.mesa_format = MESA_FORMAT_B10G10R10A2_UNORM,
},
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 86ccfd637be..44e4e0f3720 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -212,6 +212,12 @@ driCreateConfigs(mesa_format format,
/* MESA_FORMAT_R10G10B10A2_UNORM */
{{ 0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000 },
{ 0, 10, 20, 30 }},
+ /* MESA_FORMAT_RGBX_FLOAT16 */
+ {{ 0, 0, 0, 0},
+ { 0, 16, 32, -1 }},
+ /* MESA_FORMAT_RGBA_FLOAT16 */
+ {{ 0, 0, 0, 0},
+ { 0, 16, 32, 48 }},
};
const uint32_t * masks;
@@ -260,6 +266,14 @@ driCreateConfigs(mesa_format format,
masks = format_table[4].masks;
shifts = format_table[4].shifts;
break;
+ case MESA_FORMAT_RGBX_FLOAT16:
+ masks = format_table[9].masks;
+ shifts = format_table[9].shifts;
+ break;
+ case MESA_FORMAT_RGBA_FLOAT16:
+ masks = format_table[10].masks;
+ shifts = format_table[10].shifts;
+ break;
case MESA_FORMAT_R10G10B10X2_UNORM:
masks = format_table[7].masks;
shifts = format_table[7].shifts;