Commit Graph

1158 Commits

Author SHA1 Message Date
rdb ba3a826bff gobj: fix crash reading unaligned float4 column in GeomVertexReader
Observed when calling flatten_strong() on model with vertex colors loaded via Assimp.
2019-02-17 13:02:56 +01:00
rdb 9d12a4c437 general: improvements to doxygen API reference:
* In C++ reference, only pick up classes defined in .h file
* Add a few excludes to C++ reference that aren't public API
* On class index pages, reduce number of columns
* Add @since for some methods/classes that are new in 1.10.0
* Fix/improve a few docstrings here and there
2019-01-23 22:24:02 +01:00
rdb 84a1315104 More fixes to work around broken libc++ eof() in Mac OS X 10.7 2019-01-10 21:53:02 +01:00
rdb 83374de0ff shader: don't use GENERIC profile to compile Cg shaders
Instead, make an educated guess of what the GSG we are going to be compiling this shader for wants to use as profile.
2018-12-31 14:01:26 +01:00
rdb 669a655366 Fix ShaderBuffer cleanup assertion with state cache disabled 2018-12-26 22:47:14 +01:00
rdb 5cafe8552b gobj: add F_rg, F_rg16, F_rg32, F_rgb32 to TexturePeeker 2018-12-19 20:26:51 +01:00
rdb 65a86d1b3f shader: warn if GLSL shader does not contain #version line
Shaders without #version line (which are supposed to indicate GLSL 1.10) will be interpreted differently by different drivers, so this is almost certainly a mistake.  In the future, we can forbid this altogether or insert #version 110 automatically.
2018-12-16 21:01:38 +01:00
rdb 73452957ee gobj: better handle NaNs in vertex data when calculating bounds 2018-12-16 20:43:30 +01:00
rdb 301957c591 gobj: improve performance of GeomPrimitive::make_nonindexed()
It now no longer has to create two GeomVertexArrayDataHandle objects for every vertex it visits.
2018-12-04 12:36:03 +01:00
rdb 97d4e32a06 general: use nassert_raise instead of nassertv(false) et al
Even a brief error message in the assertion is infinitely more useful to a user who is not at home in the source code, especially for assertions that may reasonably be triggered by honest user mistakes.
2018-11-28 17:35:20 +01:00
rdb 53cec96c07 Fix draw calls being listed under Primitive Setup in PStats, etc.
Previously, all draw calls would be grouped under "Primitive Setup", rather than under the appropriate bin collector.  This commit fixes that and adds a few other useful collectors as well.
2018-11-20 12:41:30 +01:00
rdb f43bd1a409 gobj: remove use of PY_MAJOR_VERSION in internalName.h
We should not use this symbol in the interrogated headers as it means we cannot reuse the output of interrogate with different versions of Python.
2018-11-06 19:26:25 +01:00
rdb c4f5ed308f shader: reduce unnecessary newlines and #line in preprocessed GLSL
This is done by only writing out a #line when the first non-whitespace line is encountered; any blank lines before that are trimmed.  This cuts down the size of the preprocessed shaders for a large project with many shader includes, such as the RenderPipeline.
2018-11-01 23:25:17 +01:00
rdb be464b61b3 shader: do not require whitespace around : in #extension directive 2018-11-01 22:27:28 +01:00
rdb bc22f5781b shader: supports preprocessed GLSL shaders in Shader.make()
Fixes #436
2018-11-01 22:27:15 +01:00
rdb 6488e46cc7 Fix errors when building with --override DO_PIPELINING=UNDEF 2018-10-17 17:33:27 +02:00
rdb fbf939141b gobj: fix typo causing crash when preparing shader 2018-10-16 21:13:27 +02:00
rdb bfeb5060b8 gobj: don't create pointless future in TextureReloadRequest 2018-10-16 15:23:52 +02:00
rdb bcc2e3e404 gobj: add Geom::get_animated_vertex_data() short-hand
This is a method for getting the animated vertex data that will keep working even if GeomVertexData::animate_vertices() gets deprecated due to #421 being fixed.
2018-10-15 22:13:21 +02:00
rdb 0131d1013b gobj: fix assert when enabling hw anim if blend has 5+ transforms
Instead, we reduce the TransformBlend down to the 4 most-weighted joints.
2018-10-15 22:07:32 +02:00
rdb 6e370ebbdd gobj: speed up GeomVertexData::get_num_rows() considerably 2018-10-15 22:06:04 +02:00
Sam Edwards 6f62396373 general: Resolve a few compiler warnings
- display: GraphicsWindowProc should have a virtual destructor,
           as it's meant to be subclassed.

- express: set_matrix_view helper should always fail an assert
           when 'size' is wrong, even on release builds.

- express: Fix filename capitalization on some #includes.
           They're normally Windows-only, where case doesn't
           matter, but it's better to be consistent.

- gobj: Fix typo.

- particlesystem: Remove BaseParticle::_last_position.
                  Last position is tracked by PhysicsObject now.

