From 8527d84d3588563123bfad7ccbdeeff62ee90bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 29 Aug 2020 15:17:13 +0200 Subject: 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. --- source/blender/gpu/GPU_framebuffer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/gpu/GPU_framebuffer.h') diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h index aa89b29f767..a52cdea5167 100644 --- a/source/blender/gpu/GPU_framebuffer.h +++ b/source/blender/gpu/GPU_framebuffer.h @@ -163,6 +163,8 @@ void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *confi /* Framebuffer operations */ void GPU_framebuffer_viewport_set(GPUFrameBuffer *fb, int x, int y, int w, int h); +void GPU_framebuffer_viewport_get(GPUFrameBuffer *fb, int r_viewport[4]); +void GPU_framebuffer_viewport_reset(GPUFrameBuffer *fb); void GPU_framebuffer_clear(GPUFrameBuffer *fb, eGPUFrameBufferBits buffers, -- cgit v1.2.3