summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKevin Strasser <[email protected]>2019-01-24 16:44:06 -0800
committerAdam Jackson <[email protected]>2019-08-21 18:36:57 +0000
commit86d31c2c120c458a8df99921ba49773f9e44651a (patch)
tree4825496b66fa8158f33354b5d0c5d688ae8c78d0 /src/mesa/drivers
parentd4a9010338e191cb9b3f2d1c666e0b5f2275e84b (diff)
dri: Handle configs with floating point pixel data
In order to handle pixel formats that consist of floating point data, enable floatMode field in the dri config, and set __DRI_ATTRIB_FLOAT_BIT in the render type attribute. 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/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index fb991e4e483..86ccfd637be 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -226,6 +226,7 @@ driCreateConfigs(mesa_format format,
int blue_bits;
int alpha_bits;
bool is_srgb;
+ bool is_float;
switch (format) {
case MESA_FORMAT_B5G6R5_UNORM:
@@ -279,6 +280,7 @@ driCreateConfigs(mesa_format format,
blue_bits = _mesa_get_format_bits(format, GL_BLUE_BITS);
alpha_bits = _mesa_get_format_bits(format, GL_ALPHA_BITS);
is_srgb = _mesa_is_format_srgb(format);
+ is_float = _mesa_get_format_datatype(format) == GL_FLOAT;
num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes;
configs = calloc(num_modes + 1, sizeof *configs);
@@ -308,6 +310,7 @@ driCreateConfigs(mesa_format format,
c++;
memset(modes, 0, sizeof *modes);
+ modes->floatMode = is_float;
modes->redBits = red_bits;
modes->greenBits = green_bits;
modes->blueBits = blue_bits;
@@ -481,6 +484,8 @@ driGetConfigAttribIndex(const __DRIconfig *config,
case __DRI_ATTRIB_RENDER_TYPE:
/* no support for color index mode */
*value = __DRI_ATTRIB_RGBA_BIT;
+ if (config->modes.floatMode)
+ *value |= __DRI_ATTRIB_FLOAT_BIT;
break;
case __DRI_ATTRIB_CONFIG_CAVEAT:
if (config->modes.visualRating == GLX_NON_CONFORMANT_CONFIG)