PIPE_FORMAT_R32A32_UINT , plain, 1, 1, up32 , up32 , , , x00y, rgb
PIPE_FORMAT_R32A32_SINT , plain, 1, 1, sp32 , sp32 , , , x00y, rgb
PIPE_FORMAT_R10G10B10A2_UINT , plain, 1, 1, up10 , up10 , up10, up2 , xyzw, rgb
+
+PIPE_FORMAT_B5G6R5_SRGB , plain, 1, 1, un5 , un6 , un5 , , zyx1, srgb
+
return PIPE_FORMAT_DXT3_SRGBA;
case PIPE_FORMAT_DXT5_RGBA:
return PIPE_FORMAT_DXT5_SRGBA;
+ case PIPE_FORMAT_B5G6R5_UNORM:
+ return PIPE_FORMAT_B5G6R5_SRGB;
default:
return PIPE_FORMAT_NONE;
}
return PIPE_FORMAT_DXT3_RGBA;
case PIPE_FORMAT_DXT5_SRGBA:
return PIPE_FORMAT_DXT5_RGBA;
+ case PIPE_FORMAT_B5G6R5_SRGB:
+ return PIPE_FORMAT_B5G6R5_UNORM;
default:
return format;
}
if src_colorspace == SRGB:
assert src_channel.type == UNSIGNED
assert src_channel.norm
- assert src_channel.size == 8
+ assert src_channel.size <= 8
+ assert src_channel.size >= 4
assert dst_colorspace == RGB
+ if src_channel.size < 8:
+ value = '%s << %x | %s >> %x' % (value, 8 - src_channel.size, value, 2 * src_channel.size - 8)
if dst_channel.type == FLOAT:
return 'util_format_srgb_8unorm_to_linear_float(%s)' % value
else:
elif dst_colorspace == SRGB:
assert dst_channel.type == UNSIGNED
assert dst_channel.norm
- assert dst_channel.size == 8
+ assert dst_channel.size <= 8
assert src_colorspace == RGB
if src_channel.type == FLOAT:
- return 'util_format_linear_float_to_srgb_8unorm(%s)' % value
+ value = 'util_format_linear_float_to_srgb_8unorm(%s)' % value
else:
assert src_channel.type == UNSIGNED
assert src_channel.norm
assert src_channel.size == 8
- return 'util_format_linear_to_srgb_8unorm(%s)' % value
+ value = 'util_format_linear_to_srgb_8unorm(%s)' % value
+ # XXX rounding is all wrong.
+ if dst_channel.size < 8:
+ return '%s >> %x' % (value, 8 - dst_channel.size)
+ else:
+ return value
elif src_colorspace == ZS:
pass
elif dst_colorspace == ZS:
PIPE_FORMAT_R32A32_SINT = 252,
PIPE_FORMAT_R10G10B10A2_UINT = 253,
+ PIPE_FORMAT_B5G6R5_SRGB = 254,
+
PIPE_FORMAT_COUNT
};