summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/format_info.py
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2014-08-06 16:52:14 +0100
committerNeil Roberts <neil@linux.intel.com>2014-08-12 18:00:26 +0100
commit84218b598f429bcc4474aa620da906b7b9aadc2b (patch)
treeb64b7dc55580b449ef309386830daf06a5f46779 /src/mesa/main/format_info.py
parent0c6e230eb1a6c22e15c852ae98a39110c13d78b8 (diff)
downloadexternal_mesa3d-84218b598f429bcc4474aa620da906b7b9aadc2b.zip
external_mesa3d-84218b598f429bcc4474aa620da906b7b9aadc2b.tar.gz
external_mesa3d-84218b598f429bcc4474aa620da906b7b9aadc2b.tar.bz2
mesa/format_info: Add support for compressed floating-point formats
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>
Diffstat (limited to 'src/mesa/main/format_info.py')
-rw-r--r--src/mesa/main/format_info.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
index 448bd00..a0eecd3 100644
--- a/src/mesa/main/format_info.py
+++ b/src/mesa/main/format_info.py
@@ -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'