MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / getFormatBindFlags

Method getFormatBindFlags

Source/Falcor/Core/API/Device.cpp:998–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996}
997
998ResourceBindFlags Device::getFormatBindFlags(ResourceFormat format)
999{
1000 gfx::ResourceStateSet stateSet;
1001 FALCOR_GFX_CALL(mGfxDevice->getFormatSupportedResourceStates(getGFXFormat(format), &stateSet));
1002
1003 ResourceBindFlags flags = ResourceBindFlags::None;
1004 if (stateSet.contains(gfx::ResourceState::ConstantBuffer))
1005 {
1006 flags |= ResourceBindFlags::Constant;
1007 }
1008 if (stateSet.contains(gfx::ResourceState::VertexBuffer))
1009 {
1010 flags |= ResourceBindFlags::Vertex;
1011 }
1012 if (stateSet.contains(gfx::ResourceState::IndexBuffer))
1013 {
1014 flags |= ResourceBindFlags::Index;
1015 }
1016 if (stateSet.contains(gfx::ResourceState::IndirectArgument))
1017 {
1018 flags |= ResourceBindFlags::IndirectArg;
1019 }
1020 if (stateSet.contains(gfx::ResourceState::StreamOutput))
1021 {
1022 flags |= ResourceBindFlags::StreamOutput;
1023 }
1024 if (stateSet.contains(gfx::ResourceState::ShaderResource))
1025 {
1026 flags |= ResourceBindFlags::ShaderResource;
1027 }
1028 if (stateSet.contains(gfx::ResourceState::RenderTarget))
1029 {
1030 flags |= ResourceBindFlags::RenderTarget;
1031 }
1032 if (stateSet.contains(gfx::ResourceState::DepthRead) || stateSet.contains(gfx::ResourceState::DepthWrite))
1033 {
1034 flags |= ResourceBindFlags::DepthStencil;
1035 }
1036 if (stateSet.contains(gfx::ResourceState::UnorderedAccess))
1037 {
1038 flags |= ResourceBindFlags::UnorderedAccess;
1039 }
1040 if (stateSet.contains(gfx::ResourceState::AccelerationStructure))
1041 {
1042 flags |= ResourceBindFlags::AccelerationStructure;
1043 }
1044 flags |= ResourceBindFlags::Shared;
1045 return flags;
1046}
1047
1048size_t Device::getTextureRowAlignment() const
1049{

Callers 2

createResourceForPassFunction · 0.80
TextureMethod · 0.80

Calls 2

getGFXFormatFunction · 0.85
containsMethod · 0.45

Tested by

no test coverage detected