本文整理汇总了C++中Hasher::data方法的典型用法代码示例。如果您正苦于以下问题:C++ Hasher::data方法的具体用法?C++ Hasher::data怎么用?C++ Hasher::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hasher
的用法示例。
在下文中一共展示了Hasher::data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: flush_graphics_pipeline
void CommandBuffer::flush_graphics_pipeline()
{
Hasher h;
active_vbos = 0;
auto &layout = current_layout->get_resource_layout();
for_each_bit(layout.attribute_mask, [&](uint32_t bit) {
h.u32(bit);
active_vbos |= 1u << attribs[bit].binding;
h.u32(attribs[bit].binding);
h.u32(attribs[bit].format);
h.u32(attribs[bit].offset);
});
for_each_bit(active_vbos, [&](uint32_t bit) {
h.u32(vbo_input_rates[bit]);
h.u32(vbo_strides[bit]);
});
h.u64(render_pass->get_cookie());
h.u64(current_program->get_cookie());
h.data(static_state.words, sizeof(static_state.words));
if (static_state.state.blend_enable)
{
const auto needs_blend_constant = [](VkBlendFactor factor) {
return factor == VK_BLEND_FACTOR_CONSTANT_COLOR || factor == VK_BLEND_FACTOR_CONSTANT_ALPHA;
};
bool b0 = needs_blend_constant(static_cast<VkBlendFactor>(static_state.state.src_color_blend));
bool b1 = needs_blend_constant(static_cast<VkBlendFactor>(static_state.state.src_alpha_blend));
bool b2 = needs_blend_constant(static_cast<VkBlendFactor>(static_state.state.dst_color_blend));
bool b3 = needs_blend_constant(static_cast<VkBlendFactor>(static_state.state.dst_alpha_blend));
if (b0 || b1 || b2 || b3)
h.data(reinterpret_cast<uint32_t *>(potential_static_state.blend_constants),
sizeof(potential_static_state.blend_constants));
}
auto hash = h.get();
current_pipeline = current_program->get_graphics_pipeline(hash);
if (current_pipeline == VK_NULL_HANDLE)
current_pipeline = build_graphics_pipeline(hash);
}