Commit Graph

242 Commits

Author SHA1 Message Date
rdb 7c0a77af78 display: disable depth test before DisplayRegion draw callback
Having depth test disabled is the default OpenGL state, and callbacks may quite reasonably expect to see the default state.  Kivy seems to expect this, for one.
2018-11-24 22:45:41 +01:00
rdb c18cdcf36e display: add support for debug markers, to help with debugging
This is useful when running Panda in a tool like apitrace, so that the different calls in a frame are ordered in a neat hierarchy.
2018-11-20 12:41:20 +01:00
rdb 8f73f95e79 display: make PStats clear collectors per-window 2018-11-19 20:02:38 +01:00
rdb afc994b2fb display: fix crash when removing DisplayRegion in pipelined render
Maybe not a perfect solution; we should consider keeping the DisplayRegions around until they have gone through the entire pipeline.

Fixes #427
2018-10-28 11:48:05 +01:00
rdb b0c9000000 display: fix assert when app exits before window fully opens
Possibly addressing #403
2018-10-07 21:41:02 +02:00
rdb d4d582484f display: fix ability to make screenshots in multithreaded pipeline
Problem is that WGL is strict about binding context in different thread while it is still bound in another thread.  Either way we need to make sure the draw thread is not rendering, so if you call get_screenshot() from a thread other than the draw thread, it uses the GraphicsEngine to wait until the draw thread is idle and then asks it to do the get_screenshot().

Fixes #360
2018-07-05 19:02:37 +02:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
Sam Edwards e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
rdb eb960669a5 display: fix assert when window fails to open
The assert is being triggered because the window is already being removed in open_windows.  It does not really matter if it returns false anyway, as long as the window is removed one way or another.
2018-06-03 22:33:59 +02:00
rdb 9fad3dba60 general: remove macros for compatibility with non-C++11 compilers
Now that we require MSVC 2015, we no longer need all this nonsense, so we can write cleaner code.
2018-05-23 23:33:05 +02:00
rdb 4c4288f491 display: lock GraphicsEngine mutex in remove_all_windows() 2018-01-17 19:46:11 +01:00
rdb 4bac9efffe display: fix dispatch_compute and extract_texture_data in MT pipeline
This is required to make the test suite run with pipelining enabled.

It's necessary to let the draw thread do these tasks because that's where the OpenGL context is bound to.  However, we need to let it access the data from the calling thread, so we have to temporarily change the pipeline stage of the draw thread.

I'm not really happy about this solution; it would be better to temporarily make the context current to the app thread, but we need a window for that, which we don't currently require to be passed into that method.
2018-01-03 00:13:48 +01:00
rdb 512f305c12 display: fix assertions when removing window that isn't open yet 2018-01-03 00:09:30 +01:00
Younguk Kim 84bdce01f2 Fix crash by end iterator while closing a window 2018-01-01 18:14:48 +09:00
rdb 7ee9467f8d shadows: fix shadow buffer creation deadlock in multithreaded pipeline
Fixes #162
2017-12-30 17:47:15 +01:00
rdb bb60e8c373 display: fix segfault when output is removed during render
Fixes: #176
2017-10-15 18:48:53 +02:00
rdb b781995ef1 ShaderGenerator: prepare_scene now invokes shader generator.
This also necessarily removes ShaderGenerator's dependency on a host window.
2017-06-20 16:16:30 +02:00
rdb 53258af876 display: reduce GraphicsEngine traversal overhead a bit 2017-02-20 00:23:21 +01:00
rdb 8381118a97 Assorted tweaks and compile warning fixes 2016-07-14 12:54:39 +02:00
rdb 85386049f0 Merge branch 'release/1.9.x' 2016-07-09 15:39:07 +02:00
rdb 44d59edc30 Fix cube map render and rendering the same camera with two GSGs
The problem was that the cull result was being reused across different lens indices and GSGs
2016-07-09 14:42:25 +02:00
rdb 6728e5ecbe Merge remote-tracking branch 'origin/release/1.9.x' 2016-06-23 16:14:18 +02:00
rdb 1974b3e692 Fix deadlock waiting for Python task to end at end of program 2016-06-12 12:04:03 +02:00
rdb d53b2ca80e Backport various bugfixes from master, among which:
- Fix Windows pbuffer crash on Intel cards
 - Fix crash when using pnmimage.write with unsupported format
 - Fix GLSL diagnostics on Mesa GLES2 compiler
 - Reduce warning severity when resizing immutable storage texture
 - Print more debug info when FrameBufferProperties are insufficient
 - Fix "Bam file contains objects of unknown type: MovingPart<LMatrix4f>"
 - Fix memory leak in BulletTriangleMesh
 - Fix pmerge in Python 3
