Commit Graph

11957 Commits

Author SHA1 Message Date
rdb ee1db0630a pipeline: _mm_pause alternative on non-x86 Windows 2022-10-23 14:21:39 +02:00
rdb a44d26bfbf pgraph: Allow moving a NodePath into a WorkingNodePath efficiently 2022-10-22 17:04:00 +02:00
rdb 4d2a13537a pgraph: Mark `RenderState::unref()` as final
This will allow the compiler to devirtualize these calls
2022-10-22 16:53:39 +02:00
rdb f0446a6e9c Merge remote-tracking branch 'origin/release/1.10.x' 2022-10-22 16:51:57 +02:00
rdb 6fe25d3edc shader: Fix attr_fogcolor not picking up inter-frame changes
Fixes shader generator not responding to fog color changes
2022-10-22 16:03:52 +02:00
rdb d0b7574384 pgraph: Add missing `PandaNodePipelineReader::get_into_collide_mask()` 2022-10-22 15:49:40 +02:00
rdb 8bed85740f pgraph: Fix race condition when destructing/constructing NodePaths
Fixes #1366
2022-10-22 15:48:23 +02:00
Disyer c28bd047b3 audio: Add support for setting the loop start time of sounds
Closes #1347
2022-10-22 10:27:57 +02:00
rdb fe9cda9614 collide: Remove duplicate capsule-into-poly test 2022-10-20 21:43:10 +02:00
rdb fe7635d6e7 wgldisplay: Mark a method as `static` 2022-10-20 21:02:17 +02:00
rdb 67fc72bdaf general: Add constness to some methods where it is missing 2022-10-20 21:01:58 +02:00
rdb cee1de7338 general: Get rid of some coerce constructors where they make no sense 2022-10-20 21:00:05 +02:00
rdb 61ff260ee3 Merge branch 'release/1.10.x' 2022-10-20 20:59:45 +02:00
rdb 9efdf9919c collide: Implement capsule-into-polygon intersection test
There is one edge case (literally) where the reported interior point isn't deep enough, which is when the capsule hits the edge of a polygon at a steep angle, but it will still push it out eventually, so whatever.

