mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-09 12:00:05 +00:00
Support Uint to Int implicit conversions at #extension GL_ARB_gpu_shader5.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
This commit is contained in:
parent
9158061398
commit
8cd85272ad
11
Test/GL_ARB_gpu_shader5.u2i.vert
Normal file
11
Test/GL_ARB_gpu_shader5.u2i.vert
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#version 150
|
||||||
|
#extension GL_ARB_gpu_shader5 : require
|
||||||
|
|
||||||
|
uniform int u1;
|
||||||
|
uniform int u2;
|
||||||
|
out vec4 result;
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
uint v = 0;
|
||||||
|
v = uint(u2) - u1; // implicit conversions
|
||||||
|
}
|
57
Test/baseResults/GL_ARB_gpu_shader5.u2i.vert.out
Normal file
57
Test/baseResults/GL_ARB_gpu_shader5.u2i.vert.out
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
GL_ARB_gpu_shader5.u2i.vert
|
||||||
|
WARNING: 0:2: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5
|
||||||
|
|
||||||
|
Shader version: 150
|
||||||
|
Requested GL_ARB_gpu_shader5
|
||||||
|
0:? Sequence
|
||||||
|
0:7 Function Definition: main( ( global void)
|
||||||
|
0:7 Function Parameters:
|
||||||
|
0:9 Sequence
|
||||||
|
0:9 Sequence
|
||||||
|
0:9 move second child to first child ( temp uint)
|
||||||
|
0:9 'v' ( temp uint)
|
||||||
|
0:9 Constant:
|
||||||
|
0:9 0 (const uint)
|
||||||
|
0:10 move second child to first child ( temp uint)
|
||||||
|
0:10 'v' ( temp uint)
|
||||||
|
0:10 subtract ( temp uint)
|
||||||
|
0:10 Convert int to uint ( temp uint)
|
||||||
|
0:10 'u2' ( uniform int)
|
||||||
|
0:10 Convert int to uint ( temp uint)
|
||||||
|
0:10 'u1' ( uniform int)
|
||||||
|
0:? Linker Objects
|
||||||
|
0:? 'u1' ( uniform int)
|
||||||
|
0:? 'u2' ( uniform int)
|
||||||
|
0:? 'result' ( smooth out 4-component vector of float)
|
||||||
|
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
|
||||||
|
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
|
||||||
|
|
||||||
|
|
||||||
|
Linked vertex stage:
|
||||||
|
|
||||||
|
|
||||||
|
Shader version: 150
|
||||||
|
Requested GL_ARB_gpu_shader5
|
||||||
|
0:? Sequence
|
||||||
|
0:7 Function Definition: main( ( global void)
|
||||||
|
0:7 Function Parameters:
|
||||||
|
0:9 Sequence
|
||||||
|
0:9 Sequence
|
||||||
|
0:9 move second child to first child ( temp uint)
|
||||||
|
0:9 'v' ( temp uint)
|
||||||
|
0:9 Constant:
|
||||||
|
0:9 0 (const uint)
|
||||||
|
0:10 move second child to first child ( temp uint)
|
||||||
|
0:10 'v' ( temp uint)
|
||||||
|
0:10 subtract ( temp uint)
|
||||||
|
0:10 Convert int to uint ( temp uint)
|
||||||
|
0:10 'u2' ( uniform int)
|
||||||
|
0:10 Convert int to uint ( temp uint)
|
||||||
|
0:10 'u1' ( uniform int)
|
||||||
|
0:? Linker Objects
|
||||||
|
0:? 'u1' ( uniform int)
|
||||||
|
0:? 'u2' ( uniform int)
|
||||||
|
0:? 'result' ( smooth out 4-component vector of float)
|
||||||
|
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
|
||||||
|
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
|
||||||
|
|
@ -1739,7 +1739,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||||||
case EbtUint:
|
case EbtUint:
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
return version >= 400 || getSource() == EShSourceHlsl;
|
return version >= 400 || getSource() == EShSourceHlsl || IsRequestedExtension(E_GL_ARB_gpu_shader5);
|
||||||
case EbtBool:
|
case EbtBool:
|
||||||
return getSource() == EShSourceHlsl;
|
return getSource() == EShSourceHlsl;
|
||||||
case EbtInt16:
|
case EbtInt16:
|
||||||
|
@ -926,6 +926,11 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsRequestedExtension(const char* extension) const
|
||||||
|
{
|
||||||
|
return (requestedExtensions.find(extension) != requestedExtensions.end());
|
||||||
|
}
|
||||||
|
|
||||||
void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee);
|
void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee);
|
||||||
void merge(TInfoSink&, TIntermediate&);
|
void merge(TInfoSink&, TIntermediate&);
|
||||||
void finalCheck(TInfoSink&, bool keepUncalled);
|
void finalCheck(TInfoSink&, bool keepUncalled);
|
||||||
|
@ -282,6 +282,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
"terminate.vert",
|
"terminate.vert",
|
||||||
"negativeWorkGroupSize.comp",
|
"negativeWorkGroupSize.comp",
|
||||||
"textureoffset_sampler2darrayshadow.vert",
|
"textureoffset_sampler2darrayshadow.vert",
|
||||||
|
"GL_ARB_gpu_shader5.u2i.vert",
|
||||||
})),
|
})),
|
||||||
FileNameAsCustomTestSuffix
|
FileNameAsCustomTestSuffix
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user