summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2019-09-10 11:44:24 -0400
committerAdam Jackson <[email protected]>2019-09-20 19:10:31 +0000
commit55a1b583d931871df96e2219f4badc8b8afd2176 (patch)
tree88b11e608e34b6f62ba6e729290994ea0bd61109 /src/egl
parentd01406133db523e2b77ce1168725c008ff3c6967 (diff)
egl/surfaceless: Add FP16 format support
Reviewed-by: Kevin Strasser <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index d624533dcf3..20305c8685f 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -185,6 +185,8 @@ surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
int rgba_shifts[4];
unsigned int rgba_sizes[4];
} visuals[] = {
+ { "ABGR16F", { 0, 16, 32, 48 }, { 16, 16, 16, 16 } },
+ { "XBGR16F", { 0, 16, 32, -1 }, { 16, 16, 16, 0 } },
{ "A2RGB10", { 20, 10, 0, 30 }, { 10, 10, 10, 2 } },
{ "X2RGB10", { 20, 10, 0, -1 }, { 10, 10, 10, 0 } },
{ "ARGB8888", { 16, 8, 0, 24 }, { 8, 8, 8, 8 } },
@@ -239,10 +241,23 @@ surfaceless_flush_front_buffer(__DRIdrawable *driDrawable, void *loaderPrivate)
{
}
+static unsigned
+surfaceless_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
+{
+ /* Note: loaderPrivate is _EGLDisplay* */
+ switch (cap) {
+ case DRI_LOADER_CAP_FP16:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
static const __DRIimageLoaderExtension image_loader_extension = {
- .base = { __DRI_IMAGE_LOADER, 1 },
+ .base = { __DRI_IMAGE_LOADER, 2 },
.getBuffers = surfaceless_image_get_buffers,
.flushFrontBuffer = surfaceless_flush_front_buffer,
+ .getCapability = surfaceless_get_capability,
};
static const __DRIextension *image_loader_extensions[] = {