Cleanup: Rename #if GPU_USE_PY_REFERENCES
to #ifndef GPU_NO_USE_PY_REFERENCES
This is safer for incremental build. And there was already a macro `GPU_USE_PY_REFERENCES` used elsewhere.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#pragma once
|
||||
|
||||
#define PROGRAM_NO_OPTI 0
|
||||
#define USE_PY_REFERENCES 1
|
||||
//#define GPU_NO_USE_PY_REFERENCES
|
||||
|
||||
#if defined(NDEBUG)
|
||||
# define TRUST_NO_ONE 0
|
||||
|
@@ -209,7 +209,7 @@ void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *fb,
|
||||
void (*callback)(void *userData, int level),
|
||||
void *userData);
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
void **GPU_framebuffer_py_reference_get(GPUFrameBuffer *gpu_fb);
|
||||
void GPU_framebuffer_py_reference_set(GPUFrameBuffer *gpu_fb, void **py_ref);
|
||||
#endif
|
||||
|
@@ -270,7 +270,7 @@ bool GPU_texture_depth(const GPUTexture *tex);
|
||||
bool GPU_texture_stencil(const GPUTexture *tex);
|
||||
bool GPU_texture_integer(const GPUTexture *tex);
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
void **GPU_texture_py_reference_get(GPUTexture *tex);
|
||||
void GPU_texture_py_reference_set(GPUTexture *tex, void **py_ref);
|
||||
#endif
|
||||
|
@@ -72,7 +72,7 @@ FrameBuffer::~FrameBuffer()
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
if (this->py_ref) {
|
||||
*this->py_ref = nullptr;
|
||||
}
|
||||
@@ -479,7 +479,7 @@ void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *gpu_fb,
|
||||
unwrap(gpu_fb)->recursive_downsample(max_lvl, callback, userData);
|
||||
}
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
void **GPU_framebuffer_py_reference_get(GPUFrameBuffer *gpu_fb)
|
||||
{
|
||||
return unwrap(gpu_fb)->py_ref;
|
||||
|
@@ -100,7 +100,7 @@ class FrameBuffer {
|
||||
bool scissor_test_ = false;
|
||||
bool dirty_state_ = true;
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
public:
|
||||
/**
|
||||
* Reference of a pointer that needs to be cleaned when deallocating the frame-buffer.
|
||||
|
@@ -61,7 +61,7 @@ Texture::~Texture()
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
if (this->py_ref) {
|
||||
*this->py_ref = nullptr;
|
||||
}
|
||||
@@ -587,7 +587,7 @@ bool GPU_texture_array(const GPUTexture *tex)
|
||||
return (reinterpret_cast<const Texture *>(tex)->type_get() & GPU_TEXTURE_ARRAY) != 0;
|
||||
}
|
||||
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
void **GPU_texture_py_reference_get(GPUTexture *tex)
|
||||
{
|
||||
return unwrap(tex)->py_ref;
|
||||
|
@@ -80,7 +80,7 @@ class Texture {
|
||||
int refcount = 1;
|
||||
/** Width & Height (of source data), optional. */
|
||||
int src_w = 0, src_h = 0;
|
||||
#if USE_PY_REFERENCES
|
||||
#ifndef GPU_NO_USE_PY_REFERENCES
|
||||
/**
|
||||
* Reference of a pointer that needs to be cleaned when deallocating the texture.
|
||||
* Points to #BPyGPUTexture.tex
|
||||
|
Reference in New Issue
Block a user