2017-11-20 13:21:27 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dxvk_buffer.h"
|
|
|
|
#include "dxvk_framebuffer.h"
|
|
|
|
#include "dxvk_limits.h"
|
|
|
|
#include "dxvk_resource.h"
|
|
|
|
#include "dxvk_shader.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Input assembly state
|
|
|
|
*
|
|
|
|
* Stores the primitive topology and
|
|
|
|
* whether or not primitive restart
|
|
|
|
* is enabled.
|
|
|
|
*/
|
2017-12-08 00:02:43 +01:00
|
|
|
struct DxvkInputAssemblyState {
|
|
|
|
VkPrimitiveTopology primitiveTopology;
|
|
|
|
VkBool32 primitiveRestart;
|
2017-11-20 13:21:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Rasterizer state
|
|
|
|
*
|
|
|
|
* Stores the operating mode of the
|
|
|
|
* rasterizer, including the depth bias.
|
|
|
|
*/
|
2017-12-08 00:02:43 +01:00
|
|
|
struct DxvkRasterizerState {
|
|
|
|
VkBool32 enableDepthClamp;
|
|
|
|
VkBool32 enableDiscard;
|
|
|
|
VkPolygonMode polygonMode;
|
|
|
|
VkCullModeFlags cullMode;
|
|
|
|
VkFrontFace frontFace;
|
|
|
|
VkBool32 depthBiasEnable;
|
|
|
|
float depthBiasConstant;
|
|
|
|
float depthBiasClamp;
|
|
|
|
float depthBiasSlope;
|
2017-11-20 13:21:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Multisample state
|
|
|
|
*
|
2017-12-08 00:02:43 +01:00
|
|
|
* Defines how to handle certain
|
|
|
|
* aspects of multisampling.
|
2017-11-20 13:21:27 +01:00
|
|
|
*/
|
2017-12-08 00:02:43 +01:00
|
|
|
struct DxvkMultisampleState {
|
|
|
|
VkBool32 enableAlphaToCoverage;
|
|
|
|
VkBool32 enableAlphaToOne;
|
|
|
|
VkBool32 enableSampleShading;
|
|
|
|
float minSampleShading;
|
2017-11-20 13:21:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Depth-stencil state
|
|
|
|
*
|
|
|
|
* Defines the depth test and stencil
|
|
|
|
* operations for the graphics pipeline.
|
|
|
|
*/
|
2017-12-08 00:02:43 +01:00
|
|
|
struct DxvkDepthStencilState {
|
|
|
|
VkBool32 enableDepthTest;
|
|
|
|
VkBool32 enableDepthWrite;
|
|
|
|
VkBool32 enableDepthBounds;
|
|
|
|
VkBool32 enableStencilTest;
|
|
|
|
VkCompareOp depthCompareOp;
|
|
|
|
VkStencilOpState stencilOpFront;
|
|
|
|
VkStencilOpState stencilOpBack;
|
|
|
|
float depthBoundsMin;
|
|
|
|
float depthBoundsMax;
|
2017-11-20 13:21:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Blend state
|
|
|
|
*
|
|
|
|
* Stores the color blend state for each
|
|
|
|
* available framebuffer attachment.
|
|
|
|
*/
|
|
|
|
class DxvkBlendState : public RcObject {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxvkBlendState(
|
|
|
|
VkBool32 enableLogicOp,
|
|
|
|
VkLogicOp logicOp,
|
|
|
|
uint32_t attachmentCount,
|
|
|
|
const VkPipelineColorBlendAttachmentState* attachmentState);
|
|
|
|
|
|
|
|
const VkPipelineColorBlendStateCreateInfo& info() const {
|
|
|
|
return m_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2017-11-20 15:35:29 +01:00
|
|
|
std::array<VkPipelineColorBlendAttachmentState,
|
|
|
|
DxvkLimits::MaxNumRenderTargets> m_attachments;
|
2017-11-20 13:21:27 +01:00
|
|
|
|
|
|
|
VkPipelineColorBlendStateCreateInfo m_info;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Input layout
|
|
|
|
*
|
|
|
|
* Stores the attributes and vertex buffer binding
|
|
|
|
* descriptions that the vertex shader will take
|
|
|
|
* its input values from.
|
|
|
|
*/
|
|
|
|
class DxvkInputLayout : public RcObject {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxvkInputLayout(
|
|
|
|
uint32_t attributeCount,
|
|
|
|
const VkVertexInputAttributeDescription* attributeInfo,
|
|
|
|
uint32_t bindingCount,
|
|
|
|
const VkVertexInputBindingDescription* bindingInfo);
|
|
|
|
|
2017-11-26 13:24:01 +01:00
|
|
|
uint32_t vertexAttributeCount() const {
|
|
|
|
return m_attributes.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t vertexBindingCount() const {
|
|
|
|
return m_bindings.size();
|
|
|
|
}
|
|
|
|
|
2017-11-20 13:21:27 +01:00
|
|
|
const VkPipelineVertexInputStateCreateInfo& info() const {
|
|
|
|
return m_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
std::vector<VkVertexInputAttributeDescription> m_attributes;
|
|
|
|
std::vector<VkVertexInputBindingDescription> m_bindings;
|
|
|
|
|
|
|
|
VkPipelineVertexInputStateCreateInfo m_info;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DxvkConstantStateObjects {
|
|
|
|
Rc<DxvkInputLayout> inputLayout;
|
|
|
|
Rc<DxvkBlendState> blendState;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|