# HG changeset patch # User sam # Date 1712984122 -25200 # Node ID f91b3144e52ad92eda3561064e8bafceb2cfd346 # Parent 2e7b9807f0e19a51836c329b6fd18c73e74aaac0 did: improve error message diff -r 2e7b9807f0e1 -r f91b3144e52a semicongine/material.nim --- a/semicongine/material.nim Sat Apr 13 11:20:13 2024 +0700 +++ b/semicongine/material.nim Sat Apr 13 11:55:22 2024 +0700 @@ -56,8 +56,10 @@ for attr in shader.inputs: if attr.perInstance: assert materialType.instanceAttributes.contains(attr.name), &"MaterialType '{materialType}' requires instance attribute '{attr.name}' in order to be renderable with the assigned shader '{shader}'" + assert materialType.instanceAttributes[attr.name] == attr.theType, &"Instance attribute '{attr.name}' of MaterialType '{materialType}' is of type {materialType.instanceAttributes[attr.name]} but assigned shader '{shader}' declares type '{attr.theType}'" else: assert materialType.vertexAttributes.contains(attr.name), &"MaterialType '{materialType}' requires vertex attribute '{attr.name}' in order to be renderable with the assigned shader '{shader}'" + assert materialType.vertexAttributes[attr.name] == attr.theType, &"Vertex attribute '{attr.name}' of MaterialType '{materialType}' is of type {materialType.vertexAttributes[attr.name]} but assigned shader '{shader}' declares type '{attr.theType}'" proc `$`*(material: MaterialData): string = var attributes: seq[string]