mesa/format_info: Add support for compressed floating-point formats
authorNeil Roberts <neil@linux.intel.com>
Wed, 6 Aug 2014 15:52:14 +0000 (16:52 +0100)
committerNeil Roberts <neil@linux.intel.com>
Tue, 12 Aug 2014 17:00:26 +0000 (18:00 +0100)
If the name of a compressed texture format has ‘FLOAT’ in it it will now set
the data type of the format to GL_FLOAT. This will be needed for the BPTC
half-float formats.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/format_info.py

index 448bd0055372d4f0baeb8fdbdcaa00a4279472d2..a0eecd309513e8368bf08c7b228eba3a761a0f87 100644 (file)
@@ -62,7 +62,9 @@ def get_gl_base_format(fmat):
 
 def get_gl_data_type(fmat):
    if fmat.is_compressed():
-      if 'SIGNED' in fmat.name or 'SNORM' in fmat.name:
+      if 'FLOAT' in fmat.name:
+         return 'GL_FLOAT'
+      elif 'SIGNED' in fmat.name or 'SNORM' in fmat.name:
          return 'GL_SIGNED_NORMALIZED'
       else:
          return 'GL_UNSIGNED_NORMALIZED'