MCPcopy Create free account
hub / github.com/BabylonJS/BabylonNative / AppendSamplers

Function AppendSamplers

Plugins/NativeEngine/Source/NativeEngine.cpp:109–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 }
108
109 void AppendSamplers(std::vector<uint8_t>& bytes, const spirv_cross::Compiler& compiler, const spirv_cross::SmallVector<spirv_cross::Resource>& samplers, bool /*isFragment*/, std::unordered_map<std::string, UniformInfo>& cache)
110 {
111 for (const spirv_cross::Resource& sampler : samplers)
112 {
113 AppendBytes(bytes, static_cast<uint8_t>(sampler.name.size()));
114 AppendBytes(bytes, sampler.name);
115 AppendBytes(bytes, static_cast<uint8_t>(bgfx::UniformType::Sampler | BGFX_UNIFORM_SAMPLERBIT));
116
117 // TODO : These values (num, regIndex, regCount) are only used by Vulkan and should be set for that API
118 AppendBytes(bytes, static_cast<uint8_t>(0));
119 AppendBytes(bytes, static_cast<uint16_t>(0));
120 AppendBytes(bytes, static_cast<uint16_t>(0));
121
122 cache[sampler.name].Stage = static_cast<uint8_t>(compiler.get_decoration(sampler.id, spv::DecorationBinding));
123 }
124 }
125
126 void CacheUniformHandles(bgfx::ShaderHandle shader, std::unordered_map<std::string, UniformInfo>& cache)
127 {

Callers 1

CreateProgramMethod · 0.85

Calls 1

AppendBytesFunction · 0.85

Tested by

no test coverage detected