{
switch (format) {
/* 8-bit buffers. */
- case PIPE_FORMAT_A8_UNORM:
- case PIPE_FORMAT_I8_UNORM:
- case PIPE_FORMAT_L8_UNORM:
case PIPE_FORMAT_R8_UNORM:
- case PIPE_FORMAT_L8_SRGB:
return VFMT_NORM_UBYTE_8;
- case PIPE_FORMAT_A8_SNORM:
- case PIPE_FORMAT_I8_SNORM:
- case PIPE_FORMAT_L8_SNORM:
case PIPE_FORMAT_R8_SNORM:
return VFMT_NORM_BYTE_8;
- case PIPE_FORMAT_A8_UINT:
- case PIPE_FORMAT_I8_UINT:
- case PIPE_FORMAT_L8_UINT:
case PIPE_FORMAT_R8_UINT:
return VFMT_UBYTE_8;
- case PIPE_FORMAT_A8_SINT:
- case PIPE_FORMAT_I8_SINT:
- case PIPE_FORMAT_L8_SINT:
case PIPE_FORMAT_R8_SINT:
return VFMT_BYTE_8;
/* 16-bit buffers. */
case PIPE_FORMAT_R16_UNORM:
- case PIPE_FORMAT_A16_UNORM:
- case PIPE_FORMAT_L16_UNORM:
- case PIPE_FORMAT_I16_UNORM:
case PIPE_FORMAT_Z16_UNORM:
return VFMT_NORM_USHORT_16;
case PIPE_FORMAT_R16_SNORM:
- case PIPE_FORMAT_A16_SNORM:
- case PIPE_FORMAT_L16_SNORM:
- case PIPE_FORMAT_I16_SNORM:
return VFMT_NORM_SHORT_16;
case PIPE_FORMAT_R16_UINT:
- case PIPE_FORMAT_A16_UINT:
- case PIPE_FORMAT_L16_UINT:
- case PIPE_FORMAT_I16_UINT:
return VFMT_USHORT_16;
case PIPE_FORMAT_R16_SINT:
- case PIPE_FORMAT_A16_SINT:
- case PIPE_FORMAT_L16_SINT:
- case PIPE_FORMAT_I16_SINT:
return VFMT_SHORT_16;
- case PIPE_FORMAT_L8A8_UNORM:
+ case PIPE_FORMAT_R16_FLOAT:
+ return VFMT_FLOAT_16;
+
case PIPE_FORMAT_R8G8_UNORM:
return VFMT_NORM_UBYTE_8_8;
- case PIPE_FORMAT_L8A8_SNORM:
case PIPE_FORMAT_R8G8_SNORM:
return VFMT_NORM_BYTE_8_8;
- case PIPE_FORMAT_L8A8_UINT:
case PIPE_FORMAT_R8G8_UINT:
return VFMT_UBYTE_8_8;
- case PIPE_FORMAT_L8A8_SINT:
case PIPE_FORMAT_R8G8_SINT:
return VFMT_BYTE_8_8;
case PIPE_FORMAT_A8B8G8R8_UNORM:
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
- case PIPE_FORMAT_B8G8R8X8_UNORM:
case PIPE_FORMAT_R8G8B8A8_UNORM:
- case PIPE_FORMAT_R8G8B8X8_UNORM:
- case PIPE_FORMAT_X8B8G8R8_UNORM:
- case PIPE_FORMAT_X8R8G8B8_UNORM:
- case PIPE_FORMAT_A8B8G8R8_SRGB:
- case PIPE_FORMAT_B8G8R8A8_SRGB:
return VFMT_NORM_UBYTE_8_8_8_8;
case PIPE_FORMAT_R8G8B8A8_SNORM:
- case PIPE_FORMAT_R8G8B8X8_SNORM:
return VFMT_NORM_BYTE_8_8_8_8;
case PIPE_FORMAT_R8G8B8A8_UINT:
- case PIPE_FORMAT_R8G8B8X8_UINT:
return VFMT_UBYTE_8_8_8_8;
case PIPE_FORMAT_R8G8B8A8_SINT:
- case PIPE_FORMAT_R8G8B8X8_SINT:
return VFMT_BYTE_8_8_8_8;
-/* TODO probably need gles3 blob drivers to find the 32bit int formats:
- case PIPE_FORMAT_R32_UINT:
- case PIPE_FORMAT_R32_SINT:
- case PIPE_FORMAT_A32_UINT:
- case PIPE_FORMAT_A32_SINT:
- case PIPE_FORMAT_L32_UINT:
- case PIPE_FORMAT_L32_SINT:
- case PIPE_FORMAT_I32_UINT:
- case PIPE_FORMAT_I32_SINT:
-*/
+ case PIPE_FORMAT_R16G16_SSCALED:
+ return VFMT_SHORT_16_16;
+
+ case PIPE_FORMAT_R16G16_FLOAT:
+ return VFMT_FLOAT_16_16;
+
+ case PIPE_FORMAT_R16G16_UINT:
+ return VFMT_USHORT_16_16;
+
+ case PIPE_FORMAT_R16G16_UNORM:
+ return VFMT_NORM_USHORT_16_16;
+
+ case PIPE_FORMAT_R16G16_SNORM:
+ return VFMT_NORM_SHORT_16_16;
+
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
+ return VFMT_NORM_UINT_10_10_10_2;
+
+ case PIPE_FORMAT_R10G10B10A2_SNORM:
+ return VFMT_NORM_INT_10_10_10_2;
+
+ case PIPE_FORMAT_R10G10B10A2_USCALED:
+ return VFMT_UINT_10_10_10_2;
+
+ case PIPE_FORMAT_R10G10B10A2_SSCALED:
+ return VFMT_INT_10_10_10_2;
+
+ /* 48-bit buffers. */
+ case PIPE_FORMAT_R16G16B16_FLOAT:
+ return VFMT_FLOAT_16_16_16;
+
+ case PIPE_FORMAT_R16G16B16_SSCALED:
+ return VFMT_SHORT_16_16_16;
+
+ case PIPE_FORMAT_R16G16B16_UINT:
+ return VFMT_USHORT_16_16_16;
+
+ case PIPE_FORMAT_R16G16B16_SNORM:
+ return VFMT_NORM_SHORT_16_16_16;
+
+ case PIPE_FORMAT_R16G16B16_UNORM:
+ return VFMT_NORM_USHORT_16_16_16;
case PIPE_FORMAT_R32_FLOAT:
- case PIPE_FORMAT_A32_FLOAT:
- case PIPE_FORMAT_L32_FLOAT:
- case PIPE_FORMAT_I32_FLOAT:
case PIPE_FORMAT_Z32_FLOAT:
return VFMT_FLOAT_32;
return VFMT_SHORT_16_16_16_16;
case PIPE_FORMAT_R32G32_FLOAT:
- case PIPE_FORMAT_L32A32_FLOAT:
return VFMT_FLOAT_32_32;
case PIPE_FORMAT_R32G32_FIXED:
return VFMT_FIXED_32_32;
case PIPE_FORMAT_R16G16B16A16_FLOAT:
- case PIPE_FORMAT_R16G16B16X16_FLOAT:
return VFMT_FLOAT_16_16_16_16;
-/* TODO probably need gles3 blob drivers to find the 32bit int formats:
- case PIPE_FORMAT_R32G32_SINT:
- case PIPE_FORMAT_R32G32_UINT:
- case PIPE_FORMAT_L32A32_UINT:
- case PIPE_FORMAT_L32A32_SINT:
-*/
-
/* 96-bit buffers. */
case PIPE_FORMAT_R32G32B32_FLOAT:
return VFMT_FLOAT_32_32_32;
/* 128-bit buffers. */
case PIPE_FORMAT_R32G32B32A32_FLOAT:
- case PIPE_FORMAT_R32G32B32X32_FLOAT:
return VFMT_FLOAT_32_32_32_32;
case PIPE_FORMAT_R32G32B32A32_FIXED:
case PIPE_FORMAT_R32G32B32A32_UNORM:
case PIPE_FORMAT_R32G32B32A32_SINT:
case PIPE_FORMAT_R32G32B32A32_UINT:
+
+ case PIPE_FORMAT_R32_UINT:
+ case PIPE_FORMAT_R32_SINT:
+ case PIPE_FORMAT_A32_UINT:
+ case PIPE_FORMAT_A32_SINT:
+ case PIPE_FORMAT_L32_UINT:
+ case PIPE_FORMAT_L32_SINT:
+ case PIPE_FORMAT_I32_UINT:
+ case PIPE_FORMAT_I32_SINT:
+
+ case PIPE_FORMAT_R32G32_SINT:
+ case PIPE_FORMAT_R32G32_UINT:
+ case PIPE_FORMAT_L32A32_UINT:
+ case PIPE_FORMAT_L32A32_SINT:
*/
default:
switch (format) {
case PIPE_FORMAT_B8G8R8A8_UNORM:
case PIPE_FORMAT_B8G8R8X8_UNORM:
+ case PIPE_FORMAT_B8G8R8A8_SRGB:
+ case PIPE_FORMAT_B8G8R8X8_SRGB:
return WXYZ;
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ case PIPE_FORMAT_X8R8G8B8_UNORM:
+ case PIPE_FORMAT_A8R8G8B8_SRGB:
+ case PIPE_FORMAT_X8R8G8B8_SRGB:
+ return ZYXW;
+
+ case PIPE_FORMAT_A8B8G8R8_UNORM:
+ case PIPE_FORMAT_X8B8G8R8_UNORM:
+ case PIPE_FORMAT_A8B8G8R8_SRGB:
+ case PIPE_FORMAT_X8B8G8R8_SRGB:
+ return XYZW;
+
case PIPE_FORMAT_R8G8B8A8_UNORM:
case PIPE_FORMAT_R8G8B8X8_UNORM:
case PIPE_FORMAT_Z24X8_UNORM: