updates. fixes, set to not preserve some passes
This commit is contained in:
@@ -238,7 +238,7 @@ void RenderPath3D::ResizeBuffers()
|
||||
{
|
||||
RenderPassDesc desc;
|
||||
desc.numAttachments = 1;
|
||||
desc.attachments[0] = { RenderPassAttachment::DEPTH_STENCIL,RenderPassAttachment::LOADOP_LOAD,&smallDepth,-1 };
|
||||
desc.attachments[0] = { RenderPassAttachment::DEPTH_STENCIL,RenderPassAttachment::LOADOP_LOAD,&smallDepth,-1,RenderPassAttachment::STOREOP_DONTCARE };
|
||||
|
||||
device->CreateRenderPass(&desc, &renderpass_occlusionculling);
|
||||
}
|
||||
@@ -583,6 +583,9 @@ void RenderPath3D::RenderTransparents(const RenderPass& renderpass_transparent,
|
||||
fx.enableFullScreen();
|
||||
fx.enableHDR();
|
||||
|
||||
// Note set a stencilmode that always passes, because pipeline state with depthbuffer will be used in this render pass (shuts up warnings):
|
||||
fx.stencilComp = STENCILMODE_ALWAYS;
|
||||
|
||||
if (getEmittedParticlesEnabled())
|
||||
{
|
||||
device->EventBegin("Contribute Emitters", cmd);
|
||||
|
||||
@@ -123,7 +123,7 @@ void RenderPath3D_Deferred::ResizeBuffers()
|
||||
RenderPassDesc desc;
|
||||
desc.numAttachments = 2;
|
||||
desc.attachments[0] = { RenderPassAttachment::RENDERTARGET,RenderPassAttachment::LOADOP_LOAD,&rtDeferred,-1 };
|
||||
desc.attachments[1] = { RenderPassAttachment::DEPTH_STENCIL,RenderPassAttachment::LOADOP_LOAD,&depthBuffer,-1 };
|
||||
desc.attachments[1] = { RenderPassAttachment::DEPTH_STENCIL,RenderPassAttachment::LOADOP_LOAD,&depthBuffer,-1,RenderPassAttachment::STOREOP_DONTCARE };
|
||||
|
||||
device->CreateRenderPass(&desc, &renderpass_transparent);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void RenderPath3D_Forward::ResizeBuffers()
|
||||
RenderPassDesc desc;
|
||||
desc.numAttachments = 2;
|
||||
desc.attachments[0] = { RenderPassAttachment::RENDERTARGET,RenderPassAttachment::LOADOP_LOAD,&rtMain[0],-1 };
|
||||
desc.attachments[1] = { RenderPassAttachment::DEPTH_STENCIL,RenderPassAttachment::LOADOP_LOAD,&depthBuffer,-1 };
|
||||
desc.attachments[1] = { RenderPassAttachment::DEPTH_STENCIL,RenderPassAttachment::LOADOP_LOAD,&depthBuffer,-1,RenderPassAttachment::STOREOP_DONTCARE };
|
||||
|
||||
device->CreateRenderPass(&desc, &renderpass_transparent);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void wiEmittedParticle::CreateSelfBuffers()
|
||||
|
||||
// Indirect Execution buffer:
|
||||
bd.BindFlags = BIND_UNORDERED_ACCESS;
|
||||
bd.MiscFlags = RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS | RESOURCE_MISC_DRAWINDIRECT_ARGS;
|
||||
bd.MiscFlags = RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS | RESOURCE_MISC_INDIRECT_ARGS;
|
||||
bd.ByteWidth =
|
||||
sizeof(wiGraphics::IndirectDispatchArgs) +
|
||||
sizeof(wiGraphics::IndirectDispatchArgs) +
|
||||
@@ -648,6 +648,7 @@ void wiEmittedParticle::LoadShaders()
|
||||
desc.dss = &depthStencilState;
|
||||
desc.numRTs = 1;
|
||||
desc.RTFormats[0] = wiRenderer::RTFormat_hdr;
|
||||
desc.DSFormat = wiRenderer::DSFormat_full;
|
||||
|
||||
desc.ps = pixelShader[SOFT];
|
||||
device->CreatePipelineState(&desc, &PSO[i][SOFT]);
|
||||
@@ -666,6 +667,7 @@ void wiEmittedParticle::LoadShaders()
|
||||
desc.dss = &depthStencilState;
|
||||
desc.numRTs = 1;
|
||||
desc.RTFormats[0] = wiRenderer::RTFormat_hdr;
|
||||
desc.DSFormat = wiRenderer::DSFormat_full;
|
||||
|
||||
device->CreatePipelineState(&desc, &PSO_wire);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace wiGPUSortLib
|
||||
bd.Usage = USAGE_DEFAULT;
|
||||
bd.CPUAccessFlags = 0;
|
||||
bd.BindFlags = BIND_UNORDERED_ACCESS;
|
||||
bd.MiscFlags = RESOURCE_MISC_DRAWINDIRECT_ARGS | RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS;
|
||||
bd.MiscFlags = RESOURCE_MISC_INDIRECT_ARGS | RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS;
|
||||
bd.ByteWidth = sizeof(IndirectDispatchArgs);
|
||||
wiRenderer::GetDevice()->CreateBuffer(&bd, nullptr, &indirectBuffer);
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ namespace wiGraphics
|
||||
{
|
||||
RESOURCE_MISC_SHARED = 0x2L,
|
||||
RESOURCE_MISC_TEXTURECUBE = 0x4L,
|
||||
RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L,
|
||||
RESOURCE_MISC_INDIRECT_ARGS = 0x10L,
|
||||
RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L,
|
||||
RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L,
|
||||
RESOURCE_MISC_TILED = 0x40000L,
|
||||
|
||||
@@ -58,7 +58,7 @@ inline UINT _ParseResourceMiscFlags(UINT value)
|
||||
_flag |= D3D11_RESOURCE_MISC_SHARED;
|
||||
if (value & RESOURCE_MISC_TEXTURECUBE)
|
||||
_flag |= D3D11_RESOURCE_MISC_TEXTURECUBE;
|
||||
if (value & RESOURCE_MISC_DRAWINDIRECT_ARGS)
|
||||
if (value & RESOURCE_MISC_INDIRECT_ARGS)
|
||||
_flag |= D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS;
|
||||
if (value & RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS)
|
||||
_flag |= D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS;
|
||||
@@ -781,7 +781,7 @@ inline UINT _ParseResourceMiscFlags_Inv(UINT value)
|
||||
if (value & D3D11_RESOURCE_MISC_TEXTURECUBE)
|
||||
_flag |= RESOURCE_MISC_TEXTURECUBE;
|
||||
if (value & D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS)
|
||||
_flag |= RESOURCE_MISC_DRAWINDIRECT_ARGS;
|
||||
_flag |= RESOURCE_MISC_INDIRECT_ARGS;
|
||||
if (value & D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS)
|
||||
_flag |= RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS;
|
||||
if (value & D3D11_RESOURCE_MISC_BUFFER_STRUCTURED)
|
||||
|
||||
@@ -2206,6 +2206,10 @@ namespace wiGraphics
|
||||
bufferInfo.usage |= VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT;
|
||||
}
|
||||
}
|
||||
if (pBuffer->desc.MiscFlags & RESOURCE_MISC_INDIRECT_ARGS)
|
||||
{
|
||||
bufferInfo.usage |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
|
||||
}
|
||||
bufferInfo.usage |= VK_BUFFER_USAGE_TRANSFER_DST_BIT;
|
||||
|
||||
bufferInfo.flags = 0;
|
||||
@@ -2531,10 +2535,6 @@ namespace wiGraphics
|
||||
barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
|
||||
barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
||||
|
||||
// transfer queue-ownership from copy to graphics:
|
||||
barrier.srcQueueFamilyIndex = queueIndices.copyFamily;
|
||||
barrier.dstQueueFamilyIndex = queueIndices.graphicsFamily;
|
||||
|
||||
loadedimagetransitions.push_back(barrier);
|
||||
|
||||
}
|
||||
|
||||
@@ -388,6 +388,10 @@ namespace wiImage
|
||||
dsd.FrontFace.StencilFunc = COMPARISON_NOT_EQUAL;
|
||||
dsd.BackFace.StencilFunc = COMPARISON_NOT_EQUAL;
|
||||
device->CreateDepthStencilState(&dsd, &depthStencilStates[STENCILMODE_NOT][i]);
|
||||
|
||||
dsd.FrontFace.StencilFunc = COMPARISON_ALWAYS;
|
||||
dsd.BackFace.StencilFunc = COMPARISON_ALWAYS;
|
||||
device->CreateDepthStencilState(&dsd, &depthStencilStates[STENCILMODE_ALWAYS][i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ enum STENCILMODE
|
||||
STENCILMODE_GREATER,
|
||||
STENCILMODE_GREATEREQUAL,
|
||||
STENCILMODE_NOT,
|
||||
STENCILMODE_ALWAYS,
|
||||
STENCILMODE_COUNT
|
||||
};
|
||||
enum STENCILREFMODE
|
||||
|
||||
@@ -453,6 +453,7 @@ void wiImageParams_BindLua::Bind()
|
||||
wiLua::GetGlobal()->RunText("STENCILMODE_GREATER = 4");
|
||||
wiLua::GetGlobal()->RunText("STENCILMODE_GREATEREQUAL = 5");
|
||||
wiLua::GetGlobal()->RunText("STENCILMODE_NOT = 6");
|
||||
wiLua::GetGlobal()->RunText("STENCILMODE_ALWAYS = 7");
|
||||
|
||||
wiLua::GetGlobal()->RunText("STENCILREFMODE_ENGINE = 0");
|
||||
wiLua::GetGlobal()->RunText("STENCILREFMODE_USER = 1");
|
||||
|
||||
@@ -7611,7 +7611,7 @@ void RayTraceScene(
|
||||
desc.ByteWidth = desc.StructureByteStride;
|
||||
desc.CPUAccessFlags = 0;
|
||||
desc.Format = FORMAT_UNKNOWN;
|
||||
desc.MiscFlags = RESOURCE_MISC_DRAWINDIRECT_ARGS | RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS;
|
||||
desc.MiscFlags = RESOURCE_MISC_INDIRECT_ARGS | RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS;
|
||||
desc.Usage = USAGE_DEFAULT;
|
||||
hr = device->CreateBuffer(&desc, nullptr, &indirectBuffer);
|
||||
assert(SUCCEEDED(hr));
|
||||
|
||||
Reference in New Issue
Block a user