1
0
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:
Philip Rebohle 2022-07-30 23:04:46 +02:00
parent 0a15146746
commit 97ab6a313b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 51 additions and 0 deletions

View File

@ -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() {
}

View File

@ -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;
};