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
e58c080d
Unverified
Commit
e58c080d
authored
Dec 03, 2019
by
John Kessenich
Committed by
GitHub
Dec 03, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1990 from ianromanick/INTEL_shader_integer_functions2
Implement INTEL_shader_integer_functions2
parents
a4af7676
b3bd402c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
270 additions
and
3 deletions
+270
-3
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+47
-0
doc.cpp
SPIRV/doc.cpp
+2
-0
spv.specConstant.vert.out
Test/baseResults/spv.specConstant.vert.out
+3
-3
intermediate.h
glslang/Include/intermediate.h
+9
-0
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+193
-0
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+4
-0
Versions.h
glslang/MachineIndependent/Versions.h
+2
-0
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+10
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
e58c080d
...
@@ -2608,6 +2608,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
...
@@ -2608,6 +2608,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
atomic
=
true
;
atomic
=
true
;
break
;
break
;
case
glslang
:
:
EOpAbsDifference
:
case
glslang
:
:
EOpAddSaturate
:
case
glslang
:
:
EOpSubSaturate
:
case
glslang
:
:
EOpAverage
:
case
glslang
:
:
EOpAverageRounded
:
case
glslang
:
:
EOpMul32x16
:
builder
.
addCapability
(
spv
::
CapabilityIntegerFunctions2INTEL
);
builder
.
addExtension
(
"SPV_INTEL_shader_integer_functions2"
);
binOp
=
node
->
getOp
();
break
;
case
glslang
:
:
EOpIgnoreIntersectionNV
:
case
glslang
:
:
EOpIgnoreIntersectionNV
:
case
glslang
:
:
EOpTerminateRayNV
:
case
glslang
:
:
EOpTerminateRayNV
:
case
glslang
:
:
EOpTraceNV
:
case
glslang
:
:
EOpTraceNV
:
...
@@ -5231,6 +5242,30 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD
...
@@ -5231,6 +5242,30 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD
binOp
=
spv
::
OpLogicalNotEqual
;
binOp
=
spv
::
OpLogicalNotEqual
;
break
;
break
;
case
glslang
:
:
EOpAbsDifference
:
binOp
=
isUnsigned
?
spv
::
OpAbsUSubINTEL
:
spv
::
OpAbsISubINTEL
;
break
;
case
glslang
:
:
EOpAddSaturate
:
binOp
=
isUnsigned
?
spv
::
OpUAddSatINTEL
:
spv
::
OpIAddSatINTEL
;
break
;
case
glslang
:
:
EOpSubSaturate
:
binOp
=
isUnsigned
?
spv
::
OpUSubSatINTEL
:
spv
::
OpISubSatINTEL
;
break
;
case
glslang
:
:
EOpAverage
:
binOp
=
isUnsigned
?
spv
::
OpUAverageINTEL
:
spv
::
OpIAverageINTEL
;
break
;
case
glslang
:
:
EOpAverageRounded
:
binOp
=
isUnsigned
?
spv
::
OpUAverageRoundedINTEL
:
spv
::
OpIAverageRoundedINTEL
;
break
;
case
glslang
:
:
EOpMul32x16
:
binOp
=
isUnsigned
?
spv
::
OpUMul32x16INTEL
:
spv
::
OpIMul32x16INTEL
;
break
;
case
glslang
:
:
EOpLessThan
:
case
glslang
:
:
EOpLessThan
:
case
glslang
:
:
EOpGreaterThan
:
case
glslang
:
:
EOpGreaterThan
:
case
glslang
:
:
EOpLessThanEqual
:
case
glslang
:
:
EOpLessThanEqual
:
...
@@ -5745,6 +5780,18 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
...
@@ -5745,6 +5780,18 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
libCall
=
spv
::
GLSLstd450FindSMsb
;
libCall
=
spv
::
GLSLstd450FindSMsb
;
break
;
break
;
case
glslang
:
:
EOpCountLeadingZeros
:
builder
.
addCapability
(
spv
::
CapabilityIntegerFunctions2INTEL
);
builder
.
addExtension
(
"SPV_INTEL_shader_integer_functions2"
);
unaryOp
=
spv
::
OpUCountLeadingZerosINTEL
;
break
;
case
glslang
:
:
EOpCountTrailingZeros
:
builder
.
addCapability
(
spv
::
CapabilityIntegerFunctions2INTEL
);
builder
.
addExtension
(
"SPV_INTEL_shader_integer_functions2"
);
unaryOp
=
spv
::
OpUCountTrailingZerosINTEL
;
break
;
case
glslang
:
:
EOpBallot
:
case
glslang
:
:
EOpBallot
:
case
glslang
:
:
EOpReadFirstInvocation
:
case
glslang
:
:
EOpReadFirstInvocation
:
case
glslang
:
:
EOpAnyInvocation
:
case
glslang
:
:
EOpAnyInvocation
:
...
...
SPIRV/doc.cpp
View file @
e58c080d
...
@@ -931,6 +931,8 @@ const char* CapabilityString(int info)
...
@@ -931,6 +931,8 @@ const char* CapabilityString(int info)
case
CapabilityDemoteToHelperInvocationEXT
:
return
"DemoteToHelperInvocationEXT"
;
case
CapabilityDemoteToHelperInvocationEXT
:
return
"DemoteToHelperInvocationEXT"
;
case
CapabilityShaderClockKHR
:
return
"ShaderClockKHR"
;
case
CapabilityShaderClockKHR
:
return
"ShaderClockKHR"
;
case
CapabilityIntegerFunctions2INTEL
:
return
"CapabilityIntegerFunctions2INTEL"
;
default:
return
"Bad"
;
default:
return
"Bad"
;
}
}
}
}
...
...
Test/baseResults/spv.specConstant.vert.out
View file @
e58c080d
...
@@ -11,7 +11,7 @@ spv.specConstant.vert
...
@@ -11,7 +11,7 @@ spv.specConstant.vert
Source GLSL 400
Source GLSL 400
Name 4 "main"
Name 4 "main"
Name 9 "arraySize"
Name 9 "arraySize"
Name 14 "foo(vf4[s4
393
];"
Name 14 "foo(vf4[s4
529
];"
Name 13 "p"
Name 13 "p"
Name 17 "builtin_spec_constant("
Name 17 "builtin_spec_constant("
Name 20 "color"
Name 20 "color"
...
@@ -102,10 +102,10 @@ spv.specConstant.vert
...
@@ -102,10 +102,10 @@ spv.specConstant.vert
Store 20(color) 46
Store 20(color) 46
48: 10 Load 22(ucol)
48: 10 Load 22(ucol)
Store 47(param) 48
Store 47(param) 48
49: 2 FunctionCall 14(foo(vf4[s4
393
];) 47(param)
49: 2 FunctionCall 14(foo(vf4[s4
529
];) 47(param)
Return
Return
FunctionEnd
FunctionEnd
14(foo(vf4[s4
393
];): 2 Function None 12
14(foo(vf4[s4
529
];): 2 Function None 12
13(p): 11(ptr) FunctionParameter
13(p): 11(ptr) FunctionParameter
15: Label
15: Label
54: 24(ptr) AccessChain 53(dupUcol) 23
54: 24(ptr) AccessChain 53(dupUcol) 23
...
...
glslang/Include/intermediate.h
View file @
e58c080d
...
@@ -899,6 +899,15 @@ enum TOperator {
...
@@ -899,6 +899,15 @@ enum TOperator {
EOpFindLSB
,
EOpFindLSB
,
EOpFindMSB
,
EOpFindMSB
,
EOpCountLeadingZeros
,
EOpCountTrailingZeros
,
EOpAbsDifference
,
EOpAddSaturate
,
EOpSubSaturate
,
EOpAverage
,
EOpAverageRounded
,
EOpMul32x16
,
EOpTraceNV
,
EOpTraceNV
,
EOpReportIntersectionNV
,
EOpReportIntersectionNV
,
EOpIgnoreIntersectionNV
,
EOpIgnoreIntersectionNV
,
...
...
glslang/MachineIndependent/Initialize.cpp
View file @
e58c080d
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/Versions.cpp
View file @
e58c080d
...
@@ -236,6 +236,8 @@ void TParseVersions::initializeExtensionBehavior()
...
@@ -236,6 +236,8 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior
[
E_GL_AMD_shader_fragment_mask
]
=
EBhDisable
;
extensionBehavior
[
E_GL_AMD_shader_fragment_mask
]
=
EBhDisable
;
extensionBehavior
[
E_GL_AMD_gpu_shader_half_float_fetch
]
=
EBhDisable
;
extensionBehavior
[
E_GL_AMD_gpu_shader_half_float_fetch
]
=
EBhDisable
;
extensionBehavior
[
E_GL_INTEL_shader_integer_functions2
]
=
EBhDisable
;
extensionBehavior
[
E_GL_NV_sample_mask_override_coverage
]
=
EBhDisable
;
extensionBehavior
[
E_GL_NV_sample_mask_override_coverage
]
=
EBhDisable
;
extensionBehavior
[
E_SPV_NV_geometry_shader_passthrough
]
=
EBhDisable
;
extensionBehavior
[
E_SPV_NV_geometry_shader_passthrough
]
=
EBhDisable
;
extensionBehavior
[
E_GL_NV_viewport_array2
]
=
EBhDisable
;
extensionBehavior
[
E_GL_NV_viewport_array2
]
=
EBhDisable
;
...
@@ -434,6 +436,8 @@ void TParseVersions::getPreamble(std::string& preamble)
...
@@ -434,6 +436,8 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_AMD_shader_fragment_mask 1
\n
"
"#define GL_AMD_shader_fragment_mask 1
\n
"
"#define GL_AMD_gpu_shader_half_float_fetch 1
\n
"
"#define GL_AMD_gpu_shader_half_float_fetch 1
\n
"
"#define GL_INTEL_shader_integer_functions2 1
\n
"
"#define GL_NV_sample_mask_override_coverage 1
\n
"
"#define GL_NV_sample_mask_override_coverage 1
\n
"
"#define GL_NV_geometry_shader_passthrough 1
\n
"
"#define GL_NV_geometry_shader_passthrough 1
\n
"
"#define GL_NV_viewport_array2 1
\n
"
"#define GL_NV_viewport_array2 1
\n
"
...
...
glslang/MachineIndependent/Versions.h
View file @
e58c080d
...
@@ -206,6 +206,8 @@ const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader
...
@@ -206,6 +206,8 @@ const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader
const
char
*
const
E_GL_AMD_shader_fragment_mask
=
"GL_AMD_shader_fragment_mask"
;
const
char
*
const
E_GL_AMD_shader_fragment_mask
=
"GL_AMD_shader_fragment_mask"
;
const
char
*
const
E_GL_AMD_gpu_shader_half_float_fetch
=
"GL_AMD_gpu_shader_half_float_fetch"
;
const
char
*
const
E_GL_AMD_gpu_shader_half_float_fetch
=
"GL_AMD_gpu_shader_half_float_fetch"
;
const
char
*
const
E_GL_INTEL_shader_integer_functions2
=
"GL_INTEL_shader_integer_functions2"
;
const
char
*
const
E_GL_NV_sample_mask_override_coverage
=
"GL_NV_sample_mask_override_coverage"
;
const
char
*
const
E_GL_NV_sample_mask_override_coverage
=
"GL_NV_sample_mask_override_coverage"
;
const
char
*
const
E_SPV_NV_geometry_shader_passthrough
=
"GL_NV_geometry_shader_passthrough"
;
const
char
*
const
E_SPV_NV_geometry_shader_passthrough
=
"GL_NV_geometry_shader_passthrough"
;
const
char
*
const
E_GL_NV_viewport_array2
=
"GL_NV_viewport_array2"
;
const
char
*
const
E_GL_NV_viewport_array2
=
"GL_NV_viewport_array2"
;
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
e58c080d
...
@@ -213,6 +213,13 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
...
@@ -213,6 +213,13 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
case
EOpLogicalXor
:
out
.
debug
<<
"logical-xor"
;
break
;
case
EOpLogicalXor
:
out
.
debug
<<
"logical-xor"
;
break
;
case
EOpLogicalAnd
:
out
.
debug
<<
"logical-and"
;
break
;
case
EOpLogicalAnd
:
out
.
debug
<<
"logical-and"
;
break
;
case
EOpAbsDifference
:
out
.
debug
<<
"absoluteDifference"
;
break
;
case
EOpAddSaturate
:
out
.
debug
<<
"addSaturate"
;
break
;
case
EOpSubSaturate
:
out
.
debug
<<
"subtractSaturate"
;
break
;
case
EOpAverage
:
out
.
debug
<<
"average"
;
break
;
case
EOpAverageRounded
:
out
.
debug
<<
"averageRounded"
;
break
;
case
EOpMul32x16
:
out
.
debug
<<
"multiply32x16"
;
break
;
default
:
out
.
debug
<<
"<unknown op>"
;
default
:
out
.
debug
<<
"<unknown op>"
;
}
}
...
@@ -557,6 +564,9 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
...
@@ -557,6 +564,9 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case
EOpFindLSB
:
out
.
debug
<<
"findLSB"
;
break
;
case
EOpFindLSB
:
out
.
debug
<<
"findLSB"
;
break
;
case
EOpFindMSB
:
out
.
debug
<<
"findMSB"
;
break
;
case
EOpFindMSB
:
out
.
debug
<<
"findMSB"
;
break
;
case
EOpCountLeadingZeros
:
out
.
debug
<<
"countLeadingZeros"
;
break
;
case
EOpCountTrailingZeros
:
out
.
debug
<<
"countTrailingZeros"
;
break
;
case
EOpNoise
:
out
.
debug
<<
"noise"
;
break
;
case
EOpNoise
:
out
.
debug
<<
"noise"
;
break
;
case
EOpBallot
:
out
.
debug
<<
"ballot"
;
break
;
case
EOpBallot
:
out
.
debug
<<
"ballot"
;
break
;
...
...
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