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;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-12-08 00:44:58 +01:00
|
|
|
/**
|
|
|
|
* \brief Vertex attribute description
|
|
|
|
*
|
|
|
|
* Stores information about a
|
|
|
|
* single vertex attribute.
|
|
|
|
*/
|
|
|
|
struct DxvkVertexAttribute {
|
|
|
|
uint32_t location;
|
|
|
|
uint32_t binding;
|
|
|
|
VkFormat format;
|
|
|
|
uint32_t offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Vertex binding description
|
|
|
|
*
|
|
|
|
* Stores information about a
|
|
|
|
* single vertex binding slot.
|
|
|
|
*/
|
|
|
|
struct DxvkVertexBinding {
|
|
|
|
uint32_t binding;
|
|
|
|
VkVertexInputRate inputRate;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-20 13:21:27 +01:00
|
|
|
/**
|
|
|
|
* \brief Input layout
|
|
|
|
*
|
2017-12-08 00:44:58 +01:00
|
|
|
* Stores the description of all active
|
|
|
|
* vertex attributes and vertex bindings.
|
2017-11-20 13:21:27 +01:00
|
|
|
*/
|
2017-12-08 00:44:58 +01:00
|
|
|
struct DxvkInputLayout {
|
|
|
|
uint32_t numAttributes;
|
|
|
|
uint32_t numBindings;
|
2017-11-20 13:21:27 +01:00
|
|
|
|
2017-12-08 00:44:58 +01:00
|
|
|
std::array<DxvkVertexAttribute, DxvkLimits::MaxNumVertexAttributes> attributes;
|
|
|
|
std::array<DxvkVertexBinding, DxvkLimits::MaxNumVertexBindings> bindings;
|
2017-11-20 13:21:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DxvkConstantStateObjects {
|
|
|
|
Rc<DxvkBlendState> blendState;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|