Commit dd4aec7e authored by Libretro-Admin's avatar Libretro-Admin
Browse files
parent 531ad31e
Pipeline #16301 failed with stages
in 4 minutes and 38 seconds
......@@ -175,7 +175,7 @@ void vramlock_list_add(vram_block* block)
cMutex vramlist_lock;
vram_block* libCore_vramlock_Lock(u32 start_offset64,u32 end_offset64,void* userdata)
void libCore_vramlock_Lock(u32 start_offset64, u32 end_offset64, BaseTextureCacheData *texture)
{
vram_block* block=(vram_block* )malloc(sizeof(vram_block));
......@@ -196,17 +196,22 @@ vram_block* libCore_vramlock_Lock(u32 start_offset64,u32 end_offset64,void* user
block->end=end_offset64;
block->start=start_offset64;
block->len=end_offset64-start_offset64+1;
block->userdata=userdata;
block->userdata = texture;
block->type=64;
{
std::lock_guard<cMutex> lock(vramlist_lock);
// This also protects vram if needed
vramlock_list_add(block);
}
if (texture->lock_block == nullptr)
{
// This also protects vram if needed
vramlock_list_add(block);
texture->lock_block = block;
}
else
free(block);
return block;
}
}
bool VramLockedWriteOffset(size_t offset)
......@@ -218,7 +223,7 @@ bool VramLockedWriteOffset(size_t offset)
std::vector<vram_block *>& list = VramLocks[addr_hash];
{
std::lock_guard<cMutex> lock(vramlist_lock);
std::lock_guard<cMutex> lockguard(vramlist_lock);
for (auto& lock : list)
{
......@@ -727,8 +732,7 @@ void BaseTextureCacheData::Update()
h = original_h;
//lock the texture to detect changes in it
if (lock_block == nullptr)
lock_block = libCore_vramlock_Lock(sa_tex,sa+size-1,this);
libCore_vramlock_Lock(sa_tex, sa + size - 1, this);
UploadToGPU(upscaled_w, upscaled_h, (u8*)temp_tex_buffer, IsMipmapped(), mipmapped);
if (settings.rend.DumpTextures)
......
......@@ -635,7 +635,11 @@ void texture_VQ(PixelBuffer<pixel_type>* pb,u8* p_in,u32 Width,u32 Height)
#define texPAL4_VQ32 texture_VQ<convPAL4_TW<u32>, u32>
#define texPAL8_VQ32 texture_VQ<convPAL8_TW<u32>, u32>
class BaseTextureCacheData;
bool VramLockedWriteOffset(size_t offset);
void libCore_vramlock_Lock(u32 start_offset, u32 end_offset, BaseTextureCacheData *texture);
#ifdef HAVE_TEXUPSCALE
void UpscalexBRZ(int factor, u32* source, u32* dest, int width, int height, bool has_alpha);
#endif
......
......@@ -343,8 +343,7 @@ void ReadRTTBuffer() {
texture_data->Create();
texture_data->texID = gl.rtt.tex;
texture_data->dirty = 0;
if (texture_data->lock_block == NULL)
texture_data->lock_block = libCore_vramlock_Lock(texture_data->sa_tex, texture_data->sa + texture_data->size - 1, texture_data);
libCore_vramlock_Lock(texture_data->sa_tex, texture_data->sa + texture_data->size - 1, texture_data);
}
gl.rtt.tex = 0;
......
......@@ -580,8 +580,7 @@ void TextureDrawer::EndRenderPass()
//memset(&vram[fb_rtt.TexAddr << 3], '\0', size);
texture->dirty = 0;
if (texture->lock_block == NULL)
texture->lock_block = libCore_vramlock_Lock(texture->sa_tex, texture->sa + texture->size - 1, texture);
libCore_vramlock_Lock(texture->sa_tex, texture->sa + texture->size - 1, texture);
}
void ScreenDrawer::Init(SamplerManager *samplerManager, ShaderManager *shaderManager)
......
......@@ -648,8 +648,7 @@ void OITTextureDrawer::EndFrame()
//memset(&vram[fb_rtt.TexAddr << 3], '\0', size);
texture->dirty = 0;
if (texture->lock_block == NULL)
texture->lock_block = libCore_vramlock_Lock(texture->sa_tex, texture->sa + texture->size - 1, texture);
libCore_vramlock_Lock(texture->sa_tex, texture->sa + texture->size - 1, texture);
}
vk::CommandBuffer OITScreenDrawer::NewFrame()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment