mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 23:40:39 +00:00
Merge pull request #9458 from unknownbrackets/warnings
Correct some warnings, minor tweaks
This commit is contained in:
commit
1f0dfad4d7
@ -143,8 +143,8 @@ size_t VulkanDeviceAllocator::Allocate(const VkMemoryRequirements &reqs, VkDevic
|
||||
return ALLOCATE_FAILED;
|
||||
}
|
||||
|
||||
size_t align = reqs.alignment <= SLAB_GRAIN_SIZE ? 1 : (reqs.alignment >> SLAB_GRAIN_SHIFT);
|
||||
size_t blocks = (reqs.size + SLAB_GRAIN_SIZE - 1) >> SLAB_GRAIN_SHIFT;
|
||||
size_t align = reqs.alignment <= SLAB_GRAIN_SIZE ? 1 : (size_t)(reqs.alignment >> SLAB_GRAIN_SHIFT);
|
||||
size_t blocks = (size_t)((reqs.size + SLAB_GRAIN_SIZE - 1) >> SLAB_GRAIN_SHIFT);
|
||||
|
||||
const size_t numSlabs = slabs_.size();
|
||||
for (size_t i = 0; i < numSlabs; ++i) {
|
||||
@ -298,7 +298,7 @@ void VulkanDeviceAllocator::ExecuteFree(FreeInfo *userdata) {
|
||||
delete userdata;
|
||||
}
|
||||
|
||||
bool VulkanDeviceAllocator::AllocateSlab(size_t minBytes) {
|
||||
bool VulkanDeviceAllocator::AllocateSlab(VkDeviceSize minBytes) {
|
||||
assert(!destroyed_);
|
||||
if (!slabs_.empty() && minSlabSize_ < maxSlabSize_) {
|
||||
// We're allocating an additional slab, so rachet up its size.
|
||||
@ -325,7 +325,7 @@ bool VulkanDeviceAllocator::AllocateSlab(size_t minBytes) {
|
||||
slabs_.resize(slabs_.size() + 1);
|
||||
Slab &slab = slabs_[slabs_.size() - 1];
|
||||
slab.deviceMemory = deviceMemory;
|
||||
slab.usage.resize(alloc.allocationSize >> SLAB_GRAIN_SHIFT);
|
||||
slab.usage.resize((size_t)(alloc.allocationSize >> SLAB_GRAIN_SHIFT));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ private:
|
||||
freeInfo->allocator->ExecuteFree(freeInfo);
|
||||
}
|
||||
|
||||
bool AllocateSlab(size_t minBytes);
|
||||
bool AllocateSlab(VkDeviceSize minBytes);
|
||||
bool AllocateFromSlab(Slab &slab, size_t &start, size_t blocks);
|
||||
void Decimate();
|
||||
void ExecuteFree(FreeInfo *userdata);
|
||||
|
@ -469,10 +469,8 @@ static ConfigSetting graphicsSettings[] = {
|
||||
ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true),
|
||||
ConfigSetting("FrameRate", &g_Config.iFpsLimit, 0, true, true),
|
||||
ConfigSetting("FrameSkipUnthrottle", &g_Config.bFrameSkipUnthrottle, &DefaultFrameskipUnthrottle, true, false),
|
||||
#ifdef _WIN32
|
||||
#if defined(USING_WIN_UI)
|
||||
ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false),
|
||||
#endif
|
||||
#endif
|
||||
ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 60, true, true),
|
||||
|
||||
|
@ -160,7 +160,7 @@ size_t RamCachingFileLoader::ReadFromCache(s64 pos, size_t bytes, void *data) {
|
||||
|
||||
std::lock_guard<std::mutex> guard(blocksMutex_);
|
||||
for (s64 i = cacheStartPos; i <= cacheEndPos; ++i) {
|
||||
if (blocks_[i] == 0) {
|
||||
if (blocks_[(size_t)i] == 0) {
|
||||
return readSize;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ void RamCachingFileLoader::SaveIntoCache(s64 pos, size_t bytes, Flags flags) {
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(blocksMutex_);
|
||||
for (s64 i = cacheStartPos; i <= cacheEndPos; ++i) {
|
||||
if (blocks_[i] == 0) {
|
||||
if (blocks_[(size_t)i] == 0) {
|
||||
++blocksToRead;
|
||||
if (blocksToRead >= MAX_BLOCKS_PER_READ) {
|
||||
break;
|
||||
@ -208,8 +208,8 @@ void RamCachingFileLoader::SaveIntoCache(s64 pos, size_t bytes, Flags flags) {
|
||||
// In case they were simultaneously read.
|
||||
u32 blocksRead = 0;
|
||||
for (size_t i = 0; i < blocksActuallyRead; ++i) {
|
||||
if (blocks_[cacheStartPos + i] == 0) {
|
||||
blocks_[cacheStartPos + i] = 1;
|
||||
if (blocks_[(size_t)cacheStartPos + i] == 0) {
|
||||
blocks_[(size_t)cacheStartPos + i] = 1;
|
||||
++blocksRead;
|
||||
}
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ const HLEFunction *GetSyscallFuncPointer(MIPSOpcode op)
|
||||
ERROR_LOG(HLE, "Syscall had bad function number %d in module %d - probably executing garbage", funcnum, modulenum);
|
||||
return NULL;
|
||||
}
|
||||
INFO_LOG(HLE, "Compiling syscall to %s", moduleDB[modulenum].funcTable[funcnum].name);
|
||||
DEBUG_LOG(HLE, "Compiling syscall to %s", moduleDB[modulenum].funcTable[funcnum].name);
|
||||
return &moduleDB[modulenum].funcTable[funcnum];
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ static bool Memory_TryBase(u32 flags) {
|
||||
position, view.size, base + view.virtual_address);
|
||||
if (!*view.out_ptr) {
|
||||
goto bail;
|
||||
ERROR_LOG(MEMMAP, "Failed at view %d", i);
|
||||
DEBUG_LOG(MEMMAP, "Failed at view %d", i);
|
||||
}
|
||||
#else
|
||||
if (CanIgnoreView(view)) {
|
||||
@ -167,7 +167,7 @@ static bool Memory_TryBase(u32 flags) {
|
||||
*view.out_ptr = (u8*)g_arena.CreateView(
|
||||
position, view.size, base + (view.virtual_address & MEMVIEW32_MASK));
|
||||
if (!*view.out_ptr) {
|
||||
ERROR_LOG(MEMMAP, "Failed at view %d", i);
|
||||
DEBUG_LOG(MEMMAP, "Failed at view %d", i);
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ static const Builtin replacements[] = {
|
||||
static const char *cbufferDecl = R"(
|
||||
cbuffer data : register(b0) {
|
||||
float2 u_texelDelta;
|
||||
float2 u_pixelDelta;
|
||||
float2 u_pixelDelta;
|
||||
float4 u_time;
|
||||
};
|
||||
)";
|
||||
|
@ -1060,10 +1060,12 @@ bool FramebufferManagerD3D11::GetDepthStencilBuffer(VirtualFramebuffer *vfb, GPU
|
||||
Draw::Framebuffer *fboForRead = nullptr;
|
||||
fboForRead = vfb->fbo;
|
||||
|
||||
if (gstate_c.Supports(GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT)) {
|
||||
buffer.Allocate(w, h, GPU_DBG_FORMAT_FLOAT_DIV_256, !useBufferedRendering_);
|
||||
if (stencil) {
|
||||
buffer.Allocate(w, h, GPU_DBG_FORMAT_8BIT);
|
||||
} else if (gstate_c.Supports(GPU_SCALE_DEPTH_FROM_24BIT_TO_16BIT)) {
|
||||
buffer.Allocate(w, h, GPU_DBG_FORMAT_FLOAT_DIV_256);
|
||||
} else {
|
||||
buffer.Allocate(w, h, GPU_DBG_FORMAT_FLOAT, !useBufferedRendering_);
|
||||
buffer.Allocate(w, h, GPU_DBG_FORMAT_FLOAT);
|
||||
}
|
||||
|
||||
ID3D11Texture2D *packTex;
|
||||
@ -1087,10 +1089,11 @@ bool FramebufferManagerD3D11::GetDepthStencilBuffer(VirtualFramebuffer *vfb, GPU
|
||||
|
||||
for (int y = 0; y < h; y++) {
|
||||
float *dest = (float *)(buffer.GetData() + y * w * 4);
|
||||
u8 *destStencil = buffer.GetData() + y * w;
|
||||
const uint32_t *src = (const uint32_t *)((const uint8_t *)map.pData + map.RowPitch * y);
|
||||
for (int x = 0; x < w; x++) {
|
||||
if (stencil) {
|
||||
dest[x] = (src[x] >> 24) / (256.f);
|
||||
destStencil[x] = src[x] >> 24;
|
||||
} else {
|
||||
dest[x] = (src[x] & 0xFFFFFF) / (256.f * 256.f * 256.f);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ bool GenerateFragmentShaderHLSL(const ShaderID &id, char *buffer, ShaderLanguage
|
||||
|
||||
if (enableAlphaTest) {
|
||||
if (lang == HLSL_D3D11) {
|
||||
WRITE(p, "int roundAndScaleTo255i(float x) { return uint(floor(x * 255.0f + 0.5f)); }\n");
|
||||
WRITE(p, "int roundAndScaleTo255i(float x) { return int(floor(x * 255.0f + 0.5f)); }\n");
|
||||
} else {
|
||||
// D3D11 level 9 gets to take this path.
|
||||
WRITE(p, "float roundAndScaleTo255f(float x) { return floor(x * 255.0f + 0.5f); }\n");
|
||||
|
@ -301,7 +301,7 @@ EventReturn ReportScreen::HandleBrowser(EventParams &e) {
|
||||
}
|
||||
|
||||
ReportFinishScreen::ReportFinishScreen(const std::string &gamePath)
|
||||
: UIScreenWithGameBackground(gamePath), resultNotice_(nullptr), setStatus_(false) {
|
||||
: UIDialogScreenWithGameBackground(gamePath), resultNotice_(nullptr), setStatus_(false) {
|
||||
}
|
||||
|
||||
void ReportFinishScreen::CreateViews() {
|
||||
@ -353,7 +353,7 @@ void ReportFinishScreen::update() {
|
||||
}
|
||||
}
|
||||
|
||||
UIScreenWithGameBackground::update();
|
||||
UIDialogScreenWithGameBackground::update();
|
||||
}
|
||||
|
||||
UI::EventReturn ReportFinishScreen::HandleViewFeedback(UI::EventParams &e) {
|
||||
|
@ -51,7 +51,7 @@ protected:
|
||||
bool includeScreenshot_;
|
||||
};
|
||||
|
||||
class ReportFinishScreen : public UIScreenWithGameBackground {
|
||||
class ReportFinishScreen : public UIDialogScreenWithGameBackground {
|
||||
public:
|
||||
ReportFinishScreen(const std::string &gamePath);
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/Util/AudioFormat.h"
|
||||
#include "Windows/W32Util/Misc.h"
|
||||
#include "Common/OSVersion.h"
|
||||
|
||||
#include "dsoundstream.h"
|
||||
|
||||
@ -477,4 +476,4 @@ WindowsAudioBackend *CreateAudioBackend(AudioBackendType type) {
|
||||
} else {
|
||||
return new DSoundAudioBackend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user