mirror of https://github.com/RPCS3/rpcs3.git
d3d12: Fix some warnings
This commit is contained in:
parent
17e169e652
commit
41577b5018
|
@ -83,6 +83,9 @@ DXGI_FORMAT getFormat(u8 type, u8 size)
|
|||
return typeX3[type];
|
||||
case 4:
|
||||
return typeX4[type];
|
||||
default:
|
||||
LOG_ERROR(RSX, "Wrong size for vertex attrib : %d", size);
|
||||
return DXGI_FORMAT();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,10 +226,10 @@ ID3D12Resource *createVertexBuffer(const VertexBufferFormat &vbf, const RSXVerte
|
|||
memcpy(bufferMap, vertexData[attributeId].data.data(), vertexData[attributeId].data.size());
|
||||
continue;
|
||||
}
|
||||
size_t baseOffset = vertexData[attributeId].addr - vbf.range.first;
|
||||
size_t baseOffset = (size_t)vertexData[attributeId].addr - vbf.range.first;
|
||||
size_t tsize = vertexData[attributeId].GetTypeSize();
|
||||
size_t size = vertexData[attributeId].size;
|
||||
auto src = vm::get_ptr<const u8>(vertexData[attributeId].addr + vbf.stride * vertex);
|
||||
auto src = vm::get_ptr<const u8>(vertexData[attributeId].addr + (int)vbf.stride * vertex);
|
||||
char* dst = (char*)bufferMap + baseOffset + vbf.stride * vertex;
|
||||
|
||||
switch (tsize)
|
||||
|
|
|
@ -1221,7 +1221,7 @@ void D3D12GSRender::semaphorePFIFOAcquire(u32 offset, u32 value)
|
|||
u32 val = vm::read32(m_label_addr + offset);
|
||||
if (val == value) break;
|
||||
std::chrono::time_point<std::chrono::system_clock> waitPoint = std::chrono::system_clock::now();
|
||||
int elapsedTime = std::chrono::duration_cast<std::chrono::seconds>(waitPoint - enterWait).count();
|
||||
long long elapsedTime = std::chrono::duration_cast<std::chrono::seconds>(waitPoint - enterWait).count();
|
||||
if (elapsedTime > 0)
|
||||
LOG_ERROR(RSX, "Has wait for more than a second for semaphore acquire");
|
||||
std::this_thread::yield();
|
||||
|
|
|
@ -335,8 +335,8 @@ ID3D12Resource *uploadSingleTexture(
|
|||
src = (u32*)pixels;
|
||||
dst = (u32*)textureData;
|
||||
|
||||
log2width = (u32)(logf(w) / logf(2.f));
|
||||
log2height = (u32)(logf(h) / logf(2.f));
|
||||
log2width = (u32)(logf((float)w) / logf(2.f));
|
||||
log2height = (u32)(logf((float)h) / logf(2.f));
|
||||
|
||||
#pragma omp parallel for
|
||||
for (int j = 0; j < w; j++)
|
||||
|
@ -364,8 +364,14 @@ ID3D12Resource *uploadSingleTexture(
|
|||
|
||||
for (int j = 0; j < w * 4; j++)
|
||||
{
|
||||
uint64_t tmp = src[row * w * 4 + j];
|
||||
unsigned short tmp = src[row * w * 4 + j];
|
||||
dst[row * w * 4 + j] = (tmp >> 8) | (tmp << 8);
|
||||
tmp = src[row * w * 4 + j + 1];
|
||||
dst[row * w * 4 + j + 1] = (tmp >> 8) | (tmp << 8);
|
||||
tmp = src[row * w * 4 + j + 2];
|
||||
dst[row * w * 4 + j + 2] = (tmp >> 8) | (tmp << 8);
|
||||
tmp = src[row * w * 4 + j + 3];
|
||||
dst[row * w * 4 + j + 3] = (tmp >> 8) | (tmp << 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -378,8 +384,8 @@ ID3D12Resource *uploadSingleTexture(
|
|||
}
|
||||
Texture->Unmap(0, nullptr);
|
||||
|
||||
size_t powerOf2Height = log2(heightInBlocks) + 1;
|
||||
textureSize = rowPitch * (1 << powerOf2Height);
|
||||
size_t powerOf2Height = (size_t)log2f((float)heightInBlocks) + 1;
|
||||
textureSize = rowPitch * (1i64 << powerOf2Height);
|
||||
|
||||
assert(textureHeap.canAlloc(textureSize));
|
||||
size_t heapOffset2 = textureHeap.alloc(textureSize);
|
||||
|
@ -400,8 +406,8 @@ ID3D12Resource *uploadSingleTexture(
|
|||
src.pResource = Texture;
|
||||
src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
|
||||
src.PlacedFootprint.Footprint.Depth = 1;
|
||||
src.PlacedFootprint.Footprint.Width = w;
|
||||
src.PlacedFootprint.Footprint.Height = h;
|
||||
src.PlacedFootprint.Footprint.Width = (UINT)w;
|
||||
src.PlacedFootprint.Footprint.Height = (UINT)h;
|
||||
src.PlacedFootprint.Footprint.RowPitch = (UINT)rowPitch;
|
||||
src.PlacedFootprint.Footprint.Format = dxgiFormat;
|
||||
|
||||
|
|
Loading…
Reference in New Issue