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

Function getShaderAccess

Source/Falcor/Core/Program/ProgramReflection.cpp:234–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234static ReflectionResourceType::ShaderAccess getShaderAccess(TypeReflection* pSlangType)
235{
236 // Compute access for an array using the underlying type...
237 pSlangType = pSlangType->unwrapArray();
238
239 switch (pSlangType->getKind())
240 {
241 case TypeReflection::Kind::SamplerState:
242 case TypeReflection::Kind::ConstantBuffer:
243 return ReflectionResourceType::ShaderAccess::Read;
244 break;
245
246 case TypeReflection::Kind::Resource:
247 case TypeReflection::Kind::ShaderStorageBuffer:
248 switch (pSlangType->getResourceAccess())
249 {
250 case SLANG_RESOURCE_ACCESS_NONE:
251 return ReflectionResourceType::ShaderAccess::Undefined;
252
253 case SLANG_RESOURCE_ACCESS_READ:
254 return ReflectionResourceType::ShaderAccess::Read;
255
256 default:
257 return ReflectionResourceType::ShaderAccess::ReadWrite;
258 }
259 break;
260
261 default:
262 return ReflectionResourceType::ShaderAccess::Undefined;
263 }
264}
265
266static ReflectionResourceType::ReturnType getReturnType(TypeReflection* pType)
267{

Callers 1

reflectResourceTypeFunction · 0.70

Calls 1

unwrapArrayMethod · 0.80

Tested by

no test coverage detected