mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Minor cleanups
This commit is contained in:
parent
7061993c8f
commit
559ccd9f33
@ -17,7 +17,8 @@ int pngLoad(const char *file, int *pwidth, int *pheight, unsigned char **image_d
|
||||
|
||||
if (PNG_IMAGE_FAILED(png))
|
||||
{
|
||||
ERROR_LOG(IO, "pngLoad: %s", png.message);
|
||||
WARN_LOG(IO, "pngLoad: %s (%s)", png.message, file);
|
||||
*image_data_ptr = nullptr;
|
||||
return 0;
|
||||
}
|
||||
*pwidth = png.width;
|
||||
@ -37,7 +38,8 @@ int pngLoadPtr(const unsigned char *input_ptr, size_t input_len, int *pwidth, in
|
||||
png_image_begin_read_from_memory(&png, input_ptr, input_len);
|
||||
|
||||
if (PNG_IMAGE_FAILED(png)) {
|
||||
ERROR_LOG(IO, "pngLoad: %s", png.message);
|
||||
WARN_LOG(IO, "pngLoad: %s", png.message);
|
||||
*image_data_ptr = nullptr;
|
||||
return 0;
|
||||
}
|
||||
*pwidth = png.width;
|
||||
@ -49,6 +51,7 @@ int pngLoadPtr(const unsigned char *input_ptr, size_t input_len, int *pwidth, in
|
||||
size_t size = PNG_IMAGE_SIZE(png);
|
||||
if (!size) {
|
||||
ERROR_LOG(IO, "pngLoad: empty image");
|
||||
*image_data_ptr = nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1062,7 +1062,7 @@ void TextureCacheCommon::NotifyConfigChanged() {
|
||||
scaleFactor = g_Config.iTexScalingLevel;
|
||||
}
|
||||
|
||||
if (!gstate_c.Supports(GPU_SUPPORTS_OES_TEXTURE_NPOT)) {
|
||||
if (!gstate_c.Supports(GPU_SUPPORTS_TEXTURE_NPOT)) {
|
||||
// Reduce the scale factor to a power of two (e.g. 2 or 4) if textures must be a power of two.
|
||||
while ((scaleFactor & (scaleFactor - 1)) != 0) {
|
||||
--scaleFactor;
|
||||
|
@ -141,7 +141,7 @@ void GPU_D3D11::CheckGPUFeatures() {
|
||||
#endif
|
||||
|
||||
features |= GPU_SUPPORTS_DEPTH_TEXTURE;
|
||||
features |= GPU_SUPPORTS_OES_TEXTURE_NPOT;
|
||||
features |= GPU_SUPPORTS_TEXTURE_NPOT;
|
||||
if (draw_->GetDeviceCaps().dualSourceBlend)
|
||||
features |= GPU_SUPPORTS_DUALSOURCE_BLEND;
|
||||
if (draw_->GetDeviceCaps().depthClampSupported)
|
||||
|
@ -204,7 +204,7 @@ void GPU_DX9::CheckGPUFeatures() {
|
||||
if ((caps.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) != 0 && caps.MaxAnisotropy > 1)
|
||||
features |= GPU_SUPPORTS_ANISOTROPY;
|
||||
if ((caps.TextureCaps & (D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_POW2)) == 0)
|
||||
features |= GPU_SUPPORTS_OES_TEXTURE_NPOT;
|
||||
features |= GPU_SUPPORTS_TEXTURE_NPOT;
|
||||
}
|
||||
|
||||
if (!g_Config.bHighQualityDepth) {
|
||||
|
@ -672,7 +672,7 @@ bool DrawEngineGLES::IsCodePtrVertexDecoder(const u8 *ptr) const {
|
||||
|
||||
bool DrawEngineGLES::SupportsHWTessellation() const {
|
||||
bool hasTexelFetch = gl_extensions.GLES3 || (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(3, 3, 0)) || gl_extensions.EXT_gpu_shader4;
|
||||
return hasTexelFetch && gstate_c.SupportsAll(GPU_SUPPORTS_VERTEX_TEXTURE_FETCH | GPU_SUPPORTS_TEXTURE_FLOAT);
|
||||
return hasTexelFetch && gstate_c.SupportsAll(GPU_SUPPORTS_VERTEX_TEXTURE_FETCH | GPU_SUPPORTS_TEXTURE_FLOAT | GPU_SUPPORTS_INSTANCE_RENDERING);
|
||||
}
|
||||
|
||||
bool DrawEngineGLES::UpdateUseHWTessellation(bool enable) {
|
||||
|
@ -190,7 +190,7 @@ void GPU_GLES::CheckGPUFeatures() {
|
||||
features |= GPU_PREFER_REVERSE_COLOR_ORDER;
|
||||
|
||||
if (gl_extensions.OES_texture_npot)
|
||||
features |= GPU_SUPPORTS_OES_TEXTURE_NPOT;
|
||||
features |= GPU_SUPPORTS_TEXTURE_NPOT;
|
||||
|
||||
if (gl_extensions.EXT_blend_minmax)
|
||||
features |= GPU_SUPPORTS_BLEND_MINMAX;
|
||||
|
@ -491,7 +491,7 @@ enum {
|
||||
GPU_SUPPORTS_TEXTURE_LOD_CONTROL = FLAG_BIT(24),
|
||||
GPU_SUPPORTS_FRAMEBUFFER_BLIT = FLAG_BIT(26),
|
||||
GPU_SUPPORTS_FRAMEBUFFER_BLIT_TO_DEPTH = FLAG_BIT(27),
|
||||
GPU_SUPPORTS_OES_TEXTURE_NPOT = FLAG_BIT(28),
|
||||
GPU_SUPPORTS_TEXTURE_NPOT = FLAG_BIT(28),
|
||||
GPU_NEEDS_Z_EQUAL_W_HACK = FLAG_BIT(29),
|
||||
// Free bit: 30
|
||||
GPU_PREFER_REVERSE_COLOR_ORDER = FLAG_BIT(31),
|
||||
|
@ -227,7 +227,7 @@ void GPU_Vulkan::CheckGPUFeatures() {
|
||||
features |= GPU_SUPPORTS_FRAMEBUFFER_BLIT;
|
||||
features |= GPU_SUPPORTS_BLEND_MINMAX;
|
||||
features |= GPU_SUPPORTS_COPY_IMAGE;
|
||||
features |= GPU_SUPPORTS_OES_TEXTURE_NPOT;
|
||||
features |= GPU_SUPPORTS_TEXTURE_NPOT;
|
||||
features |= GPU_SUPPORTS_INSTANCE_RENDERING;
|
||||
features |= GPU_SUPPORTS_VERTEX_TEXTURE_FETCH;
|
||||
features |= GPU_SUPPORTS_TEXTURE_FLOAT;
|
||||
|
Loading…
Reference in New Issue
Block a user