Skip to content

Commit

Permalink
Fix wgsl float texture format inference silent failure (#5831)
Browse files Browse the repository at this point in the history
  • Loading branch information
Devon7925 authored Dec 11, 2024
1 parent 3f818cb commit f687688
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions source/slang/slang-emit-wgsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,18 @@ static const char* getWgslImageFormat(IRTextureTypeBase* type)
// normally just resolve to unknown.
auto elementType = type->getElementType();
Int vectorWidth = 1;
if (auto vectorType = as<IRVectorType>(elementType);
auto intLitVal = as<IRIntLit>(vectorType->getElementCount()))
if (auto elementVecType = as<IRVectorType>(elementType))
{
vectorWidth = intLitVal->getValue();
if (auto intLitVal = as<IRIntLit>(elementVecType->getElementCount()))
{
vectorWidth = (Int)intLitVal->getValue();
}
else
{
vectorWidth = 0;
}
elementType = elementVecType->getElementType();
}
elementType = getVectorElementType((IRType*)elementType);
if (auto basicType = as<IRBasicType>(elementType))
{
switch (basicType->getBaseType())
Expand Down

0 comments on commit f687688

Please sign in to comment.