builder/llpcBuilderImplArith.cpp
Value* BuilderImplArith::CreateCubeFaceIndex(
    Value*        pCoord,     // [in] Input coordinate <3 x float>
    const Twine&  instName)   // [in] Name to give instruction(s)
{
    Value* pCoordX = CreateExtractElement(pCoord, uint64_t(0));
    Value* pCoordY = CreateExtractElement(pCoord, 1);
    Value* pCoordZ = CreateExtractElement(pCoord, 2);
    return CreateIntrinsic(Intrinsic::amdgcn_cubeid, {}, { pCoordX, pCoordY, pCoordZ }, nullptr, instName);
}
// =====================================================================================================================
// Create calculation of the index of the cube map face that would be accessed by a texture lookup function for
// the given cube map texture coordinates. Returns a single float with value:
//  0.0 = the cube map face facing the positive X direction
//  1.0 = the cube map face facing the negative X direction
//  2.0 = the cube map face facing the positive Y direction
//  3.0 = the cube map face facing the negative Y direction
//  4.0 = the cube map face facing the positive Z direction
//  5.0 = the cube map face facing the negative Z direction
Create calculation of the index of the cube map face that would be accessed by a texture lookup function for
the given cube map texture coordinates.
Create calculation of the index of the cube map face that would be accessed by a texture lookup function for the given cube map texture coordinates .
Value* BuilderImplArith::CreateCubeFaceIndex(
    Value*        pCoord,     
    const Twine&  instName)   
{
    Value* pCoordX = CreateExtractElement(pCoord, uint64_t(0));
    Value* pCoordY = CreateExtractElement(pCoord, 1);
    Value* pCoordZ = CreateExtractElement(pCoord, 2);
    return CreateIntrinsic(Intrinsic::amdgcn_cubeid, {}, { pCoordX, pCoordY, pCoordZ }, nullptr, instName);
}
Value * BuilderImplArith :: CreateCubeFaceIndex ( Value * pCoord , const Twine & instName ) { Value * pCoordX = CreateExtractElement ( pCoord , uint64_t ( 0 ) ) ; Value * pCoordY = CreateExtractElement ( pCoord , 1 ) ; Value * pCoordZ = CreateExtractElement ( pCoord , 2 ) ; return CreateIntrinsic ( Intrinsic :: amdgcn_cubeid , { } , { pCoordX , pCoordY , pCoordZ } , nullptr , instName ) ; }
Create calculation of the index of the cube map face that would be accessed by a texture lookup function for
the given cube map texture coordinates.
Create calculation of the index of the cube map face that would be accessed by a texture lookup function for the given cube map texture coordinates .
// [in] Input coordinate <3 x float> // [in] Name to give instruction(s)