Add more float comparisons. Every project should have at least 4.

This commit is contained in:
Pierre-Loup A. Griffais 2019-12-11 23:42:28 -08:00 committed by Pierre-Loup A. Griffais
parent 8db29e4c24
commit ed52f586af
3 changed files with 15 additions and 1 deletions

View file

@ -3,6 +3,7 @@
[[vk::binding(1, 0)]] cbuffer compositeDesc
{
float flLayerCount;
float flSwapChannels;
float flScale0X;
float flScale0Y;
@ -64,5 +65,12 @@ void main(
outputValue = layerSample * layerAlpha + outputValue * ( 1.0 - layerAlpha );
}
if ( flSwapChannels == 1.0 )
{
outImage [index] = outputValue.bgra;
}
else
{
outImage [index] = outputValue;
}
}

View file

@ -1023,6 +1023,11 @@ void vulkan_update_descriptor( struct VulkanPipeline_t *pPipeline )
bool vulkan_composite( struct Composite_t *pComposite, struct VulkanPipeline_t *pPipeline )
{
if ( BIsNested() == false && DRMFormatNeedsSwizzle( g_nDRMFormat ) )
{
pComposite->flSwapChannels = 1.0;
}
*g_pCompositeBuffer = *pComposite;
// XXX maybe flush something?

View file

@ -28,6 +28,7 @@ struct VulkanPipeline_t
struct Composite_t
{
float flLayerCount;
float flSwapChannels;
struct
{