-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a68e42
commit a3558e4
Showing
7 changed files
with
116 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//// | ||
- Copyright (c) 2023, Mobica Limited | ||
- | ||
- SPDX-License-Identifier: Apache-2.0 | ||
- | ||
- Licensed under the Apache License, Version 2.0 the "License"; | ||
- you may not use this file except in compliance with the License. | ||
- You may obtain a copy of the License at | ||
- | ||
- http://www.apache.org/licenses/LICENSE-2.0 | ||
- | ||
- Unless required by applicable law or agreed to in writing, software | ||
- distributed under the License is distributed on an "AS IS" BASIS, | ||
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
- See the License for the specific language governing permissions and | ||
- limitations under the License. | ||
- | ||
//// | ||
== Dynamic blending | ||
|
||
=== Overview | ||
|
||
This sample demonstrates the functionality of VK_EXT_extended_dynamic_state3 related to blending. It includes the | ||
following features: | ||
|
||
* `+vkCmdSetColorBlendEnableEXT+`: toggles blendingon and off. | ||
* `+vkCmdSetColorBlendEquationEXT+`: modifies blending operators and factors. | ||
* `+vkCmdSetColorBlendAdvancedEXT+`: utilizes more complex blending operators. | ||
* `+vkCmdSetColorWriteMaskEXT+`: toggles individual channels on and off. | ||
|
||
=== How to use in Vulkan | ||
|
||
To utilize this feature, the device extension `+VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME+` need to be enabled. | ||
The extension `+VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME+` is required for the advanced blend equations. | ||
All presented functions take an array of objects defining their action for subsequent color attachments: | ||
|
||
* The `+vkCmdSetColorBlendEnableEXT+` | ||
function expects an array of booleans to toggle blending. | ||
* The `+vkCmdSetColorBlendEquationEXT+` function expects an array of | ||
`+VkColorBlendEquationEXT+` objects which determine operators and factors for | ||
color and alpha blending. | ||
* The `+vkCmdSetColorBlendAdvancedEXT+` function expects an array of `+VkColorBlendAdvancedEXT+` objects, which determine | ||
blending operators and premultiplication for color blending. | ||
* The `+vkCmdSetColorWriteMaskEXT+` function expects an array of | ||
`+VkColorComponentFlags+` objects. These objects can be created by combining | ||
the desired color bit flags using bitwise oring. | ||
|
||
=== The sample | ||
|
||
The sample demonstrates how to set up an application to work with this | ||
extension: | ||
|
||
* Enabling the extension. | ||
* Setting parameters for the presented methods. | ||
|
||
The sample demonstrates how the use of each operator affects color blending. | ||
|
||
=== Documentation links | ||
|
||
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendEnableEXT.html | ||
|
||
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendEquationEXT.html | ||
|
||
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendAdvancedEXT.html | ||
|
||
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorWriteMaskEXT.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters