Commit Graph

1188 Commits

Author SHA1 Message Date
rdb db692edfa9 glgsg: Issue memory barriers for SSBOs
At the moment, it assumes that all SSBO accesses are writes, once shaderpipeline lands we can sort out readonly accesses based on the qualifiers in the shader
2025-01-20 20:58:14 +01:00
rdb 271fa9d9c0 glgsg: Fix issues with render-to-texture and cube map arrays 2025-01-19 11:10:06 +01:00
rdb 6f33bbecea glgsg: Fix use after free with gl-force-fbo-color and layered FBO 2024-12-03 13:19:48 +01:00
rdb 8ff71aeb15 webgl: Fix precision issues with default shaders 2024-11-03 23:58:28 +01:00
rdb 5f96cc592e Merge branch 'release/1.10.x' 2024-10-27 09:40:52 +01:00
rdb 905a7dd482 glgsg: Fix missing include 2024-10-17 16:23:36 +02:00
rdb 7c9c4cd435 gobj: devirtualize calls to GeomPatches::get_num_vertices_per_primitive() 2024-10-17 16:18:12 +02:00
rdb 52a7224d6e Fix various compiler warnings 2024-10-14 12:05:27 +02:00
rdb fc394e4c59 glgsg: Pass in osg_FrameNumber input via ShaderMatSpec mechanism 2024-08-23 21:08:50 +02:00
rdb cd68287b6a shader: Get all aggregate shader inputs (eg. lights) in one go
This means that p3d_LightSource[n] will be fetched once off the LightAttrib, written to the matrix cache, and then indexed into by the various ShaderMatSpec. This should be significantly more efficient, but the main aim is to prepare for a new binding system in the new shader pipeline

User structs are still an exception as of now
2024-08-23 16:29:46 +02:00
rdb 99225dfaef shader: Unify ShaderPtrSpec and ShaderMatSpec mechanisms 2024-08-23 16:29:42 +02:00
rdb 99f4034701 shader: Don't store on ShaderMatSpec, use scratch matrix instead 2024-08-23 16:29:38 +02:00
rdb ad57762e9f Merge branch 'release/1.10.x' 2024-08-07 22:34:08 +02:00
rdb 122453811d glgsg: Fix clear of offscreen buffer if back buffers requested 2024-06-30 11:53:17 +02:00
rdb adb9242885 glgsg: Fix faulty auto-merge 2024-05-14 23:19:46 +02:00
rdb b6515c881c Merge branch 'release/1.10.x' 2024-05-14 22:47:08 +02:00
rdb 2436a06527 glgsg: Better error when invalid ShaderPtrSpec type is encountered 2024-05-14 22:45:01 +02:00
rdb d4a3b9bfcd glgsg: Fix docstring typo 2024-03-15 12:47:21 +01:00
rdb 09fc5b73d7 glgsg: Fix regressions with fog shader inputs in GLSL 2024-02-11 22:57:18 +01:00
rdb 84ed141b2a Squash merge webgl-port branch into master
Adds support for emscripten as a build target / platform, and adds a WebGL renderer back-end
2024-01-25 15:37:38 +01:00
rdb ca9b5dd44a glgsg: Fix for when `p3d_Color` is set to vec4 type
Fixes #1601
2024-01-23 15:42:13 +01:00
rdb 39d964c4bb glgsg: Don't set immutable flag for buffer textures (regression)
Fixes #1602
2024-01-23 15:37:07 +01:00
rdb 9145b6c729 Merge branch 'release/1.10.x' 2024-01-04 16:36:03 +01:00
rdb 4f37d97cf6 glgsg: Show internal format in debug output 2023-12-10 13:18:23 +01:00
rdb 89701270dd gles2gsg: Fix image load/store support in OpenGL ES 3.1
This does require gl-immutable-texture-storage to be on, so it is not enabled by default unless that variable is set. That is not a breaking change since before this change, support was never enabled to begin with
2023-12-09 21:15:28 +01:00
rdb 5b041474ff glgsg: Fix wrong value for deprecated shadowMatrix shader input 2023-10-13 23:29:21 +02:00
rdb 2c727940ae glgsg: Fix code issue with new integer ShaderMatSpec 2023-09-18 14:11:22 +02:00
rdb cb4597ebb8 shader: Pass built-in array shader input in one go
This applies to `p3d_TextureMatrix[]` and `p3d_ClipPlane[]`