2016-06-07 14:40:27 +02:00
rdb 07d06d434c Print more debug info when FrameBufferProperties are not sufficient 2016-04-23 18:06:18 +02:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb 6eb460c359 Add ability to cache compiled GLSL shaders, remove unused ShaderUtilization 2016-01-13 19:58:11 +01:00
rdb 25451feb87 Improve shadow system, add point light shadows, GLSL shadow inputs 2015-12-07 21:12:07 +01:00
rdb 0ae2df7e02 Merge branch 'release/1.9.x' 2015-11-01 15:54:58 +01:00
rdb d3494edf2c Address some rare crashes at shutdown 2015-10-31 04:11:12 +01:00
rdb f33e450823 A lot of performance changes, particularly wrt dcasts and state management 2015-07-27 16:32:57 +02:00
rdb adb02a8f45 Compile out things irrelevant for target build, like ShaderGenerator when !HAVE_CG 2015-04-06 13:24:45 +02:00
rdb 7ba0469148 Shader generation should be done in cull, not in draw 2015-01-23 15:03:50 +01:00
rdb 0ad0d4ec33 Further optimizations to the cull pipeline.
The only transform still stored in CullableObject is internal transform.

NB: I haven't tested my PipeOcclusionCullTraverser changes.  Please contact me if you encounter problems with it.
2015-01-22 16:22:16 +01:00
rdb 94e5bbf579 Changes to support a custom GraphicsWindow derivation 2015-01-21 20:32:00 +01:00
rdb 7d0c1420c2 Bypass view frustum cull entirely when camera has OmniBV 2014-12-11 16:27:51 +01:00
rdb a65b477734 Commit patches by cfsworks:
cxx: Fix missing includes masked by composite builds.
misc: Fix typos in comments.
config: Fix missing config forward-declarations.
direct: Adjust Python imports to panda3d.* instead of pandac.*.
display: Split graphicsWindow out into an extension.
framework: Use if/elif/elif/endif instead of ifdef/elif/elif/endif.
ode: Remove erroneous INLINE declarations.
interval: Fix missing import.
2014-10-19 22:41:47 +00:00
rdb db0fd516a0 Add GPU profiling capabilities to PStats using OpenGL timer queries 2014-09-24 23:53:37 +00:00
rdb f8675fcd7b Allow calling dispatch_compute directly to GraphicsEngine 2014-07-03 21:57:33 +00:00
rdb 2274f2e651 FBO overhaul: support layered framebuffers (RTM_bind_layered), support render-to-2d-array, better respect FrameBufferProperties, more simple handling of RTP_depth_stencil 2013-08-13 12:44:27 +00:00
David Rose 9a93914d58 properly support a different coordinate system per camera (or lens) 2012-03-14 20:51:58 +00:00
rdb 39e520268d fix debugging message accidentally left in 2012-02-13 06:59:22 +00:00
David Rose 841bfb0743 fix Tut-Fireflies demo (problem with initially zero-sized buffers) 2012-02-12 21:40:16 +00:00
David Rose d743dc8a55 The buffer flip should be performed in end_flip(), not in begin_flip(). This long-existing mistake caused double-flips with parasite buffers in effect. 2012-02-10 18:21:55 +00:00
David Rose d34c964e53 UnionBoundingVolume, IntersectionBoundingVolume, Camera::set_cull_bounds() 2012-02-09 21:55:31 +00:00
David Rose fdca621619 slightly more robust handling of CallbackGraphicsWindow 2012-01-14 16:21:53 +00:00
David Rose e08f1d204f more WxPandaWindow fixes 2012-01-13 23:42:23 +00:00
David Rose 56f22e0692 WxPandaWindow 2012-01-08 16:10:18 +00:00
rdb 2d78a0503b more easily extendable DisplayRegion 2012-01-07 18:52:20 +00:00
David Rose f110a269c8 GraphicsEngine::get_render_lock() 2012-01-03 03:05:54 +00:00