mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +01:00
[dxvk] Rename DxvkResourceAccessType to DxvkAccess
We'll be using this enum a lot more in the future.
This commit is contained in:
parent
a148233b13
commit
8f8340c2d1
@ -11,13 +11,12 @@ namespace dxvk {
|
||||
VkAccessFlags srcAccess,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess) {
|
||||
const DxvkResourceAccessTypes accessTypes
|
||||
= this->getAccessTypes(srcAccess);
|
||||
DxvkAccessFlags accessTypes = this->getAccessTypes(srcAccess);
|
||||
|
||||
m_srcStages |= srcStages;
|
||||
m_dstStages |= dstStages;
|
||||
|
||||
if (accessTypes.test(DxvkResourceAccessType::Write)) {
|
||||
if (accessTypes.test(DxvkAccess::Write)) {
|
||||
VkBufferMemoryBarrier barrier;
|
||||
barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
|
||||
barrier.pNext = nullptr;
|
||||
@ -42,13 +41,12 @@ namespace dxvk {
|
||||
VkImageLayout dstLayout,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess) {
|
||||
const DxvkResourceAccessTypes accessTypes
|
||||
= this->getAccessTypes(srcAccess);
|
||||
DxvkAccessFlags accessTypes = this->getAccessTypes(srcAccess);
|
||||
|
||||
m_srcStages |= srcStages;
|
||||
m_dstStages |= dstStages;
|
||||
|
||||
if ((srcLayout != dstLayout) || accessTypes.test(DxvkResourceAccessType::Write)) {
|
||||
if ((srcLayout != dstLayout) || accessTypes.test(DxvkAccess::Write)) {
|
||||
VkImageMemoryBarrier barrier;
|
||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||
barrier.pNext = nullptr;
|
||||
@ -95,7 +93,7 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
DxvkResourceAccessTypes DxvkBarrierSet::getAccessTypes(VkAccessFlags flags) const {
|
||||
DxvkAccessFlags DxvkBarrierSet::getAccessTypes(VkAccessFlags flags) const {
|
||||
const VkAccessFlags rflags
|
||||
= VK_ACCESS_INDIRECT_COMMAND_READ_BIT
|
||||
| VK_ACCESS_INDEX_READ_BIT
|
||||
@ -117,9 +115,9 @@ namespace dxvk {
|
||||
| VK_ACCESS_HOST_WRITE_BIT
|
||||
| VK_ACCESS_MEMORY_WRITE_BIT;
|
||||
|
||||
DxvkResourceAccessTypes result;
|
||||
if (flags & rflags) result.set(DxvkResourceAccessType::Read);
|
||||
if (flags & wflags) result.set(DxvkResourceAccessType::Write);
|
||||
DxvkAccessFlags result;
|
||||
if (flags & rflags) result.set(DxvkAccess::Read);
|
||||
if (flags & wflags) result.set(DxvkAccess::Write);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace dxvk {
|
||||
std::vector<VkBufferMemoryBarrier> m_bufBarriers;
|
||||
std::vector<VkImageMemoryBarrier> m_imgBarriers;
|
||||
|
||||
DxvkResourceAccessTypes getAccessTypes(VkAccessFlags flags) const;
|
||||
DxvkAccessFlags getAccessTypes(VkAccessFlags flags) const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
enum class DxvkResourceAccessType {
|
||||
enum class DxvkAccess {
|
||||
Read = 0,
|
||||
Write = 1,
|
||||
};
|
||||
|
||||
using DxvkResourceAccessTypes = Flags<DxvkResourceAccessType>;
|
||||
using DxvkAccessFlags = Flags<DxvkAccess>;
|
||||
|
||||
/**
|
||||
* \brief DXVK resource
|
||||
|
Loading…
Reference in New Issue
Block a user