mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
commit
3555ab1236
13 changed files with 43 additions and 38 deletions
|
@ -34,7 +34,7 @@ GLRTexture::GLRTexture(const Draw::DeviceCaps &caps, int width, int height, int
|
|||
}
|
||||
w = width;
|
||||
h = height;
|
||||
depth = depth;
|
||||
d = depth;
|
||||
this->numMips = numMips;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,10 @@ public:
|
|||
return offset_;
|
||||
}
|
||||
|
||||
const char *Name() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
// "Zero-copy" variant - you can write the data directly as you compute it.
|
||||
// Recommended.
|
||||
void *Push(size_t size, uint32_t *bindOffset, VkBuffer *vkbuf) {
|
||||
|
|
|
@ -1602,16 +1602,16 @@ void VulkanQueueRunner::SetupTransitionToTransferSrc(VKRImage &img, VkImageAspec
|
|||
|
||||
if (img.format == VK_FORMAT_D16_UNORM_S8_UINT || img.format == VK_FORMAT_D24_UNORM_S8_UINT || img.format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
|
||||
// Barrier must specify both for combined depth/stencil buffers.
|
||||
aspect = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
imageAspect = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
} else {
|
||||
aspect = aspect;
|
||||
imageAspect = aspect;
|
||||
}
|
||||
|
||||
recordBarrier->TransitionImage(
|
||||
img.image,
|
||||
0,
|
||||
1,
|
||||
aspect,
|
||||
imageAspect,
|
||||
img.layout,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||
srcAccessMask,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <cstdint>
|
||||
#include <zstd.h>
|
||||
|
||||
#include "Common/Log.h"
|
||||
#include "Common/Render/TextureAtlas.h"
|
||||
|
||||
class ByteReader {
|
||||
|
@ -10,6 +11,7 @@ public:
|
|||
|
||||
template<class T>
|
||||
T Read() {
|
||||
_dbg_assert_(offset_ + sizeof(T) <= size_);
|
||||
T x;
|
||||
memcpy(&x, data_ + offset_, sizeof(T));
|
||||
offset_ += sizeof(T);
|
||||
|
@ -18,6 +20,7 @@ public:
|
|||
|
||||
template<class T>
|
||||
void ReadInto(T *t) {
|
||||
_dbg_assert_(offset_ + sizeof(T) <= size_);
|
||||
memcpy(t, data_ + offset_, sizeof(T));
|
||||
offset_ += sizeof(T);
|
||||
}
|
||||
|
@ -26,13 +29,16 @@ public:
|
|||
T *ReadMultipleAlloc(size_t count, bool compressed) {
|
||||
T *t = new T[count];
|
||||
if (!compressed) {
|
||||
_dbg_assert_(offset_ + sizeof(T) * count <= size_);
|
||||
memcpy(t, data_ + offset_, sizeof(T) * count);
|
||||
offset_ += sizeof(T) * count;
|
||||
} else {
|
||||
_dbg_assert_(offset_ + sizeof(uint32_t) <= size_);
|
||||
uint32_t compressed_size = 0;
|
||||
memcpy(&compressed_size, data_ + offset_, sizeof(uint32_t));
|
||||
offset_ += sizeof(uint32_t);
|
||||
|
||||
_dbg_assert_(offset_ + compressed_size <= size_);
|
||||
ZSTD_decompress(t, sizeof(T) * count, data_ + offset_, compressed_size);
|
||||
offset_ += compressed_size;
|
||||
}
|
||||
|
|
|
@ -679,6 +679,10 @@ void PGF::SetFontPixel(u32 base, int bpl, int bufWidth, int bufHeight, int x, in
|
|||
}
|
||||
|
||||
static const u8 fontPixelSizeInBytes[] = { 0, 0, 1, 3, 4 }; // 0 means 2 pixels per byte
|
||||
if (pixelformat < 0 || pixelformat > PSP_FONT_PIXELFORMAT_32) {
|
||||
ERROR_LOG_REPORT_ONCE(pfgbadformat, SCEFONT, "Invalid image format in image: %d", (int)pixelformat);
|
||||
return;
|
||||
}
|
||||
int pixelBytes = fontPixelSizeInBytes[pixelformat];
|
||||
int bufMaxWidth = (pixelBytes == 0 ? bpl * 2 : bpl / pixelBytes);
|
||||
if (x >= bufMaxWidth) {
|
||||
|
|
|
@ -102,7 +102,7 @@ int writeTicketU64Param(u8* buffer, const u16_be type, const u64_be data) {
|
|||
|
||||
void notifyNpAuthHandlers(u32 id, u32 result, u32 argAddr) {
|
||||
std::lock_guard<std::recursive_mutex> npAuthGuard(npAuthEvtMtx);
|
||||
npAuthEvents.push_back({ id, result, argAddr });
|
||||
npAuthEvents.push_back({ { id, result, argAddr } });
|
||||
}
|
||||
|
||||
static int sceNpInit()
|
||||
|
|
|
@ -217,7 +217,7 @@ u32 GetTextureBufw(int level, u32 texaddr, GETextureFormat format) {
|
|||
return bufw;
|
||||
}
|
||||
|
||||
// Is this compatible with QuickTexHashNEON/SSE?
|
||||
// Matches QuickTexHashNEON/SSE, see #7029.
|
||||
static u32 QuickTexHashNonSSE(const void *checkp, u32 size) {
|
||||
u32 check = 0;
|
||||
|
||||
|
@ -269,20 +269,6 @@ static u32 QuickTexHashNonSSE(const void *checkp, u32 size) {
|
|||
return check;
|
||||
}
|
||||
|
||||
static u32 QuickTexHashBasic(const void *checkp, u32 size) {
|
||||
u32 check = 0;
|
||||
const u32 size_u32 = size / 4;
|
||||
const u32 *p = (const u32 *)checkp;
|
||||
for (u32 i = 0; i < size_u32; i += 4) {
|
||||
check += p[i + 0];
|
||||
check ^= p[i + 1];
|
||||
check += p[i + 2];
|
||||
check ^= p[i + 3];
|
||||
}
|
||||
|
||||
return check;
|
||||
}
|
||||
|
||||
u32 StableQuickTexHash(const void *checkp, u32 size) {
|
||||
#if defined(_M_SSE)
|
||||
return QuickTexHashSSE2(checkp, size);
|
||||
|
|
|
@ -209,7 +209,7 @@ static void load_sample(ptrdiff_t w, ptrdiff_t h, ptrdiff_t s, const u8 *pixels,
|
|||
// Check if the sample is inside. NOTE: for b>=0
|
||||
// the expression (UNSIGNED)a<(UNSIGNED)b is
|
||||
// equivalent to a>=0&&a<b.
|
||||
typedef int static_assert_size_matches[sizeof(ptrdiff_t)==sizeof(size_t)?1:-1];
|
||||
static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Assumes ptrdiff_t same width as size_t");
|
||||
|
||||
if((size_t)x >= (size_t)w||(size_t)y >= (size_t)h) {
|
||||
switch(wrap_mode) {
|
||||
|
|
|
@ -79,7 +79,6 @@ private:
|
|||
GLRTexture *lastBoundTexture = nullptr;
|
||||
|
||||
FramebufferManagerGLES *framebufferManagerGL_;
|
||||
ShaderManagerGLES *shaderManagerGL_;
|
||||
DrawEngineGLES *drawEngine_;
|
||||
|
||||
enum { INVALID_TEX = -1 };
|
||||
|
|
|
@ -72,7 +72,7 @@ private:
|
|||
|
||||
struct FrameData {
|
||||
FrameData() : descPool("VulkanComputeShaderManager", true) {
|
||||
descPool.Setup([this] { });
|
||||
descPool.Setup([] { });
|
||||
}
|
||||
|
||||
VulkanDescSetPool descPool;
|
||||
|
|
|
@ -39,7 +39,6 @@ private:
|
|||
|
||||
bool array[ARRAY_SIZE(CustomKey::comboKeyList)];
|
||||
int id_;
|
||||
UI::ChoiceStrip *comboselect;
|
||||
UI::ScrollView *rightScroll_;
|
||||
class ChoiceEventHandler{
|
||||
public:
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
void
|
||||
png_read_filter_row_up_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
||||
png_bytep row, png_const_bytep prev_row)
|
||||
png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + rowbytes;
|
||||
|
@ -63,10 +63,11 @@ png_read_filter_row_up_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
|||
}
|
||||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_sub3_neon(png_alloc_size_t rowbytes, unsigned int bpp, png_bytep row, png_const_bytep prev_row)
|
||||
png_read_filter_row_sub3_neon(png_alloc_size_t rowbytes, unsigned int bpp, png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + rowbytes;
|
||||
|
@ -108,11 +109,12 @@ png_read_filter_row_sub3_neon(png_alloc_size_t rowbytes, unsigned int bpp, png_b
|
|||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_row)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_sub4_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
||||
png_bytep row, png_const_bytep prev_row)
|
||||
png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + rowbytes;
|
||||
|
@ -136,11 +138,12 @@ png_read_filter_row_sub4_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
|||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_row)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_avg3_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
||||
png_bytep row, png_const_bytep prev_row)
|
||||
png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
|
@ -204,11 +207,12 @@ png_read_filter_row_avg3_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
|||
}
|
||||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_avg4_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
||||
png_bytep row, png_const_bytep prev_row)
|
||||
png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + rowbytes;
|
||||
|
@ -244,6 +248,7 @@ png_read_filter_row_avg4_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
|||
}
|
||||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
|
||||
static uint8x8_t
|
||||
|
@ -275,7 +280,7 @@ paeth(uint8x8_t a, uint8x8_t b, uint8x8_t c)
|
|||
|
||||
void
|
||||
png_read_filter_row_paeth3_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
||||
png_bytep row, png_const_bytep prev_row)
|
||||
png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
|
@ -339,11 +344,12 @@ png_read_filter_row_paeth3_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
|||
}
|
||||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
|
||||
void
|
||||
png_read_filter_row_paeth4_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
||||
png_bytep row, png_const_bytep prev_row)
|
||||
png_bytep row, png_const_bytep prev_row, png_const_bytep prev_pixels)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
png_bytep rp_stop = row + rowbytes;
|
||||
|
@ -382,6 +388,7 @@ png_read_filter_row_paeth4_neon(png_alloc_size_t rowbytes, unsigned int bpp,
|
|||
}
|
||||
|
||||
PNG_UNUSED(bpp)
|
||||
PNG_UNUSED(prev_pixels)
|
||||
}
|
||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 1 (intrinsics) */
|
||||
|
|
|
@ -102,23 +102,23 @@
|
|||
#if PNG_ARM_NEON_OPT > 0
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,
|
||||
(png_alloc_size_t row_bytes, unsigned int bpp, png_bytep row,
|
||||
png_const_bytep prev_row),PNG_EMPTY);
|
||||
png_const_bytep prev_row, png_const_bytep prev_pixels),PNG_EMPTY);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue