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:

Same when searching for it in the API documentation:

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:

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;
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.