1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxvk] Move compute pipeline state to dxvk_graphics_state.h

This commit is contained in:
Philip Rebohle 2019-10-07 13:16:00 +02:00
parent e086db5ce5
commit 782b021690
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 33 additions and 49 deletions

View File

@ -9,34 +9,6 @@
namespace dxvk {
DxvkComputePipelineStateInfo::DxvkComputePipelineStateInfo() {
std::memset(this, 0, sizeof(*this));
}
DxvkComputePipelineStateInfo::DxvkComputePipelineStateInfo(
const DxvkComputePipelineStateInfo& other) {
std::memcpy(this, &other, sizeof(*this));
}
DxvkComputePipelineStateInfo& DxvkComputePipelineStateInfo::operator = (
const DxvkComputePipelineStateInfo& other) {
std::memcpy(this, &other, sizeof(*this));
return *this;
}
bool DxvkComputePipelineStateInfo::operator == (const DxvkComputePipelineStateInfo& other) const {
return std::memcmp(this, &other, sizeof(DxvkComputePipelineStateInfo)) == 0;
}
bool DxvkComputePipelineStateInfo::operator != (const DxvkComputePipelineStateInfo& other) const {
return std::memcmp(this, &other, sizeof(DxvkComputePipelineStateInfo)) != 0;
}
DxvkComputePipeline::DxvkComputePipeline(
DxvkPipelineManager* pipeMgr,
DxvkComputePipelineShaders shaders)
@ -126,7 +98,7 @@ namespace dxvk {
specData.set(i, state.bsBindingMask.test(i), true);
for (uint32_t i = 0; i < MaxNumSpecConstants; i++)
specData.set(getSpecId(i), state.scSpecConstants[i], 0u);
specData.set(getSpecId(i), state.sc.specConstants[i], 0u);
VkSpecializationInfo specInfo = specData.getSpecInfo();

View File

@ -4,6 +4,7 @@
#include <vector>
#include "dxvk_bind_mask.h"
#include "dxvk_graphics_state.h"
#include "dxvk_pipecache.h"
#include "dxvk_pipelayout.h"
#include "dxvk_resource.h"
@ -31,25 +32,6 @@ namespace dxvk {
};
/**
* \brief Compute pipeline state info
*/
struct DxvkComputePipelineStateInfo {
DxvkComputePipelineStateInfo();
DxvkComputePipelineStateInfo(
const DxvkComputePipelineStateInfo& other);
DxvkComputePipelineStateInfo& operator = (
const DxvkComputePipelineStateInfo& other);
bool operator == (const DxvkComputePipelineStateInfo& other) const;
bool operator != (const DxvkComputePipelineStateInfo& other) const;
DxvkBindingMask bsBindingMask;
uint32_t scSpecConstants[MaxNumSpecConstants];
};
/**
* \brief Compute pipeline instance
*/

View File

@ -2351,7 +2351,7 @@ namespace dxvk {
uint32_t value) {
auto& specConst = pipeline == VK_PIPELINE_BIND_POINT_GRAPHICS
? m_state.gp.state.sc.specConstants[index]
: m_state.cp.state.scSpecConstants[index];
: m_state.cp.state.sc.specConstants[index];
if (specConst != value) {
specConst = value;

View File

@ -690,4 +690,34 @@ namespace dxvk {
DxvkIlBinding ilBindings [DxvkLimits::MaxNumVertexBindings];
};
/**
* \brief Compute pipeline state info
*/
struct alignas(32) DxvkComputePipelineStateInfo {
DxvkComputePipelineStateInfo() {
std::memset(this, 0, sizeof(*this));
}
DxvkComputePipelineStateInfo(const DxvkComputePipelineStateInfo& other) {
std::memcpy(this, &other, sizeof(*this));
}
DxvkComputePipelineStateInfo& operator = (const DxvkComputePipelineStateInfo& other) {
std::memcpy(this, &other, sizeof(*this));
return *this;
}
bool operator == (const DxvkComputePipelineStateInfo& other) const {
return !std::memcmp(this, &other, sizeof(*this));
}
bool operator != (const DxvkComputePipelineStateInfo& other) const {
return std::memcmp(this, &other, sizeof(*this));
}
DxvkBindingMask bsBindingMask;
DxvkScInfo sc;
};
}