condition with float constant return always false
- seri14
- Topic Author
void test()
{
float R;
const float V = 10.0;
if (V > 1.0)
R = 1.0;
}
#line 63
void F__test()
{
const float _74 = 0.00000000;
#line 65
float R;
#line 65
R = _74;
const bool _79 = false;
#line 67
if (_79)
{
const float _80 = 1.00000000;
#line 68
R = _80;
}
return;
}
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- seri14
- Topic Author
github.com/Mortalitas/GShade-Shaders/blo...haders/MagicBloom.fx
github.com/Mortalitas/GShade-Shaders/blo...aders/qUINT_bloom.fx
github.com/Mortalitas/GShade-Shaders/blo...ers/qUINT_common.fxh
2019-03-21T13:14:33:124 [12608] | ERROR | Failed to compile "C:\...\reshade-shaders\Shaders\MagicBloom.fx":
C:\...\reshade-shaders\Shaders\MagicBloom.fx(91, 34): error X3082: int or unsigned int type required
C:\...\reshade-shaders\Shaders\MagicBloom.fx(91, 122): error X3000: syntax error: unexpected '|', expected expression
C:\...\reshade-shaders\Shaders\MagicBloom.fx(193, 10): error X3011: value must be a literal expression
C:\...\reshade-shaders\Shaders\MagicBloom.fx(216, 109): error X3538: value must be a literal scalar expression
2019-03-21T13:14:33:243 [15272] | ERROR | Failed to compile "C:\...\reshade-shaders\Shaders\qUINT_bloom.fx":
C:\...\reshade-shaders\Shaders\qUINT_bloom.fx(136, 43): error X3082: int or unsigned int type required
C:\...\reshade-shaders\Shaders\qUINT_bloom.fx(136, 113): error X3000: syntax error: unexpected '|', expected expression
C:\...\reshade-shaders\Shaders\qUINT_bloom.fx(145, 100): error X3538: value must be a literal scalar expression
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- thrive4
But I'm a bit stumped, and I do hate doing the why would
you do this, but I really would like to know under which
condition you would set up code this way?
const float V = 10.0;
if (V > 1.0)
V is always going to be larger then 1.0....
Please Log in or Create an account to join the conversation.
- klotim
thrive4 wrote: Great catch!
But I'm a bit stumped, and I do hate doing the why would
you do this, but I really would like to know under which
condition you would set up code this way?
const float V = 10.0;
if (V > 1.0)
V is always going to be larger then 1.0....
Why yes ofc. But that's just to easily provide that something doesn't work.
In real-life scenarios it would be dynamic variables.
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- klotim
crosire wrote: Nah. Dynamic variables worked fine. This was a very specific case. But can happen when you are debugging with constants to check if a certain code path is working for example.
Alright, Glad that it was solved!
Please Log in or Create an account to join the conversation.
- thrive4
Please Log in or Create an account to join the conversation.