forked from KhronosGroup/SPIRV-Cross
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GLSL: Fix expression reorder bug with legacy FMA fallback.
- Loading branch information
1 parent
8e64f8e
commit 50623e1
Showing
7 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
reference/shaders-no-opt/asm/vert/fma-legacy-fallback.asm.vert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#version 310 es | ||
|
||
layout(location = 0) out float a; | ||
|
||
void main() | ||
{ | ||
a = 5.0; | ||
a = a * 2.0 + 1.0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
OpCapability Shader | ||
%1 = OpExtInstImport "GLSL.std.450" | ||
OpMemoryModel Logical GLSL450 | ||
OpEntryPoint Vertex %main "main" %a | ||
OpSource ESSL 310 | ||
OpName %main "main" | ||
OpName %a "a" | ||
OpDecorate %a Location 0 | ||
%void = OpTypeVoid | ||
%3 = OpTypeFunction %void | ||
%float = OpTypeFloat 32 | ||
%_ptr_Output_float = OpTypePointer Output %float | ||
%a = OpVariable %_ptr_Output_float Output | ||
%float_5 = OpConstant %float 5 | ||
%float_2 = OpConstant %float 2 | ||
%float_1 = OpConstant %float 1 | ||
%main = OpFunction %void None %3 | ||
%5 = OpLabel | ||
OpStore %a %float_5 | ||
%10 = OpLoad %float %a | ||
%14 = OpExtInst %float %1 Fma %10 %float_2 %float_1 | ||
OpStore %a %14 | ||
OpReturn | ||
OpFunctionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters