summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/format_parser.py
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2015-01-26 12:35:23 +0200
committerTapani Pälli <tapani.palli@intel.com>2015-01-28 10:40:15 +0200
commit291d7ef84dcd83962515cbd7ce91ce1ff70930ed (patch)
tree71c48ae9d5b43af1f9498b91f40edfef7f4d02d6 /src/mesa/main/format_parser.py
parent6ee5effac1ac8858c96820ece352be57c5c53cf6 (diff)
downloadexternal_mesa3d-291d7ef84dcd83962515cbd7ce91ce1ff70930ed.zip
external_mesa3d-291d7ef84dcd83962515cbd7ce91ce1ff70930ed.tar.gz
external_mesa3d-291d7ef84dcd83962515cbd7ce91ce1ff70930ed.tar.bz2
mesa: improve error messaging for format CSV parser
Patch adds 2 error messages that point user directly to fix mispelled or impossible swizzle field for a format. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src/mesa/main/format_parser.py')
-rwxr-xr-xsrc/mesa/main/format_parser.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/format_parser.py b/src/mesa/main/format_parser.py
index 522bce3..11184f7 100755
--- a/src/mesa/main/format_parser.py
+++ b/src/mesa/main/format_parser.py
@@ -24,6 +24,8 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+import sys
+
VOID = 'x'
UNSIGNED = 'u'
SIGNED = 's'
@@ -562,7 +564,10 @@ def parse(filename):
block_height = int(fields[3])
colorspace = fields[9]
- swizzle = Swizzle(fields[8])
+ try:
+ swizzle = Swizzle(fields[8])
+ except:
+ sys.exit("error parsing swizzle for format " + name)
channels = _parse_channels(fields[4:8], layout, colorspace, swizzle)
yield Format(name, layout, block_width, block_height, channels, swizzle, colorspace)