Age | Commit message (Collapse) | Author |
|
Before now it lived in source/blender/gpu for convenience. Only a few files in the gpu module use Gawain directly.
Tested on Mac, time to push and test on Windows.
Todo: some CMake magic to make it easy to
#include "gawain/some_header.h"
from any C or H file. Main problem here is the many editors that include GPU_immediate.h which includes Gawain's immediate.h -- is there a way to avoid changing every editor's CMakeLists?
|
|
So we can store (for example) vertex positions in one buffer and normals + colors in another buffer. Not super exciting right now, but very useful once we start changing some attribute values.
Supports future work by Clément et al. Only tested with one VBO per Batch since that's all our current code uses.
|
|
for vec3 arrays and matrix4.
|
|
ui_draw_but_COLORBAND
Introduced a new checker shader to be used mostly on transparent areas.
OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_UNITVEC
Introduced a new shader to be used for simple lighting.
|
|
|
|
|
|
These functions are called very infrequently.
|
|
For a few reasons:
- separate enum sets for separate concepts
- debug with symbolic names instead of 0x4e72
- prepare for a Vulkan future
|
|
Because GLenum could be ANYTHING. We use our own enum type for components.
|
|
Just as mentioned in title. Need new functions for calls found in `transform.c`
T49043
Reviewers: merwin
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D2358
|
|
- any shader program can use matrix state (not only built-in shaders)
- you can mix matrix & begin/end calls, and the bound shader will use the latest matrix state
Part of T49450 & T49043
|
|
|
|
Hoping for a small performance win.
|
|
|
|
Now you can explicitly skip a vertex attribute -- you don't give it a value and it won't get a copy of the previous vert's value. Useful for flat interpolated per-primitive values.
This is an advanced feature. Expect garbage in the empty spaces, and copies of garbage if you rely on the attrib copy behavior after skipping.
|
|
This was already fast on Apple, but @Severin and @dfelinto noticed slowdowns in user prefs, which is text heavy.
The problem was immBeginAtMost not being smart about VBO write flushing. immBeginAtMost can use all of its allocated range or only a subrange. The previous code was forcing back-to-back draw calls and buffer writes to serialize. This commit lets OpenGL know that our VBO writes never overlap, so there's no need to wait.
Should be much faster now!
|
|
New functions activate & deactivate immediate mode. Call these when switching context and the internal VAO will be handled properly. VAOs are one of the few things *not* shared between OpenGL contexts.
|
|
|
|
The whole point of BeginAtMost is to avoid counting before drawing. Sometimes the uncounted count is zero, and that's ok!
|
|
Made function categories more clear & added more notes about how to use this API.
immEndVertex is no longer part of the public API.
Minor cleanup & organizing of recent additions.
|
|
UI_draw_roundbox_gl_mode
I change UI_draw_roundbox_gl_mode to use immediate API.
The rest of the change is the call to the function.
I also make some change in UI_ThemeColor4(int colorid) for eg to make convenience to use.
I would really like to know if it's the good way to do, if yes I will make all the change in the node_daw.c after, else say me what's wrong and how to deal with color else.
Reviewers: merwin, dfelinto, Severin
Reviewed By: merwin
Subscribers: fablefox, Severin
Tags: #bf_blender_2.8, #opengl_gfx
Maniphest Tasks: T49043
Differential Revision: https://developer.blender.org/D2274
|
|
My initial tests were stricter than necessary, and blocked some valid uses. Fixed!
|
|
|
|
|
|
Reported by @kgeogeo
|
|
We still have stills with the User Preference window, though.
|
|
TEXTURE_RECT
Use the same vertex shader for both fragment shaders
|
|
fixes crash in Vertex Paint (color picker)
|
|
|
|
|
|
Fixed compile error in debug build (thanks mont29)
Renamed some functions for consistency.
New features:
Create a Batch with immediate mode! Just use immBeginBatch instead of immBegin. You can keep the result and draw it as many times as you like. This partially replaces the need for display lists.
Copy a VertexFormat, and create a VertexBuffer using an existing format.
Resize a VertexBuffer to a different number of vertices. (can only resize BEFORE using it to draw)
|
|
Put Gawain source code in a subfolder to make the boundary between the
library and the rest of Blender clear.
Changed Gawain’s license from Apache to Mozilla Public License. Has
more essence of copyleft — closer to GPL but not as restrictive.
Split immediate.c into several files so parts can be reused (adding
more files soon…)
|