INLINE
void _simdvec_transpose(simdvector &v)
{
- SWR_ASSERT(false, "Need to implement 8 wide version");
+ SWR_INVALID("Need to implement 8 wide version");
}
#else
case R32_FLOAT: pState->state.pfnQuantizeDepth = QuantizeDepth < R32_FLOAT > ; break;
case R24_UNORM_X8_TYPELESS: pState->state.pfnQuantizeDepth = QuantizeDepth < R24_UNORM_X8_TYPELESS > ; break;
case R16_UNORM: pState->state.pfnQuantizeDepth = QuantizeDepth < R16_UNORM > ; break;
- default: SWR_ASSERT(false, "Unsupported depth format for depth quantiztion.");
+ default: SWR_INVALID("Unsupported depth format for depth quantiztion.");
pState->state.pfnQuantizeDepth = QuantizeDepth < R32_FLOAT > ;
}
}
case SWR_ATTACHMENT_COLOR7: srcFormat = KNOB_COLOR_HOT_TILE_FORMAT; break;
case SWR_ATTACHMENT_DEPTH: srcFormat = KNOB_DEPTH_HOT_TILE_FORMAT; break;
case SWR_ATTACHMENT_STENCIL: srcFormat = KNOB_STENCIL_HOT_TILE_FORMAT; break;
- default: SWR_ASSERT(false, "Unknown attachment: %d", attachment); srcFormat = KNOB_COLOR_HOT_TILE_FORMAT; break;
+ default: SWR_INVALID("Unknown attachment: %d", attachment); srcFormat = KNOB_COLOR_HOT_TILE_FORMAT; break;
}
uint32_t x, y;
case SWR_CULLMODE_FRONT: cullTris = frontWindingTris; break;
// 0 area triangles are marked as backfacing, which is required behavior for conservative rast
case SWR_CULLMODE_BACK: cullTris = ~frontWindingTris; break;
- default: SWR_ASSERT(false, "Invalid cull mode: %d", rastState.cullMode); cullTris = 0x0; break;
+ default: SWR_INVALID("Invalid cull mode: %d", rastState.cullMode); cullTris = 0x0; break;
}
triMask &= ~cullTris;
result.x = result.y = result.z = result.w = _simd_sub_ps(_simd_set1_ps(1.0f), src1.w);
break;
- default: SWR_ASSERT(false, "Unimplemented blend factor: %d", func);
+ default: SWR_INVALID("Unimplemented blend factor: %d", func);
}
if (Color)
break;
default:
- SWR_ASSERT(false, "Unimplemented blend function: %d", blendOp);
+ SWR_INVALID("Unimplemented blend function: %d", blendOp);
}
if (Color)
break;
default:
- SWR_ASSERT(false, "Unimplemented clamp: %d", type);
+ SWR_INVALID("Unimplemented clamp: %d", type);
break;
}
}
case FRUSTUM_BOTTOM: t = ComputeInterpFactor(v1[3] - v1[1], v2[3] - v2[1]); break;
case FRUSTUM_NEAR: t = ComputeInterpFactor(v1[2], v2[2]); break;
case FRUSTUM_FAR: t = ComputeInterpFactor(v1[3] - v1[2], v2[3] - v2[2]); break;
- default: SWR_ASSERT(false, "invalid clipping plane: %d", ClippingPlane);
+ default: SWR_INVALID("invalid clipping plane: %d", ClippingPlane);
};
case FRUSTUM_NEAR : return (v[2]>=0.0f);
case FRUSTUM_FAR : return (v[2]<= v[3]);
default:
- SWR_ASSERT(false, "invalid clipping plane: %d", ClippingPlane);
+ SWR_INVALID("invalid clipping plane: %d", ClippingPlane);
return 0;
}
}
}
break;
case FRUSTUM_FAR: t = ComputeInterpFactor(_simd_sub_ps(v1[3], v1[2]), _simd_sub_ps(v2[3], v2[2])); break;
- default: SWR_ASSERT(false, "invalid clipping plane: %d", ClippingPlane);
+ default: SWR_INVALID("invalid clipping plane: %d", ClippingPlane);
};
// interpolate position and store
case FRUSTUM_NEAR: return _simd_cmpge_ps(v[2], this->state.rastState.clipHalfZ ? _simd_setzero_ps() : _simd_mul_ps(v[3], _simd_set1_ps(-1.0f)));
case FRUSTUM_FAR: return _simd_cmple_ps(v[2], v[3]);
default:
- SWR_ASSERT(false, "invalid clipping plane: %d", ClippingPlane);
+ SWR_INVALID("invalid clipping plane: %d", ClippingPlane);
return _simd_setzero_ps();
}
}
case TOP_TRI_STRIP_REVERSE:
case TOP_PATCHLIST_BASE:
case TOP_UNKNOWN:
- SWR_ASSERT(false, "Unsupported topology: %d", mode);
+ SWR_INVALID("Unsupported topology: %d", mode);
return 0;
}
case TOP_TRI_STRIP_REVERSE:
case TOP_PATCHLIST_BASE:
case TOP_UNKNOWN:
- SWR_ASSERT(false, "Unsupported topology: %d", mode);
+ SWR_INVALID("Unsupported topology: %d", mode);
return 0;
}
numVerts = topology - TOP_PATCHLIST_BASE;
break;
default:
- SWR_ASSERT(false, "Unsupported topology: %d", topology);
+ SWR_INVALID("Unsupported topology: %d", topology);
break;
}
case TOP_TRIANGLE_STRIP: pfnClipFunc = ClipTriangles; break;
case TOP_LINE_STRIP: pfnClipFunc = ClipLines; break;
case TOP_POINT_LIST: pfnClipFunc = ClipPoints; break;
- default: SWR_ASSERT(false, "Unexpected GS output topology: %d", pState->outputTopology);
+ default: SWR_INVALID("Unexpected GS output topology: %d", pState->outputTopology);
}
}
case TOP_TRIANGLE_LIST: pfnClipFunc = ClipTriangles; break;
case TOP_LINE_LIST: pfnClipFunc = ClipLines; break;
case TOP_POINT_LIST: pfnClipFunc = ClipPoints; break;
- default: SWR_ASSERT(false, "Unexpected DS output topology: %d", tsState.postDSTopology);
+ default: SWR_INVALID("Unexpected DS output topology: %d", tsState.postDSTopology);
}
}
// have seen more than 32 HW threads for this procGroup
// Don't use it
#if defined(_WIN64)
- SWR_ASSERT(false, "Shouldn't get here in 64-bit mode");
+ SWR_INVALID("Shouldn't get here in 64-bit mode");
#endif
continue;
}
if (threadId >= 32)
{
// Hopefully we don't get here. Logic in CreateThreadPool should prevent this.
- SWR_REL_ASSERT(false, "Shouldn't get here");
+ SWR_INVALID("Shouldn't get here");
// In a 32-bit process on Windows it is impossible to bind
// to logical processors 32-63 within a processor group.
case SWR_ATTACHMENT_COLOR7: format = KNOB_COLOR_HOT_TILE_FORMAT; break;
case SWR_ATTACHMENT_DEPTH: format = KNOB_DEPTH_HOT_TILE_FORMAT; break;
case SWR_ATTACHMENT_STENCIL: format = KNOB_STENCIL_HOT_TILE_FORMAT; break;
- default: SWR_ASSERT(false, "Unknown attachment: %d", attachment); format = KNOB_COLOR_HOT_TILE_FORMAT; break;
+ default: SWR_INVALID("Unknown attachment: %d", attachment); format = KNOB_COLOR_HOT_TILE_FORMAT; break;
}
if (hotTile.state == HOTTILE_CLEAR)
out[0] = out[1] = out[2] = out[3] = FSUB(VIMMED1(1.0f), src1[3]);
break;
default:
- SWR_ASSERT(false, "Unsupported blend factor: %d", factor);
+ SWR_INVALID("Unsupported blend factor: %d", factor);
out[0] = out[1] = out[2] = out[3] = VIMMED1(0.0f);
break;
}
src[3] = VMINPS(VMAXPS(src[3], VIMMED1(-1.0f)), VIMMED1(1.0f));
break;
- default: SWR_ASSERT(false, "Unsupport format type: %d", type);
+ default: SWR_INVALID("Unsupport format type: %d", type);
}
}
src[swizComp] = VROUND(src[swizComp], C(_MM_FROUND_TO_ZERO));
src[swizComp] = FMUL(src[swizComp], VIMMED1(1.0f /factor));
break;
- default: SWR_ASSERT(false, "Unsupported format type: %d", info.type[c]);
+ default: SWR_INVALID("Unsupported format type: %d", info.type[c]);
}
}
}
break;
default:
- SWR_ASSERT(false, "Unsupported blend operation: %d", blendOp);
+ SWR_INVALID("Unsupported blend operation: %d", blendOp);
out[0] = out[1] = out[2] = out[3] = VIMMED1(0.0f);
break;
}
break;
default:
- SWR_ASSERT(false, "Unsupported logic operation: %d", logicOp);
+ SWR_INVALID("Unsupported logic operation: %d", logicOp);
result[0] = result[1] = result[2] = result[3] = VIMMED1(0.0f);
break;
}
case ZFUNC_NE: pTest = ICMP_NE(pAlphaU8, pRef); break;
case ZFUNC_GE: pTest = ICMP_UGE(pAlphaU8, pRef); break;
default:
- SWR_ASSERT(false, "Invalid alpha test function");
+ SWR_INVALID("Invalid alpha test function");
break;
}
}
case ZFUNC_NE: pTest = FCMP_ONE(pAlpha, pRef); break;
case ZFUNC_GE: pTest = FCMP_OGE(pAlpha, pRef); break;
default:
- SWR_ASSERT(false, "Invalid alpha test function");
+ SWR_INVALID("Invalid alpha test function");
break;
}
}
case 8: vptr = BITCAST(pointer, PointerType::get(VectorType::get(mInt8Ty, 4), 0)); break;
case 16: vptr = BITCAST(pointer, PointerType::get(VectorType::get(mInt16Ty, 4), 0)); break;
case 32: vptr = BITCAST(pointer, PointerType::get(VectorType::get(mFP32Ty, 4), 0)); break;
- default: SWR_ASSERT(false, "Unsupported underlying bpp!");
+ default: SWR_INVALID("Unsupported underlying bpp!");
}
// load 4 components of attribute
vec = FMUL(vec, ConstantVector::get(std::vector<Constant*>(4, ConstantFP::get(mFP32Ty, 1.0 / 65535.0))));
break;
default:
- SWR_ASSERT(false, "Unsupported underlying type!");
+ SWR_INVALID("Unsupported underlying type!");
break;
}
break;
vec = FMUL(vec, ConstantVector::get(std::vector<Constant*>(4, ConstantFP::get(mFP32Ty, 1.0 / 32768.0))));
break;
default:
- SWR_ASSERT(false, "Unsupported underlying type!");
+ SWR_INVALID("Unsupported underlying type!");
break;
}
break;
case 32:
break; // Pass through unchanged.
default:
- SWR_ASSERT(false, "Unsupported underlying type!");
+ SWR_INVALID("Unsupported underlying type!");
break;
}
break;
case 32:
break; // Pass through unchanged.
default:
- SWR_ASSERT(false, "Unsupported underlying type!");
+ SWR_INVALID("Unsupported underlying type!");
break;
}
break;
case 32:
break; // Pass through unchanged.
default:
- SWR_ASSERT(false, "Unsupported underlying type!");
+ SWR_INVALID("Unsupported underlying type!");
}
break;
case SWR_TYPE_USCALED:
break;
case SWR_TYPE_UNKNOWN:
case SWR_TYPE_UNUSED:
- SWR_ASSERT(false, "Unsupported type %d!", info.type[0]);
+ SWR_INVALID("Unsupported type %d!", info.type[0]);
}
// promote mask: sse(0,1,2,3) | avx(0,1,2,3,4,4,4,4)
//////////////////////////////////////////////////////////////////////////
struct FETCH_COMPILE_STATE
{
- uint32_t numAttribs {0};
+ uint32_t numAttribs{ 0 };
INPUT_ELEMENT_DESC layout[KNOB_NUM_ATTRIBUTES];
SWR_FORMAT indexType;
uint32_t cutIndex{ 0xffffffff };
break;
}
default:
- SWR_ASSERT(0);
+ SWR_INVALID("Invalid type: %d", type);
break;
}
}
pPixel->r = outColor[0];
break;
default:
- SWR_ASSERT(0);
+ SWR_INVALID("Invalid # of comps: %d", FormatTraits<DstFormat>::numComps);
}
}
srcColor[0] = pPixel->r;
break;
default:
- SWR_ASSERT(0);
+ SWR_INVALID("Invalid # of comps: %d", FormatTraits<SrcFormat>::numComps);
}
// Convert components
break;
}
default:
- SWR_ASSERT(0);
+ SWR_INVALID("Invalid type: %d", type);
break;
}
}
case R8G8B8_SINT: ConvertPixelFromFloat<R8G8B8_SINT>(pDst, srcPixel); break;
case RAW: ConvertPixelFromFloat<RAW>(pDst, srcPixel); break;
default:
- SWR_ASSERT(0);
+ SWR_INVALID("Invalid format: %d", format);
break;
}
}
pfnLoadTiles = LoadMacroTile<TilingTraits<SWR_TILE_MODE_WMAJOR, 8>, R8_UINT, R8_UINT>::Load;
break;
default:
- SWR_ASSERT(0, "Unsupported tiling mode");
+ SWR_INVALID("Unsupported tiling mode");
break;
}
}
pfnLoadTiles = sLoadTilesDepthTable_SWR_TILE_MODE_YMAJOR[pSrcSurface->format];
break;
default:
- SWR_ASSERT(0, "Unsupported tiling mode");
+ SWR_INVALID("Unsupported tiling mode");
break;
}
}
pfnLoadTiles = LoadMacroTile<TilingTraits<SWR_TILE_MODE_WMAJOR, 8>, R8_UINT, R8_UINT>::Load;
break;
default:
- SWR_ASSERT(0, "Unsupported tiling mode");
+ SWR_INVALID("Unsupported tiling mode");
break;
}
}
if (pfnLoadTiles == nullptr)
{
- SWR_ASSERT(false, "Unsupported format for load tile");
+ SWR_INVALID("Unsupported format for load tile");
return;
}
if(nullptr == pfnStoreTiles)
{
- SWR_ASSERT(false, "Invalid pixel format / tile mode for store tiles");
+ SWR_INVALID("Invalid pixel format / tile mode for store tiles");
return;
}
case SWR_TILE_MODE_XMAJOR: return ComputeTileSwizzle2D<TilingTraits<SWR_TILE_MODE_XMAJOR, 8> >(xOffsetBytes, yOffsetRows, pState);
case SWR_TILE_MODE_YMAJOR: return ComputeTileSwizzle2D<TilingTraits<SWR_TILE_MODE_YMAJOR, 32> >(xOffsetBytes, yOffsetRows, pState);
case SWR_TILE_MODE_WMAJOR: return ComputeTileSwizzle2D<TilingTraits<SWR_TILE_MODE_WMAJOR, 8> >(xOffsetBytes, yOffsetRows, pState);
- default: SWR_ASSERT(0, "Unsupported tiling mode");
+ default: SWR_INVALID("Unsupported tiling mode");
}
return (uint32_t) NULL;
}
case SWR_TILE_NONE: return ComputeTileSwizzle3D<TilingTraits<SWR_TILE_NONE, 32> >(xOffsetBytes, yOffsetRows, zOffsetSlices, pState);
case SWR_TILE_SWRZ: return ComputeTileSwizzle3D<TilingTraits<SWR_TILE_SWRZ, 32> >(xOffsetBytes, yOffsetRows, zOffsetSlices, pState);
case SWR_TILE_MODE_YMAJOR: return ComputeTileSwizzle3D<TilingTraits<SWR_TILE_MODE_YMAJOR, 32> >(xOffsetBytes, yOffsetRows, zOffsetSlices, pState);
- default: SWR_ASSERT(0, "Unsupported tiling mode");
+ default: SWR_INVALID("Unsupported tiling mode");
}
return (uint32_t) NULL;
}
ComputeSurfaceOffset2D<UseCachedOffsets>(x, y, array, sampleNum, lod, pState, offsetX, offsetY);
return TileSwizzle2D(offsetX, offsetY, pState);
break;
- default: SWR_ASSERT(0, "Unsupported format");
+ default: SWR_INVALID("Unsupported format");
}
return (uint32_t) NULL;
struct TilingTraits
{
static const SWR_TILE_MODE TileMode{ mode };
- static UINT GetCu() { SWR_ASSERT(0); return 0; }
- static UINT GetCv() { SWR_ASSERT(0); return 0; }
- static UINT GetCr() { SWR_ASSERT(0); return 0; }
- static UINT GetTileIDShift() { SWR_ASSERT(0); return 0; }
+ static UINT GetCu() { SWR_NOT_IMPL; return 0; }
+ static UINT GetCv() { SWR_NOT_IMPL; return 0; }
+ static UINT GetCr() { SWR_NOT_IMPL; return 0; }
+ static UINT GetTileIDShift() { SWR_NOT_IMPL; return 0; }
/// @todo correct pdep shifts for all rastertile dims. Unused for now
- static UINT GetPdepX() { SWR_ASSERT(0); return 0x37; }
- static UINT GetPdepY() { SWR_ASSERT(0); return 0xC8; }
+ static UINT GetPdepX() { SWR_NOT_IMPL; return 0x37; }
+ static UINT GetPdepY() { SWR_NOT_IMPL; return 0xC8; }
};
template<int X> struct TilingTraits <SWR_TILE_NONE, X>
static UINT GetTileIDShift() { return KNOB_TILE_X_DIM_SHIFT + KNOB_TILE_Y_DIM_SHIFT; }
/// @todo correct pdep shifts for all rastertile dims. Unused for now
- static UINT GetPdepX() { SWR_ASSERT(0); return 0x00; }
- static UINT GetPdepY() { SWR_ASSERT(0); return 0x00; }
+ static UINT GetPdepX() { SWR_NOT_IMPL; return 0x00; }
+ static UINT GetPdepY() { SWR_NOT_IMPL; return 0x00; }
};
template<> struct TilingTraits <SWR_TILE_SWRZ, 32>
static UINT GetTileIDShift() { return KNOB_TILE_X_DIM_SHIFT + KNOB_TILE_Y_DIM_SHIFT + 4; }
/// @todo correct pdep shifts for all rastertile dims. Unused for now
- static UINT GetPdepX() { SWR_ASSERT(0); return 0x37; }
- static UINT GetPdepY() { SWR_ASSERT(0); return 0xC8; }
+ static UINT GetPdepX() { SWR_NOT_IMPL; return 0x37; }
+ static UINT GetPdepY() { SWR_NOT_IMPL; return 0xC8; }
};
// y-major tiling layout unaffected by element size