Commit f687688 1 parent 3f818cb commit f687688 Copy full SHA for f687688
File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -352,12 +352,18 @@ static const char* getWgslImageFormat(IRTextureTypeBase* type)
352
352
// normally just resolve to unknown.
353
353
auto elementType = type->getElementType ();
354
354
Int vectorWidth = 1 ;
355
- if (auto vectorType = as<IRVectorType>(elementType);
356
- auto intLitVal = as<IRIntLit>(vectorType->getElementCount ()))
355
+ if (auto elementVecType = as<IRVectorType>(elementType))
357
356
{
358
- vectorWidth = intLitVal->getValue ();
357
+ if (auto intLitVal = as<IRIntLit>(elementVecType->getElementCount ()))
358
+ {
359
+ vectorWidth = (Int)intLitVal->getValue ();
360
+ }
361
+ else
362
+ {
363
+ vectorWidth = 0 ;
364
+ }
365
+ elementType = elementVecType->getElementType ();
359
366
}
360
- elementType = getVectorElementType ((IRType*)elementType);
361
367
if (auto basicType = as<IRBasicType>(elementType))
362
368
{
363
369
switch (basicType->getBaseType ())
You can’t perform that action at this time.
0 commit comments