mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[d3d9] Compress hazard state going into CS
This can potentially happen per-draw so make it as small as possible.
This commit is contained in:
parent
3625c5d481
commit
c768196251
@ -5592,18 +5592,24 @@ namespace dxvk {
|
||||
|
||||
|
||||
void D3D9DeviceEx::MarkRenderHazards() {
|
||||
struct {
|
||||
uint8_t RT : 1;
|
||||
uint8_t DS : 1;
|
||||
} hazardState;
|
||||
hazardState.RT = m_activeHazardsRT != 0;
|
||||
hazardState.DS = m_activeHazardsDS != 0;
|
||||
|
||||
EmitCs([
|
||||
cActiveHazardsRT = m_activeHazardsRT,
|
||||
cActiveHazardsDS = m_activeHazardsDS
|
||||
cHazardState = hazardState
|
||||
](DxvkContext* ctx) {
|
||||
VkPipelineStageFlags srcStages = 0;
|
||||
VkAccessFlags srcAccess = 0;
|
||||
|
||||
if (cActiveHazardsRT != 0) {
|
||||
if (cHazardState.RT != 0) {
|
||||
srcStages |= VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
srcAccess |= VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
}
|
||||
if (cActiveHazardsDS != 0) {
|
||||
if (cHazardState.DS != 0) {
|
||||
srcStages |= VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
|
||||
srcAccess |= VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user