Fixes #1369
2022-10-20 17:14:54 +02:00
rdb 0b7c694f10 linmath: Make mat.rows[n] and mat.cols[n] assignable to 2022-10-19 16:04:57 +02:00
rdb 0c03dfca05 egg: Some comment reformatting
[skip ci]
2022-10-19 16:04:15 +02:00
rdb a8eef28708 glgsg: Fix error when downloading luminance8 texture 2022-10-19 12:20:06 +02:00
rdb bb6976d558 pstats: Third significant update to PStats server UI, including:
* Windows stay open after client disconnects, for further inspection
* Ability to save session results to a file, and reopening those files
* Ability to save the current graph window layout for new sessions
* Ability to change colors (by right-clicking on bar)
* SI prefixes for Hz units (kHz, MHz, etc.)
* Ability to export session to Chrome Tracing JSON format
* "Close All Graphs" menu option
* Graphs now properly show data when opened while Pause is on
* Some fixes for weird graph window minimize behavior on Windows
2022-10-05 18:58:36 +02:00
rdb d6ebd62034 express: Add peek_int16 and peek_uint16 to DatagramIterator 2022-10-04 15:46:53 +02:00
rdb 27e54ffd75 Merge branch 'release/1.10.x' 2022-10-03 18:38:47 +02:00
DJs3000 f6fac95a78 Added e2k support (MCST Elbrus 2000) (#1367)
Closes #1367
2022-10-03 18:29:41 +02:00
rdb 6ad68d95cb device: Fix missing init_type for InputDeviceNode 2022-09-28 06:32:46 +02:00
rdb 79bd743957 Merge branch 'release/1.10.x' 2022-09-02 23:14:15 +02:00
rdb 48b0819cda rocket: Don't try to build Boost binding code for Python 3
libRocket doesn't support Python 3 anyway, and it has an error compiling with Python 3.11

[skip ci]
2022-09-01 19:41:37 +02:00
LD 12ae2973ae cocoadisplay: Disable the event suppression interval when moving the position of the mouse pointer 2022-09-01 09:07:16 +02:00
LD 102da5bc35 cocoadisplay: Don't use position delta for confined mouse mode as it lead to invalid estimation of the pointer position 2022-09-01 09:07:16 +02:00
LD 69bf5fa626 cocoadisplay: Remove overzealous coordinates transform performed on mouse position 2022-09-01 09:07:16 +02:00
LD 105f9abbfa cocoadisplay: Trigger handle_move_event() when a resize event is received to also update the origin of the window if needed 2022-09-01 09:07:16 +02:00
rdb 88ba7badd4 collide: Fix false negative when sphere is fully inside box
Fixes #1335
2022-08-31 16:23:15 +02:00
rdb d239f48a43 Merge branch 'release/1.10.x' 2022-08-31 12:51:46 +02:00
Disyer d7c602d203 ffmpeg: Resolve segmentation fault when statically linking ffmpeg
Closes #1340
2022-08-31 11:56:10 +02:00
rdb 899cbb9fff shadow: Add shadow-cube-map-filter setting, disabled by default
Enabling this will enable the `FT_shadow` filter for cube maps, which doesn't work with Cg shaders (incl. shader generator) but does with custom GLSL shaders

This will be enabled by default once the shaderpipeline branch is merged

Fixes #1332
2022-08-31 11:41:48 +02:00
Derzsi Dániel d79709f004
express: Add support for bytes multifile encryption passwords (#1334) 2022-07-20 22:50:06 +02:00
pmp-p 2208cc8bff pipeline: support android no thread build
Closes #1323
2022-06-29 19:11:00 +02:00
rdb 20334cce05 Merge branch 'release/1.10.x' 2022-06-29 19:09:59 +02:00
Stephen A. Imhoff 33691d72ec bullet: Fix assertion when reconstructing BulletConvexHullShape from bam
Fixes #1251
Closes #1252
2022-06-29 17:06:19 +02:00
rdb 3fc579c7d4 tinydisplay: Implement resizeability of offscreen buffers
Fixes #1322
2022-06-29 17:03:44 +02:00
rdb 5493a0d5fc glgsg: Fix PStats GPU timing not working with newer NVIDIA drivers
Fixes #1320
2022-06-29 16:42:33 +02:00
rdb c325eabb9d glgsg: Fix texture format selection when using `T_half_float` component type 2022-06-29 15:15:02 +02:00
rdb 9ab460c900 event: Fix memory leak in debug check of `task.set_owner(...)`
Fixes #1328
2022-06-29 15:13:57 +02:00
rdb 36e34294cf display: Update docstring for `WindowProperties::set_mouse_mode()`
[skip ci]

Fixes #1307
2022-05-19 10:00:37 +02:00
rdb 29c25a541c egl: Add egl-device-index config var for selecting EGL device
Fixes #1306
2022-05-17 11:52:19 +02:00
rdb b5d615b223 mathutil: Fix broken docstrings 2022-05-17 10:10:45 +02:00
rdb 671b16eb41 express: Fix vestigial reference to WIN32_VC macro 2022-05-10 16:21:40 +02:00
rdb ecf4d19e83 Merge branch 'release/1.10.x' 2022-05-10 16:12:36 +02:00
rdb 42a19860d5 Fix errors when compiling headers with MinGW 2022-05-10 15:58:33 +02:00
rdb fbea0056f5 general: Allow compiling Panda headers on Windows without NOMINMAX 2022-05-10 15:58:33 +02:00
rdb 0538106d52 glgsg: Fix half float color buffers with GLES 3 / WebGL 2
Part of fix for #1296
2022-05-10 15:58:32 +02:00
rdb 7b5ec481f3 Merge branch 'release/1.10.x' 2022-05-05 10:44:51 +02:00
rdb d2fc682fd7 glgsg: Support floating-point FBOs in OpenGL ES 2+
See issue #1296
2022-05-05 10:41:01 +02:00
rdb d98f966693 display: Extra spam message about what window a flip is done for 2022-05-05 10:38:25 +02:00
Geraldo Nascimento 5ceaf66079 v4l: O_NONBLOCK flag should be OR'ed to O_RDWR or mmap will fail below
Closes #1299
2022-05-05 10:28:55 +02:00
rdb 1b21e604f0 Merge branch 'release/1.10.x' 2022-04-21 11:09:28 +02:00
rdb aab149e75a windisplay: Add debug prints listing display devices and monitors 2022-04-02 20:42:04 +02:00
rdb 3f901243f2 display: Add additional spam prints 2022-04-02 20:40:58 +02:00
rdb e02a9989fb android: Changes to add compatibility with pyjnius/plyer 2022-03-12 18:18:15 +01:00
rdb 98d70147bd pipeline: Fix Thread::bind_thread() assertion on Android 2022-03-12 16:48:46 +01:00
rdb 3d31f117e0 express: Fix compilation error with GCC 2022-03-09 16:23:37 +01:00
rdb 3456769703 gobj: Fix crash in PythonTexturePoolFilter 2022-03-09 16:23:37 +01:00
rdb c62d2319e0 CMake: Add --exclude-libs flags to static thirdparty libraries
Matching makepanda, this avoids symbol conflicts and may have optimization benefits.

This is a temporary hack until CMake 3.24 is released, which offers a cleaner way of doing this.
2022-03-09 16:23:37 +01:00
rdb 72f98ec30d gobj: Delete assignment operator of Geom* classes
They are unused and it would probably be a bad idea to try to use them.
2022-03-09 16:23:37 +01:00
rdb 6b9dea3e30 cleanup: Fix comparison between pointer and 0 (instead of nullptr) 2022-03-09 16:23:37 +01:00
rdb 8cdac14db3 collide: First pass at reducing memory overhead of CollisionBox
This is just the low-hanging fruit, there are a lot more gains to be realized.
2022-03-09 16:23:34 +01:00
rdb dae147ec0c Merge branch 'release/1.10.x' 2022-03-02 10:51:23 +01:00
rdb 930e5da438 texture: Fix get_ram_image_as() with 3D and multiview textures
Fixes #1277
2022-03-02 10:42:45 +01:00
rdb 46c1b887ea Fix heap alignment with SSE2 on 32-bit Windows by inheriting MemoryBase
Fixes #510
2022-03-02 09:57:44 +01:00
rdb 370b635534 dtoolbase: Fix missing __stdcall when compiling for 32-bit Windows 2022-03-02 09:57:24 +01:00
rdb a0be50c769 general: Fix assorted compiler warnings 2022-03-01 16:09:07 +01:00
rdb 21377c8de5 Use secure versions of CRT getenv etc. when compiling with MSVC 2022-03-01 16:09:07 +01:00
rdb 5cfd8db95c glxdisplay: Update panda_glxext.h 2022-03-01 16:09:07 +01:00
rdb ac3aa64d33 express: Add docstring to DatagramIterator about Datagram lifetime
Related to #1262

[skip ci]
2022-03-01 15:14:01 +01:00
rdb 583c9f1857 pipeline: Fix issues with calling convention on 32-bit Windows 2022-03-01 12:19:13 +01:00
rdb 7ccf38a948 pgraph: Remove obsolete PandaNodeChain class
Obsoleted by 6bc22d1822
2022-02-24 14:13:11 +01:00
rdb 6bc22d1822 pgraph: Rewrite inefficient prev_transform tracking mechanism
The previous system was causing a lot of lock contention when transforms are modified in the Cull thread.

The new implementation doesn't use a linked list or lock at all, but a simple atomically incrementing integer that indicates that the prev transforms have changed.  set_transform() reads this and backs up the prev transform the first time a transform is modified after reset_all_prev_transforms() is called.
2022-02-24 11:42:04 +01:00
rdb ba4173b32c pgraph: Add constexpr to CacheStats constructor 2022-02-23 23:20:53 +01:00
rdb c2d088f232 pipeline: Don't use Sleep(1) to yield on Windows
Use Sleep(0) instead.  Sleep(0) is not guaranteed to yield, which is a problem, but Sleep(1) can easily take up to 16 ms, which is really unacceptable except in very low-priority thread.  But really, you shouldn't be relying on force_yield() for anything except with the SIMPLE_THREADS model.

There is also SwitchToThread(), but in fact it is even weaker than Sleep(0).
2022-02-23 23:20:53 +01:00
rdb cb8563acac event: Update AsyncFuture to use new atomics implementation
With explicit barriers, and the non-timeout version of wait() is now significantly more efficient by using the new futexes if available
2022-02-23 23:20:49 +01:00
rdb 70c49a6416 pipeline: Add Thread::relax() for more efficient busy waiting
Equivalent to cpu_relax() or the pause instruction on x86
2022-02-23 23:20:30 +01:00
rdb 5196719f29 device: Fix XInput compile error compiling for newer Windows versions 2022-02-23 21:46:15 +01:00
rdb fd033e66f1 pstats: Add support for profiling thread context switches
Disabled by default, enable with `pstats-thread-profiling true` in Config.prc
2022-02-22 18:02:39 +01:00
rdb b4d51c24e9 event: Remove FunctionAsyncTask
To create a task from a lambda, it is more efficient to use the new AsyncTaskManager::add() short-hand which creates an AsyncTask subclass in-place.
2022-02-22 18:02:34 +01:00
rdb 7baeaf3809 event: New C++ AsyncTaskManager::add() no longer uses std::function
std::function has unnecessary overhead, better to just create an AsyncTask subclass in-place storing the closure

This obsoletes FunctionAsyncTask, it will be removed in a future commit
2022-02-22 17:02:42 +01:00
rdb 72c891c0df display: Fix issues with PStats GPU timing:
- Leaking queries by never reusing / releasing them
- Clock synchronization was way off when driver waited on GPU during sync point
2022-02-22 17:00:47 +01:00
rdb 759115fbc7 pstats: Fix crash when frame has only level data and no time data 2022-02-22 15:25:04 +01:00
rdb 0a3733ccb9 pstats: GPU timing improvements; use same frame numbering everywhere
Timer queries are significantly more efficient, are synchronized to CPU time, and the synchronized frame numbering makes it possible to correlate stuff in the Timeline view
2022-02-20 17:33:40 +01:00
rdb 65cd882cb2 display: PStats collector reorganisation
Remove *:do_frame (which adds another stack frame with very little value), remove unused App:Delete collector, merge Flip Begin/End collectors
2022-02-20 16:23:14 +01:00
rdb c0c5eeb27e display: Don't start/stop collectors for empty window list 2022-02-18 17:24:43 +01:00
rdb d7bbcfb0b7 pstats: Some collector reorganisation:
- "App:Show code:General" is gone, it was causing too much trouble
- Replace odd "Client::GuiObjects" with "Nodes:GUI"
- Regroup "Dirty PipelineCyclers" underneath "PipelineCyclers"
2022-02-17 12:48:36 +01:00
rdb 93b7ebffaa pstats: PStatClient.connect() should wait for UDP connection to be established
This makes the behavior of PStats more predictable, reducing missed frames at the beginning
2022-02-17 12:48:36 +01:00
rdb cf9574b412 pstats: Add convenience method for ticking current thread only 2022-02-17 12:48:36 +01:00
rdb aea2d6ef45 display: Release lock before notifying render thread in GraphicsEngine
Otherwise the render thread will wake up only to be blocked by the mutex right away.
2022-02-17 12:48:36 +01:00
rdb 355cd5b4cd pstats: Remove unused field from PStatClient::InternalThread 2022-02-07 17:03:58 +01:00
rdb 77b0d2d6a7 pstats: Switch from AtomicAdjust to C++11-style atomics 2022-02-07 17:02:30 +01:00
rdb e27162df0b Merge branch 'release/1.10.x' 2022-02-06 15:32:24 +01:00
rdb 287b0d5a74 mathutil: Add proper `__repr__` for LPlane class
Fixes #1248
2022-02-06 15:29:25 +01:00
rdb 94570f20aa pgraph: Remove need for grabbing lock in RenderState destructor 2022-02-05 22:25:51 +01:00
rdb 46a1ad3544 pipeline: Improve performance of Thread::get_current_thread() substantially
Speedup is realised by using thread-local variables.  Note that on Windows we can't inline get_current_thread, but it's still faster this way than calling TlsGetValue.

In theory the cache line alignment should help avoid false sharing but I have not profiled that extensively.
2022-02-04 23:49:39 +01:00
rdb f6322d8c93 pipeline: De-inline ConditionVarDummyImpl methods
This is the only ConditionVar implementation to import thread.h directly
2022-01-30 02:03:18 +01:00
rdb c66ca2ece1 pstats: Report PStats overhead more honestly
Half the overhead was being missed due to the unfortunate collector placement
2022-01-30 02:03:18 +01:00
rdb c7c1c683da pstats: Disable "App:Show code:General" collector for now
It is generating negative values, needs further investigation - maybe we need to restructure the whole hierarchy
2022-01-30 02:03:18 +01:00
rdb 36edb22fd1 pstats: Include client pid with hello message
Useful for uniquely identifying the process in a situation where multiple clients on the same host connect with the same server.

New version bump is not necessary, as old servers should just ignore the extra field in the datagram.
2022-01-30 02:03:18 +01:00
rdb 8034cb5a92 dtoolbase: Introduce patomic<> as replacement for AtomicAdjust
This typedefs to std::atomic<> when building with true threading, and uses a dummy implementation without.

This lets us use the full range of atomic operations offered by C++11, including explicit specification of memory fences.  Using barriers lets the compiler generate more optimal code since currently we are using the quite strict sequential-consistent memory ordering for all operations.  ReferenceCount has been changed to use the correct barriers (I hope).  This may especially make a difference on weak ordering systems such as ARM.

Over time we should gradually replace the use of AtomicAdjust with the new patomic file.
2022-01-30 01:53:36 +01:00
rdb 692221cacb cocoadisplay: Invert direction of horizontal scroll
Now behaves consistent with other applications (tested with Logitech MX Master 3 for Mac on macOS 10.13 in unnatural scrolling configuration).

Set `cocoa-invert-wheel-x true` to revert to old behaviour.
2022-01-22 15:56:53 +01:00
rdb eaa182f310 Merge commit '38bea01dab8f4dedd5fce9f8b9e82cebbf663189' into release/1.10.x 2022-01-22 15:46:52 +01:00
rdb 38bea01dab device: Do not enumerate keyboard/mouse devices on macOS by default
This causes an annoying "this app would like to receive keystrokes from any application" alert to be shown

Enable iokit-scan-mouse-devices or iokit-scan-keyboard-devices to restore the old behavior
2022-01-22 15:45:00 +01:00
rdb a56ee57422 Merge branch 'release/1.10.x' 2022-01-14 10:50:10 +01:00
rdb be2f6a7c61 glgsg: Fix missing GR_adjacency geom rendering flag
I don't think this flag being missing currently affects any functionality, but it is meant to be set when geometry shaders (with adjacency) are supported.
2022-01-14 10:25:01 +01:00
rdb b518da99a6 windisplay: fix origin not respected when switching to windowed mode 2022-01-12 10:23:19 +01:00
rdb 440b2c48b8 egg2pg: Slight cleanup
[skip ci]
2022-01-10 15:40:06 +01:00
rdb 6fe21fd8bd egg2pg: Add support for texture matrices to bam2egg 2022-01-10 13:22:57 +01:00
rdb 992cbb0840 pgraph: optimizations for analyze() 2022-01-10 13:22:34 +01:00
rdb a1538b4f7c pnmimage: Add offset parameters to PNMImage::perlin_noise_fill() 2022-01-10 13:21:51 +01:00
rdb 6777f19162 pnmimage: Add an additive PNMPainter brush 2022-01-10 13:21:46 +01:00
rdb 40f54a766c Merge branch 'release/1.10.x' 2022-01-07 10:52:28 +01:00
rdb d66ef59ecc pgraph: Fix assertion in PythonLoaderFileType with debug Python build 2022-01-07 10:44:03 +01:00
rdb 2d77093398 gobj: Fix TexturePeeker docstrings for filter_* being incorrect about wrapping
Fixes #1195
2022-01-06 12:52:10 +01:00
rdb 340dea5261 gobj: Fix crash when trying to load directory as txo/dds/ktx file 2022-01-06 11:52:40 +01:00
rdb 7a2a83572c Merge branch 'release/1.10.x' 2022-01-05 08:50:11 +01:00
rdb d65ca1edd6 pgraph: Fix nodes with same key but diff value getting flattened
This was a regression from 69b3468b2c
2022-01-05 08:14:08 +01:00
rdb ce9d2e38bf android: Improve physical mouse and keyboard handling:
- Support scroll wheel
- Support middle click, forward and back buttons (mouse4 and mouse5)
- Fix handling of key repeat events
- Correctly map numpad keys

[skip ci]
2022-01-04 20:35:17 +01:00
rdb d46651c032 Merge branch 'release/1.10.x' 2022-01-04 16:35:19 +01:00
rdb 210f7aecfb x11: Support mouse buttons 4 and 5 2022-01-04 11:06:25 +01:00
rdb d1c756713d display: Handle raw event for key between Shift and Z on ISO keyboards
This key is called raw-< for lack of anything better, it's usually mapped as backslash on US keyboards but that would not allow distinguishing between the backslash key near the enter key.
2022-01-04 11:05:46 +01:00
rdb c358f09f85 windisplay: Support lmeta, rmeta, and menu keys 2022-01-04 10:10:27 +01:00
rdb 08628dc97e windisplay: Support horizontal scroll wheel 2022-01-04 10:09:36 +01:00
rdb 822d8ce4c4 Revert "pgraph: Don't dupe shared GeomVertexData when premunging Geom"
This reverts commit f058bad802.

Reverting because I realised the current behaviour is happening due to different mungers, which my fix ignores.

Unfixes #1185
2022-01-03 11:31:54 +01:00
rdb f8df5cac32 Merge branch 'release/1.10.x' 2022-01-02 20:11:41 +01:00
rdb 11d5a49d6f pgraph: Fix LightAttrib::replace_{on|off}_light()
Fixes #1153
2022-01-02 13:02:04 +01:00
rdb f058bad802 pgraph: Don't dupe shared GeomVertexData when premunging Geom
Fixes #1185
2022-01-02 11:45:33 +01:00
rdb e9c97535f7 framework: Support GUI under pixel2d by default (for C++ users)
Fixes #1222
2022-01-01 18:22:02 +01:00
rdb b53895aa3d Merge branch 'release/1.10.x' 2022-01-01 18:18:46 +01:00
rdb 2915c6e670 glgsg: Force transform_weight column to read (0, 0, 0, 1) if absent
On NVIDIA cards, this doesn't seem to happen automatically.

Fixes #1207
2022-01-01 16:49:41 +01:00
rdb 5caf0ff5d6 device: Correction to 0e9ea67066
Fixes #1218
2022-01-01 15:14:30 +01:00
rdb 0e9ea67066 device: Implement correct sign extension for Windows raw devices
Hopefully, fix for #1218
2022-01-01 12:15:00 +01:00
rdb 72bf9e7fd1 device: Map FrSky RC controller as flight stick instead of gamepad
Reverts f01399bba8
2022-01-01 12:09:19 +01:00
rdb 1e6569e678 dxgsg9: Fix issues with luminance textures and ATI1 compression
Fixes #1198
2021-12-31 22:59:01 +01:00
rdb ecc6fb6b0c dxgsg9: Implement ability to get screenshot from multisample backbuffer
Fixes #1225
2021-12-31 13:41:57 +01:00
rdb 953cf898bc x11: Fix doubled-up info print message 2021-12-26 14:13:32 +01:00
rdb 9598065641 Merge branch 'release/1.10.x' 2021-12-26 14:13:23 +01:00
rdb f01399bba8 device: Correct axis mappings for FrSky RC controller on Windows
See #1218
2021-12-26 12:30:05 +01:00
rdb 8b19761844 device: Add spam output for raw windows device 2021-12-26 12:30:05 +01:00
rdb 5eb0f04e87 display: Add missing host property to GraphicsOutput 2021-12-14 11:43:03 +01:00
rdb 2e0614138f display: Add pickle support to FrameBufferProperties 2021-12-14 11:42:40 +01:00
rdb a4d53a8ced pgraph: Fix unnecessary double state munge in prepare_scene()
[skip ci]
2021-12-13 13:23:38 +01:00
rdb fc625eec11 Merge branch 'release/1.10.x' into incoming 2021-12-12 22:54:15 +01:00
Aidan Noll 8fbf972f30 putil: use Py_REFCNT macro instead of directly accessing reference count field
Closes #1197
2021-12-12 22:22:10 +01:00
rdb 0e91f4ee1c device: Gracefully ignore invalid data index from raw input device 2021-12-12 18:38:09 +01:00
rdb 215ad6bfd9 Fix a few docstring typos 2021-12-12 18:38:09 +01:00
rdb e4013226e1 general: Remove vestigial typedef.h file 2021-12-12 18:37:49 +01:00
rdb 3ef5d96efc putil: Slight BamReader optimization 2021-12-12 18:37:48 +01:00