This is more efficient and also works around Apple driver bugs (like #846)

Fixes #883
2023-09-17 19:18:40 +02:00
rdb ba388e2866 shader: More efficient state-based shader input fetching
Previously every input was fetched as a matrix.  Now, every input is fetched as a vector, with matrices taking up multiple vectors.  This saves a lot of copying and a lot of space in the cache.

Furthermore, integer state-based inputs can be defined (for future use)

Naming still needs to be revised, since it's called the "mat part cache" etc.
2023-09-17 17:54:17 +02:00
rdb 07f9f9d897 (multiview) texture preparation changes:
Multiview textures are now handled as a single texture context instead of as one texture context per view. This should be marginally more efficient, but more importantly, it paves the way for implementing multiview textures as subviews of an array texture down the line, which paves the way for hardware-accelerated stereo rendering (where the left and right views get rendered simultaneously to different layers of an array texture).

The difference between a multiview texture done this way and an array texture is that the views of a multiview texture will still be treated as individual textures from the shader's point of view, only the views will be sharing the same storage on the GPU.  This can be done by using a feature offered by graphics APIs that is (serendipitously) also called "texture views", where it's possible to create multiple texture objects that point to layer ranges of a bigger array texture.

That part has not yet been done as doing this in OpenGL will be a little tricky due to texture views being an optional feature (so both paths would need to be implemented), but texture views are native in Vulkan (and D3D10+ for that matter), so doing this now allows me to implement multiview textures natively on the Vulkan end right from the start, and OpenGL can follow later if desired.

Furthermore, this commit includes:
- OpenGL: Overhaul texture creation and binding
- OpenGL: Change how reloading a texture with mipmaps works
- OpenGL: Use DSA in a couple of places
- OpenGL ES: Add support for buffer textures
- OpenGL: Remove support for bindless textures for now; this was never implemented in a very useful way, not used to my knowledge, and it is better to re-implement it later after the new shader pipeline lands
- DirectX9: All views of a texture are uploaded at the same time
- TinyDisplay: Support multiview textures natively (consecutive storage in memory)
- General: Per-page texture update tracking is working properly now for multiview textures
2023-06-13 13:51:19 +02:00
rdb 05436a749f Merge branch 'release/1.10.x' 2023-03-09 11:23:19 +01:00
rdb c5d6bae1c3 glgsg: Work around Panfrost driver bug with wireframe mode 2023-03-09 10:58:10 +01:00
rdb eefb51f510 dtoolutil: Add small_vector implementation and use it
This vector implementation does is optimized for the case of having only a small number of elements, which are stored directly on the vector object rather than being allocated from the heap.  If the capacity exceeds this small number, then a heap allocation is done.

This should improve performance in a couple of cases where vectors typically store 1 element and rarely more than that.
2023-02-22 16:48:11 +01:00
rdb 173dd67b52 glgsg: Fix p3d_LightModel.ambient not updating properly 2023-02-12 13:07:14 +01:00
rdb 6075307e66 glgsg: Set maximum vertex attrib stride for WebGL 2023-02-03 15:17:55 +01:00
rdb 805fa5a36a glgsg: Guess max vertex attrib stride if not queryable
Or should we just assume the most restrictive possibility?
2023-02-03 15:09:32 +01:00
rdb b09a8a84ec Merge branch 'release/1.10.x' 2023-02-03 14:52:39 +01:00
rdb d69d393e4c glgsg: Set ultimate Cg profiles to gp5vp/gp5fp/gp5gp
These support the most features, including cube map arrays (which aren't even supported in glslv/glslf)

This improves the quality of error messages, eg. using cube map arrays will no longer display a cryptic error about no overload of texCUBEARRAY() being available
2023-01-31 17:38:54 +01:00
rdb c5ccd6232d glgsg: Prevent exceeding max supported vertex attrib stride
See also Moguri/panda3d-gltf#117
2023-01-31 15:30:52 +01:00
rdb b282e8920d Merge branch 'release/1.10.x' 2023-01-13 22:32:35 +01:00
rdb 7a8e218da7 glgsg: Correctly handle 4-component texcoords in default shader 2023-01-13 19:35:45 +01:00
rdb 709555577f ShaderGenerator: Add support for perspective points
Fixes #1440
2023-01-13 19:12:01 +01:00
rdb 10f4c6bb21 shader: Add texconst_i shader input for Cg shaders to access TexGen constant 2023-01-13 17:02:15 +01:00
rdb 21347bb2d5 glgsg: Fix bug if same texture is used with different tex gen modes in FFP 2023-01-13 17:00:12 +01:00
rdb a2aa8af973 Correctly support 4-component UV coordinates in generated shaders
Supports projective UVs, matching fixed-function pipeline behavior
2023-01-02 10:48:33 +01:00
rdb cfd18bb16f display: Add support for asynchronous screenshot download 2022-12-26 20:01:38 +01:00
rdb 507ca7f7ac display: Remove some unused variables 2022-12-07 13:53:44 +01:00
rdb c82f95ad6b Merge branch 'release/1.10.x' 2022-12-06 20:02:35 +01:00
rdb 45ac5029c0 glgsg: Fix compile error with OpenGL ES 1
Introduced by 2c9deaaaf0
2022-12-06 16:53:51 +01:00
rdb 2c9deaaaf0 glgsg: Fix 1 texture stage limit when setting `gl-version 3 2` or higher
Fixes #1404
2022-12-06 12:57:45 +01:00