Download

How do I use GraphicsPipelineState?

I’m trying to clean up some deprecation warnings on some calls into FRHICommandList (SetBlendState, SetRasterState, etc.) which just say “Use GraphicsPipelineState Interface”.

Searching for “GraphicsPipelineState” in the engine documentation returns no results: https://www.unrealengine.com/bing-search?keyword=GraphicsPipelineState&filter=Documentation&x=0&y=0

Same when searching for it in the API documentation: https://www.unrealengine.com/bing-search?keyword=GraphicsPipelineState&filter=C%2B%2B+API

Searching for it on the forums yields the error “The following words are either very common, too long, or too short and were not included in your search:
GraphicsPipelineState” and no search results.

Searching for it on AnswerHub yields no results: Search - UE4 AnswerHub

A Google search brought me to the most useless documentation page I’ve ever seen: https://docs.unrealengine.com/latest/INT/API/Runtime/RHI/FComputedGraphicsPipelineState/GraphicsPipelineState/index.html

Digging through the engine source for a while brought me to PipelineStateCache.h and .cpp which look… maybe promising? But there are no comments anywhere in any of this code, and since I lack a working knowledge of the overall implementation model on account of not being employed by Epic, I don’t even know where to begin to decipher this.

I could just ignore the deprecation warnings for now (they’re not hurting anything) but I’m really curious how we’re actually intended to resolve this?

Hey invicticide,

I have the same problem and got really ****ed up by the crappy documentation sometimes -.- :smiley: and you’re right, there’s nothing about this GraphicsPipelineState… So I had a look in the LensDistortionPlugin (LensDistortionRendering.cpp) and stumbled upon this:



FGraphicsPipelineStateInitializer GraphicsPSOInit;
RHICmdList.ApplyCachedRenderTargets(GraphicsPSOInit);
GraphicsPSOInit.DepthStencilState = TStaticDepthStencilState<false, CF_Always>::GetRHI();
GraphicsPSOInit.BlendState = TStaticBlendState<>::GetRHI();
GraphicsPSOInit.RasterizerState = TStaticRasterizerState<>::GetRHI();


Hope this helps. Let me know if you need more help.