Commit Graph

70 Commits (bb7e45b9a3fa65e0670d237a66643a3f0efd1052)

Author SHA1 Message Date
cosmonaut 0df2944ccf CommandBuffer is now a pooled class + more state validation 2024-01-18 12:27:34 -08:00
cosmonaut e50fb472b1 Debug mode sample count and depth assertions 2024-01-15 23:16:29 -08:00
cosmonaut df3f38a67b Debug mode bounds checks for buffer and texture upload 2024-01-15 22:19:59 -08:00
cosmonaut 088e7c4b6f add debug check for zero length buffer copy 2023-08-07 10:12:46 -07:00
cosmonaut 496eb670ab AV1 Video instead of Theora (#49)
VideoPlayer now takes AV1 video instead of Ogg Theora. This brings a significant decode speed improvement. The decoder now also operates in a threaded manner, which should prevent runtime stalls when fetching video frames.

Reviewed-on: #49
2023-06-07 21:18:44 +00:00
cosmonaut 3584e670ee add array overloads to avoid explicit generic parameter 2023-04-05 12:40:34 -07:00
cosmonaut 1e3f04235e remove array parameters from API functions 2023-04-05 11:07:16 -07:00
cosmonaut bd825b6c91 allow pushing raw uniform data 2023-02-23 16:59:34 -08:00
TheSpydog b39526ca90 Textures now have a sample count, not render passes (#45)
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #45
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2023-01-31 20:27:26 +00:00
TheSpydog 88d9119830 Remove warning from DrawInstancedPrimitives doc comment (#44)
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #44
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2023-01-24 00:14:46 +00:00
TheSpydog f96298f991 Add validation checks for AcquireSwapchainTexture and BindVertexBuffers (#37)
This replaces the Refresh-side check for window claim status in AcquireSwapchainTexture, and adds validation to ensure that BindVertexBuffers is not called before BindGraphicsPipeline.

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #37
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-12-29 03:18:36 +00:00
cosmonaut d76633bdfc change sizeof calls to Marshal.SizeOf in interop situations 2022-12-13 19:01:40 -08:00
cosmonaut debb76f62a validate scissor dimensions 2022-12-13 16:09:32 -08:00
cosmonaut 36e6c6f332 optimize AcquireSwapchainTexture 2022-12-13 00:52:35 -08:00
cosmonaut b0e1ad3cf8 add note about disposing swapchain texture 2022-12-01 13:20:11 -08:00
cosmonaut 474b8fe37d only check depth format if there is a depth attachment 2022-11-29 13:06:03 -08:00
cosmonaut ecf1a8ed55 Optimize CommandBuffer (#35)
- remove params methods in favor of overloads and last-resort `in Span<T>` overloads
- add `in` to params that take structs to reduce unnecessary copying
- Buffer can now implicitly cast to BufferBinding
- add render pass / graphics pipeline format match validation

Reviewed-on: #35
2022-11-17 20:35:21 +00:00
cosmonaut 02b20f79f5 allow sampler binding calls to take array segment 2022-11-15 17:53:30 -08:00
TheSpydog c2ef78d136 Add validation check that all work group dimension counts are >= 1 (#34)
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #34
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-14 18:21:03 +00:00
TheSpydog 5533eeb2fd Fix bad pointer arithmetic in SetBufferData (#33)
Fixes a bug where SetBufferData was writing garbage to the buffer if `startElement` was non-zero.

Rather than fixing the pointer addition (it should have been `ptr + startElement`) I opted to remove it and instead pass the index explicitly when grabbing the address of the array element. I think that's a little easier to understand, and it's slightly safer too -- if you pass a startElement beyond the array bounds it will now throw an IndexOutOfRangeException instead of silently reading from outside the array bounds.

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #33
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-12 03:42:35 +00:00
TheSpydog 02b0c12ad8 Bunch of Refresh API changes, plus more validation (#31)
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-09 18:49:53 +00:00
TheSpydog 1b38f8606b Added more graphics validation, misc api tweaks (#30)
* Refactored render pass attachment validation to avoid copy-pasting the asserts
* Added validation for texture usage flags and null textures/samplers
* Added an exception for when GraphicsPipeline/ComputePipeline creation fails
* Changed TextureSamplerBinding so that it holds references to the Texture and Sampler classes, rather than just their handles
* Removed the CommandBuffer.BindVertex/FragmentSamplers overloads that took a length parameter

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #30
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-08 19:29:05 +00:00
cosmonaut 07c0b1b9a2 Window API revision + Framerate limiter (#27)
- add `Backend` enum
- `GraphicsDevice` can now take a preferred backend at creation

- add `GraphicsDevice.ClaimWindow`
- add `GraphicsDevice.UnclaimWindow`
- add `GraphicsDevice.SetPresentMode`

- add `Window.Claimed`
- add `Window.SwapchainFormat`
- fix certain odd behaviors in multi-window scenarios

- rename `FramerateSettings` to `FrameLimiterSettings`
- add `Game.SetFrameLimiter`

Reviewed-on: #27
2022-09-29 22:22:50 +00:00
cosmonaut d5a7daa524 add graphics state validation in debug mode 2022-09-07 13:07:17 -07:00
cosmonaut 1af16231ce Refresh 1.6.0 2022-08-25 12:32:49 -07:00
cosmonaut 0c6bb538fb fix depth-only render pass invocation + throw instead of return 2022-08-22 19:30:44 -07:00
cosmonaut efb9893aef Theora video support + audio improvements (#20)
- `SoundInstance.Play` no longer takes a loop parameter
- `SoundInstance.Stop` is split into `Stop` and `StopImmediate` instead of taking an immediate parameter
- Added `StreamingSoundSeekable` to better support streaming audio that does not support seek
- `StreamingSound` no longer has a Loop property, but `StreamingSoundSeekable` does
- abstract `StreamingSound.AddBuffer` renamed to `FillBuffer`
- `FillBuffer` is now provided with a native buffer to avoid an extra data copy
- `StreamingSound` buffer implementation optimized to avoid repeated alloc/frees

- added `Video` class which can load and play Theora (.ogv) streaming video/audio

Reviewed-on: #20
2022-08-02 21:04:12 +00:00
cosmonaut 9862bfd0a0 TextureSamplerBinding now stores IntPtrs 2022-05-23 19:12:17 -07:00
cosmonaut a0082bcec6 change Marshal.SizeOf to sizeof 2022-04-27 14:14:15 -07:00
cosmonaut 61a6d0bdc0 Font Rendering (#18)
Adds a font rendering system based on Wellspring.

Reviewed-on: #18
2022-04-13 03:06:14 +00:00
cosmonaut 3623e6b07c add debug exception for binding a null texture 2022-03-17 14:42:43 -07:00
cosmonaut 2a9286f31e Clear and AcquireSwapchainTexture ABI break 2022-03-10 10:25:41 -08:00
cosmonaut cf2d8473a1 renderArea NULL inputs 2022-03-06 22:33:12 -08:00
cosmonaut b5b0f35b50 SetViewport and SetScissor doc comments 2022-03-04 14:14:22 -08:00
cosmonaut 527f47436a Refresh 1.2.0 2022-03-04 13:21:52 -08:00
cosmonaut 40d9cdd33a add element-wise SetBufferData overload 2022-03-04 10:00:29 -08:00
cosmonaut f6369b6bce add some notes to AcquireSwapchainTexture 2022-03-02 10:13:52 -08:00
cosmonaut d6606d90f6 AcquireSwapchainTexture nullable 2022-03-02 09:39:23 -08:00
cosmonaut 1fa73f0275 more presentation API improvements 2022-03-01 23:21:42 -08:00
cosmonaut 81c882bd48 presentation ABI break 2022-03-01 22:57:10 -08:00
cosmonaut 9028a8b1a0 remove Window namespace 2022-02-25 13:23:31 -08:00
Caleb Cornett 2469cf530a Capitalized attachment info struct member names 2022-02-25 11:17:37 -05:00
cosmonaut 1064bae828 Render Pass Streamlining (#14)
Changes as per a531fb8593

Reviewed-on: #14
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
2022-02-25 05:34:36 +00:00
cosmonaut 8a3d93d2dc intellisense improvement + API tweak 2022-02-22 22:16:06 -08:00
cosmonaut 8973b3e658 Formatting pass 2022-02-22 21:14:32 -08:00
cosmonaut 4acc2588e1 QueuePresent ABI break 2022-02-08 17:17:51 -08:00
cosmonaut 8022cd1011 add DispatchCompute to command buffer 2022-01-17 20:39:03 -08:00
cosmonaut d2fca3654b never mind on SetDataOptions, bad idea 2022-01-13 14:48:32 -08:00
cosmonaut a5c8ebfc3a update buffer upload ABI 2022-01-13 14:29:08 -08:00
cosmonaut 7d7437721c uniforms are now pushed via command buffer 2022-01-12 13:01:32 -08:00