- windisplay: Heed warnings about casting bool to (PVOID).
              Also, per MSDN docs, SPI_SETMOUSETRAILS uses the
              uiParam argument and ignores pvParam, so pass the
              _saved_mouse_trails value in that way.
2018-10-12 15:37:40 -06:00
rdb b183e99692 gobj: fix bug printing Material base color 2018-09-09 20:23:48 +02:00
rdb b1f32e3f84 shader: reserve SL_SPIR_V ShaderLanguage value (as on vulkan branch) 2018-09-02 12:00:30 +02:00
rdb 3495537bf9 gobj: support clearing half-float textures
Fixes #374
2018-09-02 10:58:02 +02:00
rdb c670cd45d9 gobj: handle infinity and NaN when peeking half float values 2018-09-02 10:56:20 +02:00
rdb c4fe1ed883 gobj: slight refactor of Texture::do_get_clear_data() 2018-09-02 10:54:07 +02:00
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06:00
rdb 72e593800f gobj: don't recalculate proj mat on set_near/far with existing value 2018-08-12 22:06:13 +02:00
rdb 9ba2d7242e gobj: get rid of enforce-attrib-lock, just DTRT instead
This setting causes asserts when modifying certain material flags after they are assigned to a node, in case a shader has been generated that uses the materials, which cannot efficiently detect whether the material has changed.  However, we already sort of have a (inefficient, but effective) solution for this in TextureStage (see #178) that we could just apply here as well: changing the material attributes after such a shader has been generated could call GraphicsStateGuardianBase::mark_rehash_generated_shaders().

In the future, we should replace the material model with one that does not require shader regeneration for such seemingly trivial property changes.

Fixes #370
2018-08-03 21:55:06 +02:00
rdb 7e290b221b Remove a few unused and obsolete C++ test files 2018-08-03 21:09:36 +02:00
rdb 668a093c26 gobj: try to fix some deadlocks modifying geometry while rendering
The correct locking order should be: the Geom's GeomVertexArrayData first, *then* the GeomPrimitive.
2018-08-03 20:45:29 +02:00
rdb 0cd69c8748 gobj: fix TexturePool ambiguity when loading tex with other settings
Previously, if you called load_texture a second time with different parameters (such as an alpha filename), you would still get the old texture.
2018-07-31 14:56:04 +02:00
rdb ecfeae8a27 shader: support double-precision vertex columns in GLSL 2018-07-26 22:07:20 +02:00
rdb 1a6d329fde gobj: support T_unsigned_int_24_8 in TexturePeeker 2018-07-23 08:32:58 +02:00
rdb cf240d95c1 gobj: support infinite near distance in PerspectiveLens
Useful when rendering with near/far planes flipped around.
2018-07-17 22:59:54 +02:00
rdb b5194d9ff2 glgsg: pad SSBOs to 16 byte boundary (required by some drivers) 2018-07-17 22:59:15 +02:00
rdb 06539f5c66 glsl: support passing uint variables to shader 2018-07-17 22:32:34 +02:00
rdb 10fe8659c6 gobj: work around a deadlock in GeomCacheManager::flush() 2018-07-12 14:22:27 +02:00
rdb c6ed4e1836 general: don't cast to regular pointer when returning a PointerTo
This is inefficient because it induces an unnecessary ref()/unref() pair when we just need to move the pointer out of the function.  Thanks to 23128e4695, we can now move between related pointer types, making the .p() hack unnecessary.
2018-07-08 21:40:58 +02:00
rdb 00888518fe gobj: add F_r32i and F_r32 to TexturePeeker 2018-07-04 20:31:08 +02:00
rdb f2976b03ec gobj: add alignment support and move semantics to SimpleAllocator 2018-07-02 12:55:18 +02:00
rdb 927fcda817 shader: fix shader newline error with Intel drivers
It appears that Intel drivers always need a newline at the end of the file.
2018-06-22 20:53:56 +02:00
rdb 886e1c2f16 general: fix many compilation warnings in GCC 8 2018-06-19 00:37:28 +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
rdb 9231694f8f gobj: fix Python 3 support for GVADHandle::get_(sub)data/set_(sub)data
That said, you should really be using the buffer protocol; you can create a memoryview() directly around the GeomVertexArrayData.
2018-06-14 14:11:34 +02:00
Sam Edwards 7e61891c09 general: Fix more DLL linkage and EXPCL_PANDA_ macros 2018-06-12 16:14:33 -06:00
Sam Edwards 3c6ebb56bd general: pvector<unsigned char> -> vector_uchar 2018-06-10 02:25:10 -06:00
Sam Edwards b8bc1bb5e9 gobj: Include, don't forward-declare, BamCacheRecord in shader.h
Closes #346
2018-06-10 01:37:13 -06:00
Sam Edwards 7790f8429d general: Fully qualify header references into the std namespace
Closes #341
2018-06-07 10:35:12 +02:00