Commit Graph

201 Commits (c0624a9e28877b11a22d879cce01fc92a78a900e)

Author SHA1 Message Date
Caleb Cornett c0624a9e28 update documentation + remove validation + misc cleanup
continuous-integration/drone/pr Build is passing Details
2022-12-28 20:53:55 -05:00
cosmonaut 124f202d2c Same-access-type barrier should not be a no-op
continuous-integration/drone/push Build is passing Details
2022-12-27 20:51:09 -08:00
cosmonaut 528abfad76 fix render target destroy segfault
continuous-integration/drone/push Build is passing Details
2022-12-22 17:23:11 -08:00
TheSpydog 297f234957 Miscellaneous API changes + more MSAA fixes (#26)
continuous-integration/drone/push Build is passing Details
**Breaking API Changes**
* Removed `REFRESH_SAMPLECOUNT_16/32/64`, since hardware support for these sample counts is generally poor (and completely non-existent with MoltenVK and certain consoles).
* Removed unused `sampleCount` parameter from `Refresh_TextureCreateInfo`.
* Removed `sampleCount` parameter from `Refresh_ColorAttachmentDescription`. The existence of this parameter meant you had to sync up three different sample count values (render pass, pipeline, and color attachment description) whenever you wanted to use multisampling. However, Vulkan requires that all color attachments in a given pipeline _must_ match the pipeline's sample count anyway, so we can assume all color attachments will use the pipeline's sample count.
* Removed the `renderArea` parameter from `Refresh_BeginRenderPass()` since it didn't serve much practical purpose and slightly complicated things on the MoonWorks managed side.

**Behavior Changes**
* When creating a render pass or graphics pipeline, the requested multisample count will be converted into a sample count that's actually supported by the GPU. For example, if you request 8x MSAA on a device that only supports up to 4x MSAA, it will silently fall back to 4x MSAA.
* All color attachments are now forced to have an internal store op of `STORE`, even if `REFRESH_STORE_OP_DONTCARE` is specified. The one exception is internal multisample textures -- if `DONTCARE` is used, those textures will be discarded to save on bandwidth. (Their resolve textures will still be stored.)
* The RenderPass hashing logic was updated so that it would still work correctly with the removal of `Refresh_ColorAttachmentDescription.sampleCount`.

**Bug Fixes**
* Fixed bugs where multisampling logic wasn't kicking in for certain sample counts due to incorrect enum comparisons.

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
Reviewed-on: #26
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-08 19:09:21 +00:00
TheSpydog 5f05ef02a0 MSAA fixes (#25)
continuous-integration/drone/push Build is passing Details
- Fixed bug where multisample enum values were not being translated into their equivalent Vulkan enums
- Fixed bug where MSAA attachments in transient render pass creation were using a sample count of 1
- Fixed bug where the clearValues array in BeginRenderPass was not being populated with clear values for multisample attachments. (Modeled the fix after https://github.com/FNA-XNA/FNA3D/blob/master/src/FNA3D_Driver_Vulkan.c#L8723)
- Fixed bug where the multisample texture was not being transitioned when beginning a render pass

Reviewed-on: #25
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-03 19:50:07 +00:00
TheSpydog c4b9798fc1 enable samplerAnisotropy device feature (#24)
continuous-integration/drone/push Build is passing Details
Co-authored-by: TheSpydog <thespydog@noreply.example.org>
Co-committed-by: TheSpydog <thespydog@noreply.example.org>
2022-11-02 21:23:48 +00:00
cosmonaut 3c7755d8bf rework window claim and swapchain acquisition
continuous-integration/drone/push Build is passing Details
2022-11-01 11:54:19 -07:00
cosmonaut 9073f68e0a Fix swapchain extent check when size is zero
continuous-integration/drone/push Build is passing Details
2022-10-31 14:16:32 -07:00
cosmonaut 1a0beea402 Backend selection + swapchain API revision (#23)
continuous-integration/drone/push Build is passing Details
- The application must now call `Refresh_SetBackend` before creating the device
- `Refresh_SetBackend` can set a preferred backend, but will fall back if it is not available
- Device creation no longer takes presentation parameters
- Windows must now be explicitly claimed by the device
- Windows can be unclaimed by the device
- Windows can have their swapchain present mode changed after creation

Reviewed-on: #23
2022-09-29 21:11:25 +00:00
cosmonaut f8bdf6fe1a fix texture copy memory barrier + optimize RT memory barrier
continuous-integration/drone/push Build is passing Details
2022-09-22 12:44:28 -07:00
cosmonaut 5568ce4949 Fix heap iteration (#22)
continuous-integration/drone/push Build is passing Details
Fixes an issue where certain memory heaps could potentially be overlooked.

Reviewed-on: #22
2022-09-13 20:54:24 +00:00
cosmonaut f49c0ab190 Texture format rework (#21)
continuous-integration/drone/push Build is passing Details
- Adds number format information to the texture format names
- Adds several unsigned integer texture formats

Reviewed-on: #21
2022-09-13 20:51:41 +00:00
cosmonaut 06ad0e1901 fix barrier issue when sampling depth texture
continuous-integration/drone/push Build is passing Details
2022-08-25 16:20:35 -07:00
cosmonaut 5b27f600de add DrawPrimitivesIndirect + fix sync issues
continuous-integration/drone/push Build is passing Details
2022-08-25 12:21:49 -07:00
cosmonaut 2fb9a6931b fix SetTextureDataYUV image transitions
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-07-29 18:15:02 -07:00
Hazel Stagner c01ff21359 Fix blit destination layer and level
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-07-22 20:59:01 -07:00
cosmonaut e5da75d33a fix exponential growth when submitting multiple command buffers
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-06-27 10:21:40 -07:00
cosmonaut 99e9dc5b8c fix framebuffer size miscalculation with depth attachment
continuous-integration/drone/push Build is passing Details
2022-06-17 14:47:12 -07:00
cosmonaut 0e7720ccf6 D16 fallback when unsupported
continuous-integration/drone/push Build is passing Details
2022-06-17 00:41:27 -07:00
cosmonaut 488cb8c535 add format to render pass hash
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-06-06 11:46:08 -07:00
cosmonaut 163adfb5cd add BC7 support
continuous-integration/drone/push Build is passing Details
2022-05-11 21:16:24 -07:00
cosmonaut f0b970496e vertex format changes
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-03-17 14:41:16 -07:00
cosmonaut 4bba0f99f9 remove lineWidth from RasterizerState
continuous-integration/drone/push Build is passing Details
2022-03-14 10:43:01 -07:00
cosmonaut 3820d458fe remove Clear and add pWidth and pHeight to AcquireSwapchainTexture
continuous-integration/drone/push Build is passing Details
2022-03-10 10:21:49 -08:00
cosmonaut 7a0b0f5709 suboptimal on recreate is still technically fine
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-03-08 11:21:36 -08:00
cosmonaut ce34f4a435 fix deadlock on multi window swapchain resize
continuous-integration/drone/push Build is passing Details
2022-03-08 10:47:07 -08:00
cosmonaut 0380a96817 Swapchain resize fixes (#18)
continuous-integration/drone/push Build is passing Details
Fixes various errors related to the swapchain being recreated.

Additionally, `BeginRenderPass` now allows a NULL `renderArea` parameter. If NULL, Refresh will select a sensible default render area.
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
2022-03-07 06:31:39 +00:00
cosmonaut 715ca591f6 fix compute pipeline create bug
continuous-integration/drone/push Build is passing Details
2022-03-04 13:37:45 -08:00
cosmonaut 2731d47419 rename viewport and scissor set functions
continuous-integration/drone/push Build is passing Details
2022-03-04 12:47:36 -08:00
cosmonaut 0fbf1b2546 fix erroneous stack free
continuous-integration/drone/push Build is passing Details
2022-03-04 12:36:02 -08:00
cosmonaut f6b96fe34b viewport and scissor ABI break
continuous-integration/drone/push Build is failing Details
2022-03-04 12:30:33 -08:00
cosmonaut 6302603b08 add some missing frees
continuous-integration/drone/push Build is passing Details
2022-03-03 17:30:26 -08:00
cosmonaut 5fe4c8dbf3 remove command buffer from QueueDestroy calls
continuous-integration/drone/push Build is passing Details
2022-03-03 17:07:07 -08:00
cosmonaut 057a48e96f separate shader types
continuous-integration/drone/push Build is passing Details
2022-03-02 11:22:52 -08:00
cosmonaut 61e83cfba8 D3D compatibility ABI break
continuous-integration/drone/push Build is passing Details
2022-03-02 11:10:28 -08:00
cosmonaut e4ea104a88 remove swapchain log spam
continuous-integration/drone/push Build is passing Details
2022-03-02 10:27:03 -08:00
cosmonaut 83c2372499 only mark swapchain as needing recreate if it exists
continuous-integration/drone/push Build is passing Details
2022-03-02 10:02:07 -08:00
cosmonaut cb99489b3c Rework Presentation Flow (#15)
continuous-integration/drone/push Build is passing Details
Removes `Refresh_RenderTarget`, `Refresh_CreateRenderTarget` and `Refresh_QueueDestroyRenderTarget`. Render targets are now managed by the implementation.

Adds `REFRESH_TEXTUREFORMAT_B8G8R8A8`.

Adds `Refresh_AcquireSwapchainTexture`. Returns a swapchain texture for the requested window.

Removes `Refresh_QueuePresent`. It is now assumed that the texture returned by `Refresh_AcquireSwapchainTexture` will be presented. This texture can be manipulated like any other texture.

Adds `Refresh_GetSwapchainFormat`. Returns the swapchain format for the requested window.

Reviewed-on: #15
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
2022-03-02 06:33:57 +00:00
cosmonaut d22bed8b76 transition entire images + rework swapchain image management
continuous-integration/drone/push Build is passing Details
2022-02-28 12:02:39 -08:00
cosmonaut 436b990d45 Fix intro message formatting
continuous-integration/drone/push Build is passing Details
2022-02-25 23:13:17 -08:00
cosmonaut a26d3e3689 move color blend state to AttachmentInfo
continuous-integration/drone/push Build is passing Details
2022-02-25 17:37:42 -08:00
cosmonaut a38a9d461d fix right alignment spacing
continuous-integration/drone/push Build is passing Details
2022-02-25 13:51:29 -08:00
cosmonaut 517399f5d9 convert all spaces to tabs
continuous-integration/drone/push Build is passing Details
2022-02-25 13:42:11 -08:00
cosmonaut 5187093ddc reset command buffers on the thread they were spawned
continuous-integration/drone/push Build is passing Details
2022-02-24 22:06:00 -08:00
cosmonaut 336468cc31 fix some invalid accesses
continuous-integration/drone/push Build is passing Details
2022-02-24 21:29:52 -08:00
cosmonaut a531fb8593 Render Pass API Streamlining (#14)
continuous-integration/drone/push Build is passing Details
Removes `Refresh_RenderPass` and `Refresh_Framebuffer` objects.

`Refresh_BeginRenderPass` now takes a set of `Refresh_ColorAttachmentInfo` structs and an optional `Refresh_DepthStencilAttachmentInfo` struct that describe the render pass. The render pass and framebuffer objects are now managed by the implementation instead of the application.

Accordingly, `Refresh_GraphicsPipelineCreateInfo` now takes a `Refresh_GraphicsPipelineAttachmentInfo` struct that describes render passes that may be used with the pipeline. It is an error to bind a pipeline during an incompatible render pass.

Reviewed-on: #14
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
2022-02-24 22:01:37 +00:00
cosmonaut a3aea0f796 Reset fence as late as possible
continuous-integration/drone/push Build is passing Details
2022-02-22 21:54:32 -08:00
cosmonaut 0319c26f6a Submission rewrite (#13)
continuous-integration/drone/push Build is passing Details
Rework submission flow to reduce waiting and improve the resource cleanup process.

This patch also gets rid of descriptor set caching.
Co-authored-by: cosmonaut <evan@moonside.games>
Co-committed-by: cosmonaut <evan@moonside.games>
2022-02-23 00:49:45 +00:00
cosmonaut b54b7cc42d fix separate swapchain synchronization
continuous-integration/drone/push Build is passing Details
2022-02-09 21:42:19 -08:00
cosmonaut 829356d927 Revise swapchain management + remove external
continuous-integration/drone/push Build is passing Details
2022-02-08 17:16:11 -08:00