mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
Add support for HDR canvas textures
Vulkan only.
This commit is contained in:
parent
b695e845e1
commit
fe7beaaf17
3 changed files with 21 additions and 1 deletions
|
@ -113,7 +113,7 @@ void VkHardwareTexture::CreateImage(FTexture *tex, int translation, int flags)
|
|||
}
|
||||
else
|
||||
{
|
||||
VkFormat format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
VkFormat format = tex->IsHDR() ? VK_FORMAT_R32G32B32A32_SFLOAT : VK_FORMAT_R8G8B8A8_UNORM;
|
||||
int w = tex->GetWidth();
|
||||
int h = tex->GetHeight();
|
||||
|
||||
|
|
|
@ -217,6 +217,7 @@ protected:
|
|||
|
||||
bool Masked = false; // Texture (might) have holes
|
||||
bool bHasCanvas = false;
|
||||
bool bHdr = false; // only canvas textures for now.
|
||||
int8_t bTranslucent = -1;
|
||||
int8_t areacount = 0; // this is capped at 4 sections.
|
||||
|
||||
|
@ -253,6 +254,8 @@ public:
|
|||
bool isHardwareCanvas() const { return bHasCanvas; } // There's two here so that this can deal with software canvases in the hardware renderer later.
|
||||
bool isCanvas() const { return bHasCanvas; }
|
||||
|
||||
bool IsHDR() const { return bHdr; }
|
||||
|
||||
int GetSourceLump() { return SourceLump; } // needed by the scripted GetName method.
|
||||
void SetSourceLump(int sl) { SourceLump = sl; }
|
||||
bool FindHoles(const unsigned char * buffer, int w, int h);
|
||||
|
@ -345,6 +348,12 @@ public:
|
|||
float aspectRatio;
|
||||
|
||||
friend struct FCanvasTextureInfo;
|
||||
friend class FTextureAnimator;
|
||||
|
||||
private:
|
||||
void SetHDR(bool hdr) {
|
||||
bHdr = hdr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -742,6 +742,17 @@ void FTextureAnimator::ParseCameraTexture(FScanner &sc)
|
|||
TexMan.AddGameTexture (viewer);
|
||||
}
|
||||
if (sc.GetString())
|
||||
{
|
||||
if (sc.Compare ("hdr"))
|
||||
{
|
||||
canvas->SetHDR(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.UnGet();
|
||||
}
|
||||
}
|
||||
if (sc.GetString())
|
||||
{
|
||||
if (sc.Compare ("fit"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue