Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-11-13 20:02:17 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-11-13 20:02:17 +0300
commitce9fcb15a33663527e3fc1a533de356428d3445f (patch)
tree5c794d5e15bc242004c61081d88d10c51f1e95f8
parentbd622aef3c2f250719056dd5fc105136aa800e78 (diff)
DRW: Manager: Fix `ClearMulti` breaking compilation on Mac
The error was: `draw_pass.hh:1055:16: error: call to implicitly-deleted default constructor of 'blender::draw::command::Undetermined [3]'
-rw-r--r--source/blender/draw/intern/draw_command.cc4
-rw-r--r--source/blender/draw/intern/draw_command.hh4
-rw-r--r--source/blender/draw/intern/draw_pass.hh2
3 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_command.cc b/source/blender/draw/intern/draw_command.cc
index 7a053933cc1..69e1c069ff8 100644
--- a/source/blender/draw/intern/draw_command.cc
+++ b/source/blender/draw/intern/draw_command.cc
@@ -164,7 +164,7 @@ void Clear::execute() const
void ClearMulti::execute() const
{
GPUFrameBuffer *fb = GPU_framebuffer_active_get();
- GPU_framebuffer_multi_clear(fb, (const float(*)[4])colors.data());
+ GPU_framebuffer_multi_clear(fb, (const float(*)[4])colors);
}
void StateSet::execute(RecordingState &recording_state) const
@@ -486,7 +486,7 @@ std::string Clear::serialize() const
std::string ClearMulti::serialize() const
{
std::stringstream ss;
- for (float4 color : colors) {
+ for (float4 color : Span<float4>(colors, colors_len)) {
ss << color << ", ";
}
return std::string(".clear_multi(colors={") + ss.str() + "})";
diff --git a/source/blender/draw/intern/draw_command.hh b/source/blender/draw/intern/draw_command.hh
index bbbc63e4c9c..607f0b36583 100644
--- a/source/blender/draw/intern/draw_command.hh
+++ b/source/blender/draw/intern/draw_command.hh
@@ -332,7 +332,9 @@ struct Clear {
};
struct ClearMulti {
- Span<float4> colors;
+ /** \note This should be a Span<float4> but we need have to only have trivial types here. */
+ const float4 *colors;
+ int colors_len;
void execute() const;
std::string serialize() const;
diff --git a/source/blender/draw/intern/draw_pass.hh b/source/blender/draw/intern/draw_pass.hh
index 10cc03bdf11..51b30674359 100644
--- a/source/blender/draw/intern/draw_pass.hh
+++ b/source/blender/draw/intern/draw_pass.hh
@@ -480,7 +480,7 @@ inline void PassBase<T>::clear(eGPUFrameBufferBits planes,
template<class T> inline void PassBase<T>::clear_multi(Span<float4> colors)
{
- create_command(command::Type::ClearMulti).clear_multi = {colors};
+ create_command(command::Type::ClearMulti).clear_multi = {colors.data(), colors.size()};
}
template<class T> inline GPUBatch *PassBase<T>::procedural_batch_get(GPUPrimType primitive)