mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxvk] Refactoring of most constant state objects
This commit is contained in:
parent
796c200e32
commit
385c92db5a
@ -14,12 +14,16 @@ namespace dxvk {
|
|||||||
m_context->beginRecording(
|
m_context->beginRecording(
|
||||||
m_device->createCommandList());
|
m_device->createCommandList());
|
||||||
|
|
||||||
m_defaultRsState = new DxvkRasterizerState(
|
m_defaultRsState.enableDepthClamp = VK_FALSE;
|
||||||
VK_FALSE, VK_FALSE,
|
m_defaultRsState.enableDiscard = VK_FALSE;
|
||||||
VK_POLYGON_MODE_FILL,
|
m_defaultRsState.polygonMode = VK_POLYGON_MODE_FILL;
|
||||||
VK_CULL_MODE_BACK_BIT,
|
m_defaultRsState.cullMode = VK_CULL_MODE_BACK_BIT;
|
||||||
VK_FRONT_FACE_CLOCKWISE,
|
m_defaultRsState.frontFace = VK_FRONT_FACE_CLOCKWISE;
|
||||||
VK_FALSE, 0.0f, 0.0f, 0.0f, 1.0f);
|
m_defaultRsState.depthBiasEnable = VK_FALSE;
|
||||||
|
m_defaultRsState.depthBiasConstant = 0.0f;
|
||||||
|
m_defaultRsState.depthBiasClamp = 0.0f;
|
||||||
|
m_defaultRsState.depthBiasSlope = 0.0f;
|
||||||
|
m_context->setRasterizerState(m_defaultRsState);
|
||||||
|
|
||||||
VkStencilOpState stencilOp;
|
VkStencilOpState stencilOp;
|
||||||
stencilOp.failOp = VK_STENCIL_OP_KEEP;
|
stencilOp.failOp = VK_STENCIL_OP_KEEP;
|
||||||
@ -30,20 +34,26 @@ namespace dxvk {
|
|||||||
stencilOp.writeMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
|
stencilOp.writeMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
|
||||||
stencilOp.reference = 0;
|
stencilOp.reference = 0;
|
||||||
|
|
||||||
m_defaultDsState = new DxvkDepthStencilState(
|
m_defaultDsState.enableDepthTest = VK_TRUE;
|
||||||
VK_TRUE, VK_TRUE, VK_FALSE, VK_FALSE,
|
m_defaultDsState.enableDepthWrite = VK_TRUE;
|
||||||
VK_COMPARE_OP_LESS, stencilOp, stencilOp,
|
m_defaultDsState.enableDepthBounds = VK_FALSE;
|
||||||
0.0f, 1.0f);
|
m_defaultDsState.enableStencilTest = VK_FALSE;
|
||||||
|
m_defaultDsState.depthCompareOp = VK_COMPARE_OP_LESS;
|
||||||
|
m_defaultDsState.stencilOpFront = stencilOp;
|
||||||
|
m_defaultDsState.stencilOpBack = stencilOp;
|
||||||
|
m_defaultDsState.depthBoundsMin = 0.0f;
|
||||||
|
m_defaultDsState.depthBoundsMax = 1.0f;
|
||||||
|
m_context->setDepthStencilState(m_defaultDsState);
|
||||||
|
|
||||||
m_defaultMsState = new DxvkMultisampleState(
|
m_defaultMsState.enableAlphaToCoverage = VK_FALSE;
|
||||||
VK_SAMPLE_COUNT_1_BIT, 0xFFFFFFFFu,
|
m_defaultMsState.enableAlphaToOne = VK_FALSE;
|
||||||
VK_FALSE, VK_FALSE, VK_FALSE, 0.0f);
|
m_defaultMsState.enableSampleShading = VK_FALSE;
|
||||||
|
m_defaultMsState.minSampleShading = 0.0f;
|
||||||
|
m_context->setMultisampleState(m_defaultMsState);
|
||||||
|
|
||||||
m_defaultCbState = new DxvkBlendState(
|
m_defaultCbState = new DxvkBlendState(
|
||||||
VK_FALSE, VK_LOGIC_OP_CLEAR, 0, nullptr);
|
VK_FALSE, VK_LOGIC_OP_CLEAR, 0, nullptr);
|
||||||
|
|
||||||
m_context->setRasterizerState(m_defaultRsState);
|
|
||||||
m_context->setMultisampleState(m_defaultMsState);
|
|
||||||
m_context->setDepthStencilState(m_defaultDsState);
|
m_context->setDepthStencilState(m_defaultDsState);
|
||||||
m_context->setBlendState(m_defaultCbState);
|
m_context->setBlendState(m_defaultCbState);
|
||||||
}
|
}
|
||||||
@ -464,64 +474,55 @@ namespace dxvk {
|
|||||||
if (m_state.ia.primitiveTopology != Topology) {
|
if (m_state.ia.primitiveTopology != Topology) {
|
||||||
m_state.ia.primitiveTopology = Topology;
|
m_state.ia.primitiveTopology = Topology;
|
||||||
|
|
||||||
Rc<DxvkInputAssemblyState> iaState;
|
DxvkInputAssemblyState iaState;
|
||||||
|
|
||||||
switch (Topology) {
|
switch (Topology) {
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED:
|
case D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED:
|
||||||
break;
|
return;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_POINTLIST:
|
case D3D11_PRIMITIVE_TOPOLOGY_POINTLIST:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
|
||||||
VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_LINELIST:
|
case D3D11_PRIMITIVE_TOPOLOGY_LINELIST:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
|
||||||
VK_PRIMITIVE_TOPOLOGY_LINE_LIST,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP:
|
case D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
|
||||||
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP,
|
iaState.primitiveRestart = VK_TRUE;
|
||||||
VK_TRUE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST:
|
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP:
|
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
iaState.primitiveRestart = VK_TRUE;
|
||||||
VK_TRUE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ:
|
case D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY;
|
||||||
VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ:
|
case D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY;
|
||||||
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY,
|
iaState.primitiveRestart = VK_TRUE;
|
||||||
VK_TRUE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ:
|
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY;
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ:
|
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ:
|
||||||
iaState = new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY;
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY,
|
iaState.primitiveRestart = VK_TRUE;
|
||||||
VK_TRUE);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -544,12 +544,12 @@ namespace dxvk {
|
|||||||
const D3D11_DEVICE_CONTEXT_TYPE m_type = D3D11_DEVICE_CONTEXT_IMMEDIATE;
|
const D3D11_DEVICE_CONTEXT_TYPE m_type = D3D11_DEVICE_CONTEXT_IMMEDIATE;
|
||||||
const UINT m_flags = 0;
|
const UINT m_flags = 0;
|
||||||
|
|
||||||
Rc<DxvkDevice> m_device;
|
Rc<DxvkDevice> m_device;
|
||||||
Rc<DxvkContext> m_context;
|
Rc<DxvkContext> m_context;
|
||||||
|
|
||||||
Rc<DxvkRasterizerState> m_defaultRsState;
|
DxvkRasterizerState m_defaultRsState;
|
||||||
Rc<DxvkDepthStencilState> m_defaultDsState;
|
DxvkDepthStencilState m_defaultDsState;
|
||||||
Rc<DxvkMultisampleState> m_defaultMsState;
|
DxvkMultisampleState m_defaultMsState;
|
||||||
Rc<DxvkBlendState> m_defaultCbState;
|
Rc<DxvkBlendState> m_defaultCbState;
|
||||||
|
|
||||||
D3D11ContextState m_state;
|
D3D11ContextState m_state;
|
||||||
|
@ -8,13 +8,17 @@ namespace dxvk {
|
|||||||
const D3D11_RASTERIZER_DESC& desc)
|
const D3D11_RASTERIZER_DESC& desc)
|
||||||
: m_device(device), m_desc(desc) {
|
: m_device(device), m_desc(desc) {
|
||||||
|
|
||||||
|
// State that is not supported in D3D11
|
||||||
|
m_state.enableDepthClamp = VK_FALSE;
|
||||||
|
m_state.enableDiscard = VK_FALSE;
|
||||||
|
|
||||||
// Polygon mode. Determines whether the rasterizer fills
|
// Polygon mode. Determines whether the rasterizer fills
|
||||||
// a polygon or renders lines connecting the vertices.
|
// a polygon or renders lines connecting the vertices.
|
||||||
VkPolygonMode polygonMode = VK_POLYGON_MODE_FILL;
|
m_state.polygonMode = VK_POLYGON_MODE_FILL;
|
||||||
|
|
||||||
switch (desc.FillMode) {
|
switch (desc.FillMode) {
|
||||||
case D3D11_FILL_WIREFRAME: polygonMode = VK_POLYGON_MODE_LINE; break;
|
case D3D11_FILL_WIREFRAME: m_state.polygonMode = VK_POLYGON_MODE_LINE; break;
|
||||||
case D3D11_FILL_SOLID: polygonMode = VK_POLYGON_MODE_FILL; break;
|
case D3D11_FILL_SOLID: m_state.polygonMode = VK_POLYGON_MODE_FILL; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Logger::err(str::format(
|
Logger::err(str::format(
|
||||||
@ -25,12 +29,12 @@ namespace dxvk {
|
|||||||
// Face culling properties. The rasterizer may discard
|
// Face culling properties. The rasterizer may discard
|
||||||
// polygons that are facing towards or away from the
|
// polygons that are facing towards or away from the
|
||||||
// viewer, depending on the options below.
|
// viewer, depending on the options below.
|
||||||
VkCullModeFlags cullMode = 0;
|
m_state.cullMode = VK_CULL_MODE_NONE;
|
||||||
|
|
||||||
switch (desc.CullMode) {
|
switch (desc.CullMode) {
|
||||||
case D3D11_CULL_NONE: cullMode = 0; break;
|
case D3D11_CULL_NONE: m_state.cullMode = VK_CULL_MODE_NONE; break;
|
||||||
case D3D11_CULL_FRONT: cullMode = VK_CULL_MODE_FRONT_BIT; break;
|
case D3D11_CULL_FRONT: m_state.cullMode = VK_CULL_MODE_FRONT_BIT; break;
|
||||||
case D3D11_CULL_BACK: cullMode = VK_CULL_MODE_BACK_BIT; break;
|
case D3D11_CULL_BACK: m_state.cullMode = VK_CULL_MODE_BACK_BIT; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Logger::err(str::format(
|
Logger::err(str::format(
|
||||||
@ -38,25 +42,23 @@ namespace dxvk {
|
|||||||
desc.CullMode));
|
desc.CullMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
VkFrontFace frontFace = desc.FrontCounterClockwise
|
m_state.frontFace = desc.FrontCounterClockwise
|
||||||
? VK_FRONT_FACE_COUNTER_CLOCKWISE
|
? VK_FRONT_FACE_COUNTER_CLOCKWISE
|
||||||
: VK_FRONT_FACE_CLOCKWISE;
|
: VK_FRONT_FACE_CLOCKWISE;
|
||||||
|
|
||||||
// TODO implement depth bias
|
// Let's treat the depth bias as enabled by default
|
||||||
if (desc.DepthBias != 0)
|
m_state.depthBiasEnable = VK_TRUE;
|
||||||
Logger::err("D3D11RasterizerState: Depth bias not supported");
|
m_state.depthBiasConstant = static_cast<float>(desc.DepthBias);
|
||||||
|
m_state.depthBiasClamp = desc.DepthBiasClamp;
|
||||||
|
m_state.depthBiasSlope = desc.SlopeScaledDepthBias;
|
||||||
|
|
||||||
// TODO implement depth clamp
|
// TODO implement depth clamp. Note that there are differences
|
||||||
|
// between D3D11 depth clip (disabled) and Vulkan depth clamp.
|
||||||
if (!desc.DepthClipEnable)
|
if (!desc.DepthClipEnable)
|
||||||
Logger::err("D3D11RasterizerState: Depth clip not supported");
|
Logger::err("D3D11RasterizerState: Depth clamp not supported");
|
||||||
|
|
||||||
if (desc.AntialiasedLineEnable)
|
if (desc.AntialiasedLineEnable)
|
||||||
Logger::err("D3D11RasterizerState: Antialiased lines not supported");
|
Logger::err("D3D11RasterizerState: Antialiased lines not supported");
|
||||||
|
|
||||||
m_state = new DxvkRasterizerState(
|
|
||||||
VK_FALSE, VK_FALSE,
|
|
||||||
polygonMode, cullMode, frontFace,
|
|
||||||
VK_FALSE, 0.0f, 0.0f, 0.0f, 1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace dxvk {
|
|||||||
void GetDesc(
|
void GetDesc(
|
||||||
D3D11_RASTERIZER_DESC* pDesc) final;
|
D3D11_RASTERIZER_DESC* pDesc) final;
|
||||||
|
|
||||||
Rc<DxvkRasterizerState> GetDXVKRasterizerState() {
|
const DxvkRasterizerState& GetDXVKRasterizerState() const {
|
||||||
return m_state;
|
return m_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
D3D11Device* const m_device;
|
D3D11Device* const m_device;
|
||||||
D3D11_RASTERIZER_DESC m_desc;
|
D3D11_RASTERIZER_DESC m_desc;
|
||||||
Rc<DxvkRasterizerState> m_state;
|
DxvkRasterizerState m_state;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,27 +55,33 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Set up context state. The shader bindings and the
|
// Set up context state. The shader bindings and the
|
||||||
// constant state objects will never be modified.
|
// constant state objects will never be modified.
|
||||||
m_context->setInputAssemblyState(
|
DxvkInputAssemblyState iaState;
|
||||||
new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE));
|
m_context->setInputAssemblyState(iaState);
|
||||||
|
|
||||||
m_context->setInputLayout(
|
m_context->setInputLayout(
|
||||||
new DxvkInputLayout(
|
new DxvkInputLayout(
|
||||||
0, nullptr, 0, nullptr));
|
0, nullptr, 0, nullptr));
|
||||||
|
|
||||||
m_context->setRasterizerState(
|
DxvkRasterizerState rsState;
|
||||||
new DxvkRasterizerState(
|
rsState.enableDepthClamp = VK_FALSE;
|
||||||
VK_FALSE, VK_FALSE,
|
rsState.enableDiscard = VK_FALSE;
|
||||||
VK_POLYGON_MODE_FILL,
|
rsState.polygonMode = VK_POLYGON_MODE_FILL;
|
||||||
VK_CULL_MODE_NONE,
|
rsState.cullMode = VK_CULL_MODE_BACK_BIT;
|
||||||
VK_FRONT_FACE_COUNTER_CLOCKWISE,
|
rsState.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
||||||
VK_FALSE, 0.0f, 0.0f, 0.0f, 1.0f));
|
rsState.depthBiasEnable = VK_FALSE;
|
||||||
|
rsState.depthBiasConstant = 0.0f;
|
||||||
|
rsState.depthBiasClamp = 0.0f;
|
||||||
|
rsState.depthBiasSlope = 0.0f;
|
||||||
|
m_context->setRasterizerState(rsState);
|
||||||
|
|
||||||
m_context->setMultisampleState(
|
DxvkMultisampleState msState;
|
||||||
new DxvkMultisampleState(
|
msState.enableAlphaToCoverage = VK_FALSE;
|
||||||
VK_SAMPLE_COUNT_1_BIT, 0xFFFFFFFF,
|
msState.enableAlphaToOne = VK_FALSE;
|
||||||
VK_FALSE, VK_FALSE, VK_FALSE, 0.0f));
|
msState.enableSampleShading = VK_FALSE;
|
||||||
|
msState.minSampleShading = 0.0f;
|
||||||
|
m_context->setMultisampleState(msState);
|
||||||
|
|
||||||
VkStencilOpState stencilOp;
|
VkStencilOpState stencilOp;
|
||||||
stencilOp.failOp = VK_STENCIL_OP_KEEP;
|
stencilOp.failOp = VK_STENCIL_OP_KEEP;
|
||||||
@ -86,11 +92,16 @@ namespace dxvk {
|
|||||||
stencilOp.writeMask = 0xFFFFFFFF;
|
stencilOp.writeMask = 0xFFFFFFFF;
|
||||||
stencilOp.reference = 0;
|
stencilOp.reference = 0;
|
||||||
|
|
||||||
m_context->setDepthStencilState(
|
DxvkDepthStencilState dsState;
|
||||||
new DxvkDepthStencilState(
|
dsState.enableDepthTest = VK_FALSE;
|
||||||
VK_FALSE, VK_FALSE, VK_FALSE, VK_FALSE,
|
dsState.enableDepthWrite = VK_FALSE;
|
||||||
VK_COMPARE_OP_ALWAYS, stencilOp, stencilOp,
|
dsState.enableDepthBounds = VK_FALSE;
|
||||||
0.0f, 1.0f));
|
dsState.enableStencilTest = VK_FALSE;
|
||||||
|
dsState.depthCompareOp = VK_COMPARE_OP_ALWAYS;
|
||||||
|
dsState.stencilOpFront = stencilOp;
|
||||||
|
dsState.stencilOpBack = stencilOp;
|
||||||
|
dsState.depthBoundsMin = 0.0f;
|
||||||
|
dsState.depthBoundsMax = 1.0f;
|
||||||
|
|
||||||
VkPipelineColorBlendAttachmentState blendAttachment;
|
VkPipelineColorBlendAttachmentState blendAttachment;
|
||||||
blendAttachment.blendEnable = VK_FALSE;
|
blendAttachment.blendEnable = VK_FALSE;
|
||||||
|
@ -4,90 +4,6 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkInputAssemblyState::DxvkInputAssemblyState(
|
|
||||||
VkPrimitiveTopology primitiveTopology,
|
|
||||||
VkBool32 primitiveRestart) {
|
|
||||||
m_info.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
|
||||||
m_info.pNext = nullptr;
|
|
||||||
m_info.flags = 0;
|
|
||||||
m_info.topology = primitiveTopology;
|
|
||||||
m_info.primitiveRestartEnable = primitiveRestart;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DxvkRasterizerState::DxvkRasterizerState(
|
|
||||||
VkBool32 enableDepthClamp,
|
|
||||||
VkBool32 enableDiscard,
|
|
||||||
VkPolygonMode polygonMode,
|
|
||||||
VkCullModeFlags cullMode,
|
|
||||||
VkFrontFace frontFace,
|
|
||||||
VkBool32 depthBiasEnable,
|
|
||||||
float depthBiasConstant,
|
|
||||||
float depthBiasClamp,
|
|
||||||
float depthBiasSlope,
|
|
||||||
float lineWidth) {
|
|
||||||
m_info.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
|
||||||
m_info.pNext = nullptr;
|
|
||||||
m_info.flags = 0;
|
|
||||||
m_info.depthClampEnable = enableDepthClamp;
|
|
||||||
m_info.rasterizerDiscardEnable= enableDiscard;
|
|
||||||
m_info.polygonMode = polygonMode;
|
|
||||||
m_info.cullMode = cullMode;
|
|
||||||
m_info.frontFace = frontFace;
|
|
||||||
m_info.depthBiasEnable = depthBiasEnable;
|
|
||||||
m_info.depthBiasConstantFactor= depthBiasConstant;
|
|
||||||
m_info.depthBiasClamp = depthBiasClamp;
|
|
||||||
m_info.depthBiasSlopeFactor = depthBiasSlope;
|
|
||||||
m_info.lineWidth = lineWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DxvkMultisampleState::DxvkMultisampleState(
|
|
||||||
VkSampleCountFlagBits sampleCount,
|
|
||||||
uint32_t sampleMask,
|
|
||||||
VkBool32 enableAlphaToCoverage,
|
|
||||||
VkBool32 enableAlphaToOne,
|
|
||||||
VkBool32 enableSampleShading,
|
|
||||||
float minSampleShading) {
|
|
||||||
m_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
|
|
||||||
m_info.pNext = nullptr;
|
|
||||||
m_info.flags = 0;
|
|
||||||
m_info.rasterizationSamples = sampleCount;
|
|
||||||
m_info.sampleShadingEnable = enableSampleShading;
|
|
||||||
m_info.minSampleShading = minSampleShading;
|
|
||||||
m_info.pSampleMask = &m_mask;
|
|
||||||
m_info.alphaToCoverageEnable = enableAlphaToCoverage;
|
|
||||||
m_info.alphaToOneEnable = enableAlphaToOne;
|
|
||||||
|
|
||||||
m_mask = sampleMask;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DxvkDepthStencilState::DxvkDepthStencilState(
|
|
||||||
VkBool32 enableDepthTest,
|
|
||||||
VkBool32 enableDepthWrite,
|
|
||||||
VkBool32 enableDepthBounds,
|
|
||||||
VkBool32 enableStencilTest,
|
|
||||||
VkCompareOp depthCompareOp,
|
|
||||||
VkStencilOpState stencilOpFront,
|
|
||||||
VkStencilOpState stencilOpBack,
|
|
||||||
float depthBoundsMin,
|
|
||||||
float depthBoundsMax) {
|
|
||||||
m_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
|
||||||
m_info.pNext = nullptr;
|
|
||||||
m_info.flags = 0;
|
|
||||||
m_info.depthTestEnable = enableDepthTest;
|
|
||||||
m_info.depthWriteEnable = enableDepthWrite;
|
|
||||||
m_info.depthCompareOp = depthCompareOp;
|
|
||||||
m_info.depthBoundsTestEnable = enableDepthBounds;
|
|
||||||
m_info.stencilTestEnable = enableStencilTest;
|
|
||||||
m_info.front = stencilOpFront;
|
|
||||||
m_info.back = stencilOpBack;
|
|
||||||
m_info.minDepthBounds = depthBoundsMin;
|
|
||||||
m_info.maxDepthBounds = depthBoundsMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DxvkBlendState::DxvkBlendState(
|
DxvkBlendState::DxvkBlendState(
|
||||||
VkBool32 enableLogicOp,
|
VkBool32 enableLogicOp,
|
||||||
VkLogicOp logicOp,
|
VkLogicOp logicOp,
|
||||||
|
@ -15,22 +15,9 @@ namespace dxvk {
|
|||||||
* whether or not primitive restart
|
* whether or not primitive restart
|
||||||
* is enabled.
|
* is enabled.
|
||||||
*/
|
*/
|
||||||
class DxvkInputAssemblyState : public RcObject {
|
struct DxvkInputAssemblyState {
|
||||||
|
VkPrimitiveTopology primitiveTopology;
|
||||||
public:
|
VkBool32 primitiveRestart;
|
||||||
|
|
||||||
DxvkInputAssemblyState(
|
|
||||||
VkPrimitiveTopology primitiveTopology,
|
|
||||||
VkBool32 primitiveRestart);
|
|
||||||
|
|
||||||
const VkPipelineInputAssemblyStateCreateInfo& info() const {
|
|
||||||
return m_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
VkPipelineInputAssemblyStateCreateInfo m_info;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -40,61 +27,30 @@ namespace dxvk {
|
|||||||
* Stores the operating mode of the
|
* Stores the operating mode of the
|
||||||
* rasterizer, including the depth bias.
|
* rasterizer, including the depth bias.
|
||||||
*/
|
*/
|
||||||
class DxvkRasterizerState : public RcObject {
|
struct DxvkRasterizerState {
|
||||||
|
VkBool32 enableDepthClamp;
|
||||||
public:
|
VkBool32 enableDiscard;
|
||||||
|
VkPolygonMode polygonMode;
|
||||||
DxvkRasterizerState(
|
VkCullModeFlags cullMode;
|
||||||
VkBool32 enableDepthClamp,
|
VkFrontFace frontFace;
|
||||||
VkBool32 enableDiscard,
|
VkBool32 depthBiasEnable;
|
||||||
VkPolygonMode polygonMode,
|
float depthBiasConstant;
|
||||||
VkCullModeFlags cullMode,
|
float depthBiasClamp;
|
||||||
VkFrontFace frontFace,
|
float depthBiasSlope;
|
||||||
VkBool32 depthBiasEnable,
|
|
||||||
float depthBiasConstant,
|
|
||||||
float depthBiasClamp,
|
|
||||||
float depthBiasSlope,
|
|
||||||
float lineWidth);
|
|
||||||
|
|
||||||
const VkPipelineRasterizationStateCreateInfo& info() const {
|
|
||||||
return m_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
VkPipelineRasterizationStateCreateInfo m_info;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Multisample state
|
* \brief Multisample state
|
||||||
*
|
*
|
||||||
* Defines details on how to handle
|
* Defines how to handle certain
|
||||||
* multisampling, including the alpha
|
* aspects of multisampling.
|
||||||
* coverage mode.
|
|
||||||
*/
|
*/
|
||||||
class DxvkMultisampleState : public RcObject {
|
struct DxvkMultisampleState {
|
||||||
|
VkBool32 enableAlphaToCoverage;
|
||||||
public:
|
VkBool32 enableAlphaToOne;
|
||||||
|
VkBool32 enableSampleShading;
|
||||||
DxvkMultisampleState(
|
float minSampleShading;
|
||||||
VkSampleCountFlagBits sampleCount,
|
|
||||||
uint32_t sampleMask,
|
|
||||||
VkBool32 enableAlphaToCoverage,
|
|
||||||
VkBool32 enableAlphaToOne,
|
|
||||||
VkBool32 enableSampleShading,
|
|
||||||
float minSampleShading);
|
|
||||||
|
|
||||||
const VkPipelineMultisampleStateCreateInfo& info() const {
|
|
||||||
return m_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
VkPipelineMultisampleStateCreateInfo m_info;
|
|
||||||
uint32_t m_mask;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -104,29 +60,16 @@ namespace dxvk {
|
|||||||
* Defines the depth test and stencil
|
* Defines the depth test and stencil
|
||||||
* operations for the graphics pipeline.
|
* operations for the graphics pipeline.
|
||||||
*/
|
*/
|
||||||
class DxvkDepthStencilState : public RcObject {
|
struct DxvkDepthStencilState {
|
||||||
|
VkBool32 enableDepthTest;
|
||||||
public:
|
VkBool32 enableDepthWrite;
|
||||||
|
VkBool32 enableDepthBounds;
|
||||||
DxvkDepthStencilState(
|
VkBool32 enableStencilTest;
|
||||||
VkBool32 enableDepthTest,
|
VkCompareOp depthCompareOp;
|
||||||
VkBool32 enableDepthWrite,
|
VkStencilOpState stencilOpFront;
|
||||||
VkBool32 enableDepthBounds,
|
VkStencilOpState stencilOpBack;
|
||||||
VkBool32 enableStencilTest,
|
float depthBoundsMin;
|
||||||
VkCompareOp depthCompareOp,
|
float depthBoundsMax;
|
||||||
VkStencilOpState stencilOpFront,
|
|
||||||
VkStencilOpState stencilOpBack,
|
|
||||||
float depthBoundsMin,
|
|
||||||
float depthBoundsMax);
|
|
||||||
|
|
||||||
const VkPipelineDepthStencilStateCreateInfo& info() const {
|
|
||||||
return m_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
VkPipelineDepthStencilStateCreateInfo m_info;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -200,11 +143,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
struct DxvkConstantStateObjects {
|
struct DxvkConstantStateObjects {
|
||||||
Rc<DxvkInputAssemblyState> inputAssemblyState;
|
|
||||||
Rc<DxvkInputLayout> inputLayout;
|
Rc<DxvkInputLayout> inputLayout;
|
||||||
Rc<DxvkRasterizerState> rasterizerState;
|
|
||||||
Rc<DxvkMultisampleState> multisampleState;
|
|
||||||
Rc<DxvkDepthStencilState> depthStencilState;
|
|
||||||
Rc<DxvkBlendState> blendState;
|
Rc<DxvkBlendState> blendState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkContext::DxvkContext(const Rc<DxvkDevice>& device)
|
DxvkContext::DxvkContext(const Rc<DxvkDevice>& device)
|
||||||
: m_device(device) {
|
: m_device(device) {
|
||||||
Logger::info(str::format(sizeof(DxvkGraphicsPipelineStateInfo)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -382,11 +382,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxvkContext::setInputAssemblyState(
|
void DxvkContext::setInputAssemblyState(
|
||||||
const Rc<DxvkInputAssemblyState>& state) {
|
const DxvkInputAssemblyState& state) {
|
||||||
if (m_state.co.inputAssemblyState != state) {
|
m_state.ia = state;
|
||||||
m_state.co.inputAssemblyState = state;
|
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
||||||
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -400,29 +398,23 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxvkContext::setRasterizerState(
|
void DxvkContext::setRasterizerState(
|
||||||
const Rc<DxvkRasterizerState>& state) {
|
const DxvkRasterizerState& state) {
|
||||||
if (m_state.co.rasterizerState != state) {
|
m_state.rs = state;
|
||||||
m_state.co.rasterizerState = state;
|
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
||||||
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::setMultisampleState(
|
void DxvkContext::setMultisampleState(
|
||||||
const Rc<DxvkMultisampleState>& state) {
|
const DxvkMultisampleState& state) {
|
||||||
if (m_state.co.multisampleState != state) {
|
m_state.ms = state;
|
||||||
m_state.co.multisampleState = state;
|
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
||||||
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::setDepthStencilState(
|
void DxvkContext::setDepthStencilState(
|
||||||
const Rc<DxvkDepthStencilState>& state) {
|
const DxvkDepthStencilState& state) {
|
||||||
if (m_state.co.depthStencilState != state) {
|
m_state.ds = state;
|
||||||
m_state.co.depthStencilState = state;
|
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
||||||
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -506,9 +498,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkGraphicsPipelineStateInfo gpState;
|
DxvkGraphicsPipelineStateInfo gpState;
|
||||||
|
|
||||||
const auto& ia = m_state.co.inputAssemblyState->info();
|
gpState.iaPrimitiveTopology = m_state.ia.primitiveTopology;
|
||||||
gpState.iaPrimitiveTopology = ia.topology;
|
gpState.iaPrimitiveRestart = m_state.ia.primitiveRestart;
|
||||||
gpState.iaPrimitiveRestart = ia.primitiveRestartEnable;
|
|
||||||
|
|
||||||
const auto& il = m_state.co.inputLayout->info();
|
const auto& il = m_state.co.inputLayout->info();
|
||||||
gpState.ilAttributeCount = il.vertexAttributeDescriptionCount;
|
gpState.ilAttributeCount = il.vertexAttributeDescriptionCount;
|
||||||
@ -522,37 +513,34 @@ namespace dxvk {
|
|||||||
gpState.ilBindings[i].stride = m_state.vi.vertexStrides.at(i);
|
gpState.ilBindings[i].stride = m_state.vi.vertexStrides.at(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& rs = m_state.co.rasterizerState->info();
|
gpState.rsEnableDepthClamp = m_state.rs.enableDepthClamp;
|
||||||
gpState.rsEnableDepthClamp = rs.depthClampEnable;
|
gpState.rsEnableDiscard = m_state.rs.enableDiscard;
|
||||||
gpState.rsEnableDiscard = rs.rasterizerDiscardEnable;
|
gpState.rsPolygonMode = m_state.rs.polygonMode;
|
||||||
gpState.rsPolygonMode = rs.polygonMode;
|
gpState.rsCullMode = m_state.rs.cullMode;
|
||||||
gpState.rsCullMode = rs.cullMode;
|
gpState.rsFrontFace = m_state.rs.frontFace;
|
||||||
gpState.rsFrontFace = rs.frontFace;
|
gpState.rsDepthBiasEnable = m_state.rs.depthBiasEnable;
|
||||||
gpState.rsDepthBiasEnable = rs.depthBiasEnable;
|
gpState.rsDepthBiasConstant = m_state.rs.depthBiasConstant;
|
||||||
gpState.rsDepthBiasConstant = rs.depthBiasConstantFactor;
|
gpState.rsDepthBiasClamp = m_state.rs.depthBiasClamp;
|
||||||
gpState.rsDepthBiasClamp = rs.depthBiasClamp;
|
gpState.rsDepthBiasSlope = m_state.rs.depthBiasSlope;
|
||||||
gpState.rsDepthBiasSlope = rs.depthBiasSlopeFactor;
|
|
||||||
gpState.rsViewportCount = m_state.vp.viewportCount;
|
gpState.rsViewportCount = m_state.vp.viewportCount;
|
||||||
|
|
||||||
// TODO implement multisampling support properly
|
// TODO implement multisampling support properly
|
||||||
const auto& ms = m_state.co.multisampleState->info();
|
|
||||||
gpState.msSampleCount = VK_SAMPLE_COUNT_1_BIT;
|
gpState.msSampleCount = VK_SAMPLE_COUNT_1_BIT;
|
||||||
gpState.msSampleMask = *ms.pSampleMask;
|
gpState.msSampleMask = m_state.om.sampleMask;
|
||||||
gpState.msEnableAlphaToCoverage = ms.alphaToCoverageEnable;
|
gpState.msEnableAlphaToCoverage = m_state.ms.enableAlphaToCoverage;
|
||||||
gpState.msEnableAlphaToOne = ms.alphaToOneEnable;
|
gpState.msEnableAlphaToOne = m_state.ms.enableAlphaToOne;
|
||||||
gpState.msEnableSampleShading = ms.sampleShadingEnable;
|
gpState.msEnableSampleShading = m_state.ms.enableSampleShading;
|
||||||
gpState.msMinSampleShading = ms.minSampleShading;
|
gpState.msMinSampleShading = m_state.ms.minSampleShading;
|
||||||
|
|
||||||
const auto& ds = m_state.co.depthStencilState->info();
|
gpState.dsEnableDepthTest = m_state.ds.enableDepthTest;
|
||||||
gpState.dsEnableDepthTest = ds.depthTestEnable;
|
gpState.dsEnableDepthWrite = m_state.ds.enableDepthWrite;
|
||||||
gpState.dsEnableDepthWrite = ds.depthWriteEnable;
|
gpState.dsEnableDepthBounds = m_state.ds.enableDepthBounds;
|
||||||
gpState.dsEnableDepthBounds = ds.depthBoundsTestEnable;
|
gpState.dsEnableStencilTest = m_state.ds.enableStencilTest;
|
||||||
gpState.dsEnableStencilTest = ds.stencilTestEnable;
|
gpState.dsDepthCompareOp = m_state.ds.depthCompareOp;
|
||||||
gpState.dsDepthCompareOp = ds.depthCompareOp;
|
gpState.dsStencilOpFront = m_state.ds.stencilOpFront;
|
||||||
gpState.dsStencilOpFront = ds.front;
|
gpState.dsStencilOpBack = m_state.ds.stencilOpBack;
|
||||||
gpState.dsStencilOpBack = ds.back;
|
gpState.dsDepthBoundsMin = m_state.ds.depthBoundsMin;
|
||||||
gpState.dsDepthBoundsMin = ds.minDepthBounds;
|
gpState.dsDepthBoundsMax = m_state.ds.depthBoundsMax;
|
||||||
gpState.dsDepthBoundsMax = ds.maxDepthBounds;
|
|
||||||
|
|
||||||
const auto& om = m_state.co.blendState->info();
|
const auto& om = m_state.co.blendState->info();
|
||||||
gpState.omEnableLogicOp = om.logicOpEnable;
|
gpState.omEnableLogicOp = om.logicOpEnable;
|
||||||
|
@ -267,7 +267,7 @@ namespace dxvk {
|
|||||||
* \param [in] state New state object
|
* \param [in] state New state object
|
||||||
*/
|
*/
|
||||||
void setInputAssemblyState(
|
void setInputAssemblyState(
|
||||||
const Rc<DxvkInputAssemblyState>& state);
|
const DxvkInputAssemblyState& state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets input layout state
|
* \brief Sets input layout state
|
||||||
@ -281,21 +281,21 @@ namespace dxvk {
|
|||||||
* \param [in] state New state object
|
* \param [in] state New state object
|
||||||
*/
|
*/
|
||||||
void setRasterizerState(
|
void setRasterizerState(
|
||||||
const Rc<DxvkRasterizerState>& state);
|
const DxvkRasterizerState& state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets multisample state
|
* \brief Sets multisample state
|
||||||
* \param [in] state New state object
|
* \param [in] state New state object
|
||||||
*/
|
*/
|
||||||
void setMultisampleState(
|
void setMultisampleState(
|
||||||
const Rc<DxvkMultisampleState>& state);
|
const DxvkMultisampleState& state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets depth stencil state
|
* \brief Sets depth stencil state
|
||||||
* \param [in] state New state object
|
* \param [in] state New state object
|
||||||
*/
|
*/
|
||||||
void setDepthStencilState(
|
void setDepthStencilState(
|
||||||
const Rc<DxvkDepthStencilState>& state);
|
const DxvkDepthStencilState& state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets color blend state
|
* \brief Sets color blend state
|
||||||
|
@ -55,6 +55,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
struct DxvkOutputMergerState {
|
struct DxvkOutputMergerState {
|
||||||
|
uint32_t sampleMask = 0xFFFFFFFFu;
|
||||||
Rc<DxvkFramebuffer> framebuffer;
|
Rc<DxvkFramebuffer> framebuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -88,6 +89,11 @@ namespace dxvk {
|
|||||||
* and constant pipeline state objects.
|
* and constant pipeline state objects.
|
||||||
*/
|
*/
|
||||||
struct DxvkContextState {
|
struct DxvkContextState {
|
||||||
|
DxvkInputAssemblyState ia;
|
||||||
|
DxvkRasterizerState rs;
|
||||||
|
DxvkMultisampleState ms;
|
||||||
|
DxvkDepthStencilState ds;
|
||||||
|
|
||||||
DxvkVertexInputState vi;
|
DxvkVertexInputState vi;
|
||||||
DxvkViewportState vp;
|
DxvkViewportState vp;
|
||||||
DxvkOutputMergerState om;
|
DxvkOutputMergerState om;
|
||||||
|
@ -82,31 +82,45 @@ public:
|
|||||||
})),
|
})),
|
||||||
m_dxvkContext (m_dxvkDevice->createContext()) {
|
m_dxvkContext (m_dxvkDevice->createContext()) {
|
||||||
|
|
||||||
m_dxvkContext->setInputAssemblyState(
|
DxvkInputAssemblyState iaState;
|
||||||
new DxvkInputAssemblyState(
|
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||||
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
|
iaState.primitiveRestart = VK_FALSE;
|
||||||
VK_FALSE));
|
m_dxvkContext->setInputAssemblyState(iaState);
|
||||||
|
|
||||||
m_dxvkContext->setInputLayout(
|
m_dxvkContext->setInputLayout(
|
||||||
new DxvkInputLayout(0, nullptr, 0, nullptr));
|
new DxvkInputLayout(0, nullptr, 0, nullptr));
|
||||||
m_dxvkContext->setRasterizerState(
|
|
||||||
new DxvkRasterizerState(
|
DxvkRasterizerState rsState;
|
||||||
VK_FALSE, VK_FALSE,
|
rsState.enableDepthClamp = VK_FALSE;
|
||||||
VK_POLYGON_MODE_FILL,
|
rsState.enableDiscard = VK_FALSE;
|
||||||
VK_CULL_MODE_NONE,
|
rsState.polygonMode = VK_POLYGON_MODE_FILL;
|
||||||
VK_FRONT_FACE_COUNTER_CLOCKWISE,
|
rsState.cullMode = VK_CULL_MODE_BACK_BIT;
|
||||||
VK_FALSE, 0.0f, 0.0f, 0.0f,
|
rsState.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
||||||
1.0f));
|
rsState.depthBiasEnable = VK_FALSE;
|
||||||
m_dxvkContext->setMultisampleState(
|
rsState.depthBiasConstant = 0.0f;
|
||||||
new DxvkMultisampleState(
|
rsState.depthBiasClamp = 0.0f;
|
||||||
VK_SAMPLE_COUNT_1_BIT, 0xFFFFFFFF,
|
rsState.depthBiasSlope = 0.0f;
|
||||||
VK_FALSE, VK_FALSE, VK_FALSE, 1.0f));
|
m_dxvkContext->setRasterizerState(rsState);
|
||||||
m_dxvkContext->setDepthStencilState(
|
|
||||||
new DxvkDepthStencilState(
|
DxvkMultisampleState msState;
|
||||||
VK_FALSE, VK_FALSE, VK_FALSE, VK_FALSE,
|
msState.enableAlphaToCoverage = VK_FALSE;
|
||||||
VK_COMPARE_OP_ALWAYS,
|
msState.enableAlphaToOne = VK_FALSE;
|
||||||
VkStencilOpState(),
|
msState.enableSampleShading = VK_FALSE;
|
||||||
VkStencilOpState(),
|
msState.minSampleShading = 0.0f;
|
||||||
0.0f, 1.0f));
|
m_dxvkContext->setMultisampleState(msState);
|
||||||
|
|
||||||
|
DxvkDepthStencilState dsState;
|
||||||
|
dsState.enableDepthTest = VK_FALSE;
|
||||||
|
dsState.enableDepthWrite = VK_FALSE;
|
||||||
|
dsState.enableDepthBounds = VK_FALSE;
|
||||||
|
dsState.enableStencilTest = VK_FALSE;
|
||||||
|
dsState.depthCompareOp = VK_COMPARE_OP_ALWAYS;
|
||||||
|
dsState.stencilOpFront = VkStencilOpState();
|
||||||
|
dsState.stencilOpBack = VkStencilOpState();
|
||||||
|
dsState.depthBoundsMin = 0.0f;
|
||||||
|
dsState.depthBoundsMax = 1.0f;
|
||||||
|
m_dxvkContext->setDepthStencilState(dsState);
|
||||||
|
|
||||||
m_dxvkContext->setBlendState(
|
m_dxvkContext->setBlendState(
|
||||||
new DxvkBlendState(
|
new DxvkBlendState(
|
||||||
VK_FALSE, VK_LOGIC_OP_COPY,
|
VK_FALSE, VK_LOGIC_OP_COPY,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user