Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_batch_private.hh
| Show All 24 Lines | |||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "GPU_context.h" | #include "GPU_context.h" | ||||
| #include "gpu_index_buffer_private.hh" | #include "gpu_index_buffer_private.hh" | ||||
| #include "gpu_vertex_buffer_private.hh" | |||||
| namespace blender { | namespace blender { | ||||
| namespace gpu { | namespace gpu { | ||||
| /** | /** | ||||
| * Base class which is then specialized for each implementation (GL, VK, ...). | * Base class which is then specialized for each implementation (GL, VK, ...). | ||||
| * NOTE: Extends GPUBatch as we still needs to expose some of the internals to the outside C code. | * NOTE: Extends GPUBatch as we still needs to expose some of the internals to the outside C code. | ||||
| **/ | **/ | ||||
| class Batch : public GPUBatch { | class Batch : public GPUBatch { | ||||
| public: | public: | ||||
| Batch(){}; | Batch(){}; | ||||
| virtual ~Batch(){}; | virtual ~Batch(){}; | ||||
| virtual void draw(int v_first, int v_count, int i_first, int i_count) = 0; | virtual void draw(int v_first, int v_count, int i_first, int i_count) = 0; | ||||
| /* Convenience casts. */ | /* Convenience casts. */ | ||||
| IndexBuf *elem_(void) | IndexBuf *elem_(void) const | ||||
| { | { | ||||
| return unwrap(elem); | return unwrap(elem); | ||||
| }; | } | ||||
| VertBuf *verts_(const int index) const | |||||
| { | |||||
| return unwrap(verts[index]); | |||||
| } | |||||
| VertBuf *inst_(const int index) const | |||||
| { | |||||
| return unwrap(inst[index]); | |||||
| } | |||||
| }; | }; | ||||
| } // namespace gpu | } // namespace gpu | ||||
| } // namespace blender | } // namespace blender | ||||