Blender V5.0
eval_output_gpu.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Foundation
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 *
5 * Author: Sergey Sharybin. */
6
7#ifndef OPENSUBDIV_EVAL_OUTPUT_GPU_H_
8#define OPENSUBDIV_EVAL_OUTPUT_GPU_H_
9
13
14#include <opensubdiv/osd/glPatchTable.h>
15#include <opensubdiv/osd/glVertexBuffer.h>
16
18
19namespace blender::opensubdiv {
20
21class GpuEvalOutput : public VolatileEvalOutput<GPUVertexBuffer,
22 GPUVertexBuffer,
23 GPUStencilTableSSBO,
24 GPUPatchTable,
25 GPUComputeEvaluator> {
26 public:
27 GpuEvalOutput(const StencilTable *vertex_stencils,
28 const StencilTable *varying_stencils,
29 const std::vector<const StencilTable *> &all_face_varying_stencils,
30 const int face_varying_width,
31 const PatchTable *patch_table,
32 EvaluatorCache *evaluator_cache = nullptr);
33
35
40
45
47 {
49 }
50
55
56 gpu::StorageBuf *create_face_varying_patch_array_buf(const int face_varying_channel) override;
57
58 gpu::StorageBuf *get_face_varying_patch_index_buf(const int face_varying_channel) override
59 {
60 GPUPatchTable *patch_table = getFVarPatchTable(face_varying_channel);
61 return patch_table->GetFVarPatchIndexBuffer(face_varying_channel);
62 }
63
64 gpu::StorageBuf *get_face_varying_patch_param_buf(const int face_varying_channel) override
65 {
66 GPUPatchTable *patch_table = getFVarPatchTable(face_varying_channel);
67 return patch_table->GetFVarPatchParamBuffer(face_varying_channel);
68 }
69
70 gpu::VertBuf *get_face_varying_source_buf(const int face_varying_channel) override
71 {
72 GPUVertexBuffer *vertex_buffer = getFVarSrcBuffer(face_varying_channel);
73 return vertex_buffer->get_vertex_buffer();
74 }
75};
76
77} // namespace blender::opensubdiv
78
79#endif // OPENSUBDIV_EVAL_OUTPUT_GPU_H_
gpu::StorageBuf * GetFVarPatchParamBuffer(int fvarChannel=0) const
Returns the GL index buffer containing face-varying patch params.
gpu::StorageBuf * GetPatchParamBuffer() const
Returns the GL index buffer containing the patch parameter.
gpu::StorageBuf * GetFVarPatchIndexBuffer(int fvarChannel=0) const
Returns the GL index buffer containing face-varying control vertices.
gpu::StorageBuf * GetPatchIndexBuffer() const
Returns the GL index buffer containing the patch control vertices.
gpu::StorageBuf * get_face_varying_patch_index_buf(const int face_varying_channel) override
gpu::StorageBuf * get_patch_param_buf() override
gpu::VertBuf * get_face_varying_source_buf(const int face_varying_channel) override
gpu::VertBuf * get_source_buf() override
gpu::VertBuf * get_source_data_buf() override
gpu::StorageBuf * create_patch_arrays_buf() override
gpu::StorageBuf * create_face_varying_patch_array_buf(const int face_varying_channel) override
gpu::StorageBuf * get_face_varying_patch_param_buf(const int face_varying_channel) override
gpu::StorageBuf * get_patch_index_buf() override
GpuEvalOutput(const StencilTable *vertex_stencils, const StencilTable *varying_stencils, const std::vector< const StencilTable * > &all_face_varying_stencils, const int face_varying_width, const PatchTable *patch_table, EvaluatorCache *evaluator_cache=nullptr)
VolatileEvalOutput(const StencilTable *vertex_stencils, const StencilTable *varying_stencils, const std::vector< const StencilTable * > &all_face_varying_stencils, const int face_varying_width, const PatchTable *patch_table, EvaluatorCache *evaluator_cache=NULL, void *device_context=NULL)