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>2020-08-17 21:32:20 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 22:30:11 +0300
commitadca09b643d05572321b5015809245493b8dd762 (patch)
treefa61cbe97396f0fc2a6c52e3e77caba30e0db6ef /source/blender/gpu/intern/gpu_state_private.hh
parenta9f2ebb215084debae70099b3d2e58195d9a9e32 (diff)
GPUState: Port default state to StateManager constructor
Diffstat (limited to 'source/blender/gpu/intern/gpu_state_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_state_private.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state_private.hh b/source/blender/gpu/intern/gpu_state_private.hh
index 3324cf6934f..99f580de15e 100644
--- a/source/blender/gpu/intern/gpu_state_private.hh
+++ b/source/blender/gpu/intern/gpu_state_private.hh
@@ -76,6 +76,13 @@ inline GPUState operator^(const GPUState &a, const GPUState &b)
return r;
}
+inline GPUState operator~(const GPUState &a)
+{
+ GPUState r;
+ r.data = ~a.data;
+ return r;
+}
+
/* Mutable state that does not require pipeline change. */
union GPUStateMutable {
struct {
@@ -128,12 +135,22 @@ inline GPUStateMutable operator^(const GPUStateMutable &a, const GPUStateMutable
return r;
}
+inline GPUStateMutable operator~(const GPUStateMutable &a)
+{
+ GPUStateMutable r;
+ for (int i = 0; i < ARRAY_SIZE(a.data); i++) {
+ r.data[i] = ~a.data[i];
+ }
+ return r;
+}
+
class GPUStateManager {
public:
GPUState state;
GPUStateMutable mutable_state;
public:
+ GPUStateManager();
virtual ~GPUStateManager(){};
virtual void set_state(const GPUState &state) = 0;