mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 16:08:50 +01:00
[dxvk] Make pre-rasterization state usable with lookup tables
This commit is contained in:
parent
0a15146746
commit
97ab6a313b
@ -472,6 +472,53 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool DxvkGraphicsPipelinePreRasterizationState::eq(const DxvkGraphicsPipelinePreRasterizationState& other) const {
|
||||
bool eq = tsInfo.patchControlPoints == other.tsInfo.patchControlPoints;
|
||||
|
||||
if (eq) {
|
||||
eq = rsInfo.depthClampEnable == other.rsInfo.depthClampEnable
|
||||
&& rsInfo.rasterizerDiscardEnable == other.rsInfo.rasterizerDiscardEnable
|
||||
&& rsInfo.polygonMode == other.rsInfo.polygonMode
|
||||
&& rsInfo.depthBiasEnable == other.rsInfo.depthBiasEnable
|
||||
&& rsInfo.lineWidth == other.rsInfo.lineWidth;
|
||||
}
|
||||
|
||||
if (eq)
|
||||
eq = rsXfbStreamInfo.rasterizationStream == other.rsXfbStreamInfo.rasterizationStream;
|
||||
|
||||
if (eq)
|
||||
eq = rsDepthClipInfo.depthClipEnable == other.rsDepthClipInfo.depthClipEnable;
|
||||
|
||||
if (eq) {
|
||||
eq = rsConservativeInfo.conservativeRasterizationMode == other.rsConservativeInfo.conservativeRasterizationMode
|
||||
&& rsConservativeInfo.extraPrimitiveOverestimationSize == other.rsConservativeInfo.extraPrimitiveOverestimationSize;
|
||||
}
|
||||
|
||||
return eq;
|
||||
}
|
||||
|
||||
|
||||
size_t DxvkGraphicsPipelinePreRasterizationState::hash() const {
|
||||
DxvkHashState hash;
|
||||
hash.add(tsInfo.patchControlPoints);
|
||||
|
||||
hash.add(rsInfo.depthClampEnable);
|
||||
hash.add(rsInfo.rasterizerDiscardEnable);
|
||||
hash.add(rsInfo.polygonMode);
|
||||
hash.add(rsInfo.depthBiasEnable);
|
||||
hash.add(bit::cast<uint32_t>(rsInfo.lineWidth));
|
||||
|
||||
hash.add(rsXfbStreamInfo.rasterizationStream);
|
||||
|
||||
hash.add(rsDepthClipInfo.depthClipEnable);
|
||||
|
||||
hash.add(rsConservativeInfo.conservativeRasterizationMode);
|
||||
hash.add(bit::cast<uint32_t>(rsConservativeInfo.extraPrimitiveOverestimationSize));
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
DxvkGraphicsPipelineFragmentShaderState::DxvkGraphicsPipelineFragmentShaderState() {
|
||||
|
||||
}
|
||||
|
@ -159,6 +159,10 @@ namespace dxvk {
|
||||
VkPipelineRasterizationDepthClipStateCreateInfoEXT rsDepthClipInfo = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT };
|
||||
VkPipelineRasterizationStateStreamCreateInfoEXT rsXfbStreamInfo = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT };
|
||||
VkPipelineRasterizationConservativeStateCreateInfoEXT rsConservativeInfo = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT };
|
||||
|
||||
bool eq(const DxvkGraphicsPipelinePreRasterizationState& other) const;
|
||||
|
||||
size_t hash() const;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user