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-29 16:17:13 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-30 14:11:03 +0300
commit8527d84d3588563123bfad7ccbdeeff62ee90bdb (patch)
tree51ccbaa3c129c62a54af5aed43b55b9c89b901e6 /source/blender/gpu/intern/gpu_state_private.hh
parent4f395c84fe9f05b59b81be36b464521bcf92331e (diff)
GPUState: Move Scissor and Viewport state to framebuffer
This way it is way clearer what each viewport state is. There is no more save and reset. The scissor test is also saved per framebuffer. The only rule to remember is that the viewport state (size and origin) is reset for both the viewport and scissor when a texture is attached or detached from an attachment slot.
Diffstat (limited to 'source/blender/gpu/intern/gpu_state_private.hh')
-rw-r--r--source/blender/gpu/intern/gpu_state_private.hh14
1 files changed, 1 insertions, 13 deletions
diff --git a/source/blender/gpu/intern/gpu_state_private.hh b/source/blender/gpu/intern/gpu_state_private.hh
index a1bfefbaff5..61234c4612c 100644
--- a/source/blender/gpu/intern/gpu_state_private.hh
+++ b/source/blender/gpu/intern/gpu_state_private.hh
@@ -94,11 +94,6 @@ inline GPUState operator~(const GPUState &a)
union GPUStateMutable {
struct {
/* Viewport State */
- /** TODO put inside GPUFramebuffer. */
- /** Offset + Extent of the drawable region inside the framebuffer. */
- int viewport_rect[4];
- /** Offset + Extent of the scissor region inside the framebuffer. */
- int scissor_rect[4];
/** TODO remove */
float depth_range[2];
/** TODO remove, use explicit clear calls. */
@@ -164,14 +159,7 @@ class GPUStateManager {
GPUStateManager();
virtual ~GPUStateManager(){};
- virtual void set_state(const GPUState &state) = 0;
- virtual void set_mutable_state(const GPUStateMutable &state) = 0;
-
- inline void apply_state(void)
- {
- this->set_state(this->state);
- this->set_mutable_state(this->mutable_state);
- };
+ virtual void apply_state(void) = 0;
};
} // namespace gpu