mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-11 00:05:51 +00:00
Refactor: is_exr_file checks memory buffer
All places that used is_exr_file already had first four bytes of the file read into memory. So make is_exr_file work just like is_dds_file does and check those bytes directly, no need to hit stdio again.
This commit is contained in:
committed by
Baldur Karlsson
parent
6a05176075
commit
02fd7ac0cd
@@ -433,7 +433,7 @@ RDResult IMG_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
FileIO::fseek64(f, 0, SEEK_SET);
|
||||
|
||||
// make sure the file is a type we recognise before going further
|
||||
if(is_exr_file(f))
|
||||
if(is_exr_file(headerBuffer, headerSize))
|
||||
{
|
||||
FileIO::fseek64(f, 0, SEEK_END);
|
||||
uint64_t size = FileIO::ftell64(f);
|
||||
@@ -645,7 +645,7 @@ void ImageViewer::RefreshFile()
|
||||
uint64_t fileSize = FileIO::ftell64(f);
|
||||
FileIO::fseek64(f, 0, SEEK_SET);
|
||||
|
||||
if(is_exr_file(f))
|
||||
if(is_exr_file(headerBuffer, headerSize))
|
||||
{
|
||||
texDetails.format = rgba32_float;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user