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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-08-16 17:11:15 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-08-16 17:11:15 +0400
commit8d1c0b6f0f4012b379023b96b4c426b3432c018b (patch)
treea06f8d870de918fba20f3b8cfe5b615337dc4938 /source/blender/compositor/operations/COM_WriteBufferOperation.h
parentfd7bffa3c5276229a0ca06e4ff59319fbfc674f9 (diff)
Fix for #36468, "Buffer Groups" option changes compositing output.
Problem is that the read/write buffer operations only work with actual image inputs. If a singular value is used as group input no actual buffer will be created, the write operation does not schedule any chunks and the ReadBufferOperation subsequently returns zero (MemoryBuffer::read). The fix uses the (0,0) resolution to detect single value input of the WriteBufferOperation. The actual resolution is then clamped to (1,1) to ensure we have a single pixel to store the value in. A m_single_value flag is also set, so we can reliably distinguish this from genuine image resolutions without having to check m_width/m_height later on. The ReadBufferOperation copies this flag from the associated WriteBufferOperation and if set will always return the single value from pixel (0,0).
Diffstat (limited to 'source/blender/compositor/operations/COM_WriteBufferOperation.h')
-rw-r--r--source/blender/compositor/operations/COM_WriteBufferOperation.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h
index d89444045d4..157543fcb72 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.h
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h
@@ -32,6 +32,7 @@
*/
class WriteBufferOperation : public NodeOperation {
MemoryProxy *m_memoryProxy;
+ bool m_single_value; /* single value stored in buffer */
NodeOperation *m_input;
public:
WriteBufferOperation();
@@ -40,11 +41,13 @@ public:
MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; }
void executePixel(float output[4], float x, float y, PixelSampler sampler);
const bool isWriteBufferOperation() const { return true; }
+ bool isSingleValue() const { return m_single_value; }
void executeRegion(rcti *rect, unsigned int tileNumber);
void initExecution();
void deinitExecution();
void executeOpenCLRegion(OpenCLDevice *device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer);
+ void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
void readResolutionFromInputSocket();
inline NodeOperation *getInput() {
return m_input;