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

Method AddInstrTextureShadow

Source/SpireCore/SpirVCodeGen.cpp:2665–2698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2663 }
2664
2665 int AddInstrTextureShadow(
2666 ILOperand *op,
2667 int textureID,
2668 int coordinateID,
2669 ExecutionModel currentExecutionModel)
2670 {
2671 RefPtr<ILType> typeIL = GetTypeFromString("vec4");
2672 int typeID = DefineType(typeIL);
2673
2674 int veclen = IDInfos[coordinateID]().GetILType()->GetVectorSize();
2675 int DrefID = AddInstrCompositeExtract(coordinateID, GetTypeFromString("float"), veclen-1);
2676
2677 ++CurrentID;
2678 if (currentExecutionModel == ExecutionModel::Fragment)
2679 {
2680 //implicit LOD
2681 CodeGen.OpImageSampleDrefImplicitLod(CurrentID, typeID, textureID, coordinateID, DrefID);
2682 }
2683 else
2684 {
2685 //explicit LOD
2686 int zeroID = AddInstrConstantInt(0);
2687 CodeGen.OpImageSampleDrefExplicitLod(CurrentID, typeID, textureID, coordinateID, DrefID, zeroID);
2688 }
2689 IDInfos[CurrentID] = IDInfo::CreateIDInfoForValue(
2690 CurrentID,
2691 typeIL,
2692 op,
2693 typeID
2694 );
2695 UpdateValue(op, CurrentID);
2696
2697 return CurrentID;
2698 }
2699
2700 int AddInstrTexture2DShadowProj(
2701 ILOperand *op,

Callers 1

PrintCallInstrMethod · 0.80

Calls 5

GetTypeFromStringFunction · 0.85
GetVectorSizeMethod · 0.80
GetILTypeMethod · 0.80

Tested by

no test coverage detected