Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
e7c83cfb
Commit
e7c83cfb
authored
Dec 13, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV GLSL.std.450: Add needed smear operations for min, max, clamp, mix, step, and smoothstep.
parent
6feb4989
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
13 deletions
+23
-13
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+8
-0
spv.Operations.frag.out
Test/baseResults/spv.Operations.frag.out
+0
-0
spv.test.frag.out
Test/baseResults/spv.test.frag.out
+4
-3
spv.texture.frag.out
Test/baseResults/spv.texture.frag.out
+10
-9
revision.h
glslang/Include/revision.h
+1
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
e7c83cfb
...
@@ -2871,6 +2871,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
...
@@ -2871,6 +2871,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
libCall
=
spv
::
GLSLstd450UMin
;
libCall
=
spv
::
GLSLstd450UMin
;
else
else
libCall
=
spv
::
GLSLstd450SMin
;
libCall
=
spv
::
GLSLstd450SMin
;
builder
.
promoteScalar
(
precision
,
operands
.
front
(),
operands
.
back
());
break
;
break
;
case
glslang
:
:
EOpModf
:
case
glslang
:
:
EOpModf
:
libCall
=
spv
::
GLSLstd450Modf
;
libCall
=
spv
::
GLSLstd450Modf
;
...
@@ -2882,6 +2883,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
...
@@ -2882,6 +2883,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
libCall
=
spv
::
GLSLstd450UMax
;
libCall
=
spv
::
GLSLstd450UMax
;
else
else
libCall
=
spv
::
GLSLstd450SMax
;
libCall
=
spv
::
GLSLstd450SMax
;
builder
.
promoteScalar
(
precision
,
operands
.
front
(),
operands
.
back
());
break
;
break
;
case
glslang
:
:
EOpPow
:
case
glslang
:
:
EOpPow
:
libCall
=
spv
::
GLSLstd450Pow
;
libCall
=
spv
::
GLSLstd450Pow
;
...
@@ -2900,18 +2902,24 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
...
@@ -2900,18 +2902,24 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
libCall
=
spv
::
GLSLstd450UClamp
;
libCall
=
spv
::
GLSLstd450UClamp
;
else
else
libCall
=
spv
::
GLSLstd450SClamp
;
libCall
=
spv
::
GLSLstd450SClamp
;
builder
.
promoteScalar
(
precision
,
operands
.
front
(),
operands
[
1
]);
builder
.
promoteScalar
(
precision
,
operands
.
front
(),
operands
[
2
]);
break
;
break
;
case
glslang
:
:
EOpMix
:
case
glslang
:
:
EOpMix
:
if
(
isFloat
)
if
(
isFloat
)
libCall
=
spv
::
GLSLstd450FMix
;
libCall
=
spv
::
GLSLstd450FMix
;
else
else
libCall
=
spv
::
GLSLstd450IMix
;
libCall
=
spv
::
GLSLstd450IMix
;
builder
.
promoteScalar
(
precision
,
operands
.
front
(),
operands
.
back
());
break
;
break
;
case
glslang
:
:
EOpStep
:
case
glslang
:
:
EOpStep
:
libCall
=
spv
::
GLSLstd450Step
;
libCall
=
spv
::
GLSLstd450Step
;
builder
.
promoteScalar
(
precision
,
operands
.
front
(),
operands
.
back
());
break
;
break
;
case
glslang
:
:
EOpSmoothStep
:
case
glslang
:
:
EOpSmoothStep
:
libCall
=
spv
::
GLSLstd450SmoothStep
;
libCall
=
spv
::
GLSLstd450SmoothStep
;
builder
.
promoteScalar
(
precision
,
operands
[
0
],
operands
[
2
]);
builder
.
promoteScalar
(
precision
,
operands
[
1
],
operands
[
2
]);
break
;
break
;
case
glslang
:
:
EOpDistance
:
case
glslang
:
:
EOpDistance
:
...
...
Test/baseResults/spv.Operations.frag.out
View file @
e7c83cfb
This diff is collapsed.
Click to expand it.
Test/baseResults/spv.test.frag.out
View file @
e7c83cfb
...
@@ -7,7 +7,7 @@ Linked fragment stage:
...
@@ -7,7 +7,7 @@ Linked fragment stage:
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80001
// Generated by (magic number): 80001
// Id's are bound by 5
5
// Id's are bound by 5
6
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
...
@@ -82,7 +82,8 @@ Linked fragment stage:
...
@@ -82,7 +82,8 @@ Linked fragment stage:
51: 6(float) Load 50(blend)
51: 6(float) Load 50(blend)
52: 6(float) Load 8(blendscale)
52: 6(float) Load 8(blendscale)
53: 6(float) FMul 51 52
53: 6(float) FMul 51 52
54: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 45 48 53
54: 10(fvec4) CompositeConstruct 53 53 53 53
Store 44(gl_FragColor) 54
55: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 45 48 54
Store 44(gl_FragColor) 55
Return
Return
FunctionEnd
FunctionEnd
Test/baseResults/spv.texture.frag.out
View file @
e7c83cfb
...
@@ -8,12 +8,12 @@ Linked fragment stage:
...
@@ -8,12 +8,12 @@ Linked fragment stage:
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80001
// Generated by (magic number): 80001
// Id's are bound by 29
0
// Id's are bound by 29
1
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 2
89
47
EntryPoint Fragment 4 "main" 2
90
47
ExecutionMode 4 OriginLowerLeft
ExecutionMode 4 OriginLowerLeft
Source GLSL 130
Source GLSL 130
Name 4 "main"
Name 4 "main"
...
@@ -39,8 +39,8 @@ Linked fragment stage:
...
@@ -39,8 +39,8 @@ Linked fragment stage:
Name 276 "gl_FragColor"
Name 276 "gl_FragColor"
Name 279 "u"
Name 279 "u"
Name 282 "blend"
Name 282 "blend"
Name 28
8
"scale"
Name 28
9
"scale"
Name 2
89
"t"
Name 2
90
"t"
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeFloat 32
6: TypeFloat 32
...
@@ -103,9 +103,9 @@ Linked fragment stage:
...
@@ -103,9 +103,9 @@ Linked fragment stage:
279(u): 278(ptr) Variable UniformConstant
279(u): 278(ptr) Variable UniformConstant
281: TypePointer UniformConstant 6(float)
281: TypePointer UniformConstant 6(float)
282(blend): 281(ptr) Variable UniformConstant
282(blend): 281(ptr) Variable UniformConstant
28
7
: TypePointer UniformConstant 45(fvec2)
28
8
: TypePointer UniformConstant 45(fvec2)
28
8(scale): 287
(ptr) Variable UniformConstant
28
9(scale): 288
(ptr) Variable UniformConstant
2
89
(t): 46(ptr) Variable Input
2
90
(t): 46(ptr) Variable Input
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
8(blendscale): 7(ptr) Variable Function
8(blendscale): 7(ptr) Variable Function
...
@@ -370,7 +370,8 @@ Linked fragment stage:
...
@@ -370,7 +370,8 @@ Linked fragment stage:
283: 6(float) Load 282(blend)
283: 6(float) Load 282(blend)
284: 6(float) Load 8(blendscale)
284: 6(float) Load 8(blendscale)
285: 6(float) FMul 283 284
285: 6(float) FMul 283 284
286: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 277 280 285
286: 22(fvec4) CompositeConstruct 285 285 285 285
Store 276(gl_FragColor) 286
287: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 277 280 286
Store 276(gl_FragColor) 287
Return
Return
FunctionEnd
FunctionEnd
glslang/Include/revision.h
View file @
e7c83cfb
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "SPIRV99.84
4
"
#define GLSLANG_REVISION "SPIRV99.84
5
"
#define GLSLANG_DATE "13-Dec-2015"
#define GLSLANG_DATE "13-Dec-2015"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment