Share retained stroke texture binding helpers
This commit is contained in:
@@ -37,6 +37,18 @@ struct LegacyStrokeSampleExecutionResult {
|
||||
glm::vec4 dirty_bounds {};
|
||||
};
|
||||
|
||||
enum class LegacyCanvasStrokeTextureInput {
|
||||
brush_tip,
|
||||
stroke_destination,
|
||||
pattern,
|
||||
mixer,
|
||||
};
|
||||
|
||||
struct LegacyCanvasStrokeTextureBinding {
|
||||
LegacyCanvasStrokeTextureInput input = LegacyCanvasStrokeTextureInput::brush_tip;
|
||||
int slot = 0;
|
||||
};
|
||||
|
||||
struct LegacyCanvasStrokeFaceDirtyRequest {
|
||||
pp::renderer::Extent2D extent {};
|
||||
glm::vec4 previous_accumulated_dirty_box {};
|
||||
@@ -200,6 +212,26 @@ std::size_t execute_legacy_canvas_stroke_frame_faces(
|
||||
return executed_faces;
|
||||
}
|
||||
|
||||
template <typename BindTextureInput, std::size_t BindingCount>
|
||||
inline void bind_legacy_canvas_stroke_texture_inputs(
|
||||
const std::array<LegacyCanvasStrokeTextureBinding, BindingCount>& bindings,
|
||||
BindTextureInput&& bind_texture_input)
|
||||
{
|
||||
for (const auto& binding : bindings) {
|
||||
bind_texture_input(binding.input, binding.slot);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename UnbindTextureInput, std::size_t BindingCount>
|
||||
inline void unbind_legacy_canvas_stroke_texture_inputs(
|
||||
const std::array<LegacyCanvasStrokeTextureBinding, BindingCount>& bindings,
|
||||
UnbindTextureInput&& unbind_texture_input)
|
||||
{
|
||||
for (const auto& binding : bindings) {
|
||||
unbind_texture_input(binding.input, binding.slot);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Frames, typename BeginFrame, typename BeginFace, typename ExecuteSample, typename FinishFace>
|
||||
std::size_t execute_legacy_canvas_stroke_frame_samples(
|
||||
Frames&& frames,
|
||||
|
||||
Reference in New Issue
Block a user