mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-26 19:54:18 +01:00
[d3d11] Store map mode as raw integer
Fixes some annoying error with clang, hopefully.
This commit is contained in:
parent
12c2b2f81b
commit
4fb6403b8f
@ -625,7 +625,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// If the texture has an image as well as a staging buffer,
|
// If the texture has an image as well as a staging buffer,
|
||||||
// upload the written buffer data to the image
|
// upload the written buffer data to the image
|
||||||
bool needsUpload = mapType != D3D11_MAP_READ
|
bool needsUpload = mapType != uint32_t(D3D11_MAP_READ)
|
||||||
&& (mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER || mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DYNAMIC);
|
&& (mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_BUFFER || mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DYNAMIC);
|
||||||
|
|
||||||
if (needsUpload) {
|
if (needsUpload) {
|
||||||
|
@ -1452,10 +1452,10 @@ namespace dxvk {
|
|||||||
|| texture->CountSubresources() <= SrcSubresource)
|
|| texture->CountSubresources() <= SrcSubresource)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D3D11_MAP map = texture->GetMapType(SrcSubresource);
|
uint32_t map = texture->GetMapType(SrcSubresource);
|
||||||
|
|
||||||
if (map != D3D11_MAP_READ
|
if (map != uint32_t(D3D11_MAP_READ)
|
||||||
&& map != D3D11_MAP_READ_WRITE)
|
&& map != uint32_t(D3D11_MAP_READ_WRITE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CopySubresourceData(
|
CopySubresourceData(
|
||||||
@ -1481,11 +1481,11 @@ namespace dxvk {
|
|||||||
|| texture->CountSubresources() <= DstSubresource)
|
|| texture->CountSubresources() <= DstSubresource)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
D3D11_MAP map = texture->GetMapType(DstSubresource);
|
uint32_t map = texture->GetMapType(DstSubresource);
|
||||||
|
|
||||||
if (map != D3D11_MAP_WRITE
|
if (map != uint32_t(D3D11_MAP_WRITE)
|
||||||
&& map != D3D11_MAP_WRITE_NO_OVERWRITE
|
&& map != uint32_t(D3D11_MAP_WRITE_NO_OVERWRITE)
|
||||||
&& map != D3D11_MAP_READ_WRITE)
|
&& map != uint32_t(D3D11_MAP_READ_WRITE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CopySubresourceData(
|
CopySubresourceData(
|
||||||
|
@ -85,7 +85,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static constexpr D3D11_MAP UnmappedSubresource = D3D11_MAP(-1u);
|
static constexpr uint32_t UnmappedSubresource = ~0u;
|
||||||
|
|
||||||
D3D11CommonTexture(
|
D3D11CommonTexture(
|
||||||
ID3D11Resource* pInterface,
|
ID3D11Resource* pInterface,
|
||||||
@ -200,10 +200,10 @@ namespace dxvk {
|
|||||||
* \param [in] Subresource Subresource index
|
* \param [in] Subresource Subresource index
|
||||||
* \returns Current map mode of that subresource
|
* \returns Current map mode of that subresource
|
||||||
*/
|
*/
|
||||||
D3D11_MAP GetMapType(UINT Subresource) const {
|
uint32_t GetMapType(UINT Subresource) const {
|
||||||
return Subresource < m_mapInfo.size()
|
return Subresource < m_mapInfo.size()
|
||||||
? D3D11_MAP(m_mapInfo[Subresource].mapType)
|
? m_mapInfo[Subresource].mapType
|
||||||
: D3D11_MAP(~0u);
|
: UnmappedSubresource;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -216,7 +216,7 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
void NotifyMap(UINT Subresource, D3D11_MAP MapType) {
|
void NotifyMap(UINT Subresource, D3D11_MAP MapType) {
|
||||||
if (likely(Subresource < m_mapInfo.size())) {
|
if (likely(Subresource < m_mapInfo.size())) {
|
||||||
m_mapInfo[Subresource].mapType = MapType;
|
m_mapInfo[Subresource].mapType = uint32_t(MapType);
|
||||||
|
|
||||||
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DYNAMIC)
|
if (m_mapMode == D3D11_COMMON_TEXTURE_MAP_MODE_DYNAMIC)
|
||||||
CreateMappedBuffer(Subresource);
|
CreateMappedBuffer(Subresource);
|
||||||
@ -561,7 +561,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
struct MappedInfo {
|
struct MappedInfo {
|
||||||
D3D11_COMMON_TEXTURE_SUBRESOURCE_LAYOUT layout = { };
|
D3D11_COMMON_TEXTURE_SUBRESOURCE_LAYOUT layout = { };
|
||||||
D3D11_MAP mapType = UnmappedSubresource;
|
uint32_t mapType = UnmappedSubresource;
|
||||||
uint64_t seq = 0u;
|
uint64_t seq = 0u;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user