MCPcopy Create free account
hub / github.com/csyonghe/Spire / AddInstrTexture

Method AddInstrTexture

Source/SpireCore/SpirVCodeGen.cpp:2630–2663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2628 }
2629
2630 int AddInstrTexture(
2631 ILOperand *op,
2632 int textureID,
2633 int coordinateID,
2634 ExecutionModel currentExecutionModel,
2635 int Bias = -1,
2636 int GradX = -1,
2637 int GradY = -1)
2638 {
2639 RefPtr<ILType> typeIL = GetTypeFromString("vec4");
2640 int typeID = DefineType(typeIL);
2641
2642 ++CurrentID;
2643 if (currentExecutionModel == ExecutionModel::Fragment && GradX == -1)
2644 {
2645 //implicit LOD
2646 CodeGen.OpImageSampleImplicitLod(CurrentID, typeID, textureID, coordinateID, Bias);
2647 }
2648 else
2649 {
2650 //explicit LOD
2651 int zeroID = AddInstrConstantInt(0);
2652 CodeGen.OpImageSampleExplicitLod(CurrentID, typeID, textureID, coordinateID, zeroID, Bias, GradX, GradY);
2653 }
2654 IDInfos[CurrentID] = IDInfo::CreateIDInfoForValue(
2655 CurrentID,
2656 typeIL,
2657 op,
2658 typeID
2659 );
2660 UpdateValue(op, CurrentID);
2661
2662 return CurrentID;
2663 }
2664
2665 int AddInstrTextureShadow(
2666 ILOperand *op,

Callers 2

PrintCallInstrMethod · 0.80
PrintImportInstrMethod · 0.80

Calls 3

GetTypeFromStringFunction · 0.85

Tested by

no test coverage detected