Add support for GL_NV_shader_noperspective_interpolation

This commit is contained in:
Ben Clayton 2018-03-12 15:12:38 +00:00
parent 845860d565
commit 017a567be1
11 changed files with 1118 additions and 1073 deletions

View File

@ -1,7 +1,7 @@
300.frag
ERROR: 0:2: 'float' : type requires declaration of default precision qualifier
ERROR: 0:30: 'noperspective' : Reserved word.
ERROR: 0:30: 'noperspective' : not supported with this profile: es
ERROR: 0:30: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads
ERROR: 0:32: 'uint' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type
ERROR: 0:39: 'structure' : must be qualified as flat in

View File

@ -105,7 +105,7 @@ ERROR: 0:346: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragm
ERROR: 0:347: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:348: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:349: 'noperspective' : Reserved word.
ERROR: 0:349: 'noperspective' : not supported with this profile: es
ERROR: 0:349: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:349: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:355: 'interpolateAtCentroid' : required extension not requested: GL_OES_shader_multisample_interpolation
ERROR: 0:356: 'interpolateAtSample' : required extension not requested: GL_OES_shader_multisample_interpolation

View File

@ -21,7 +21,7 @@ ERROR: 0:48: 'assign' : l-value required (can't modify a const)
ERROR: 0:51: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:52: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:53: 'noperspective' : Reserved word.
ERROR: 0:53: 'noperspective' : not supported with this profile: es
ERROR: 0:53: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:54: 'sample' : Reserved word.
ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample)

View File

@ -23,7 +23,7 @@ ERROR: 0:157: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragm
ERROR: 0:158: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:159: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:160: 'noperspective' : Reserved word.
ERROR: 0:160: 'noperspective' : not supported with this profile: es
ERROR: 0:160: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:160: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:165: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output
ERROR: 0:180: 'interpolateAtCentroid' : no matching overloaded function found

View File

@ -21,7 +21,7 @@ ERROR: 0:44: 'assign' : l-value required (can't modify a const)
ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:49: 'noperspective' : Reserved word.
ERROR: 0:49: 'noperspective' : not supported with this profile: es
ERROR: 0:49: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized

View File

@ -962,7 +962,7 @@ int TScanContext::tokenizeIdentifier()
case PATCH:
if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile == EEsProfile &&
(parseContext.version >= 320 ||
(parseContext.version >= 320 ||
parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) ||
(parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader)))
return keyword;
@ -1450,6 +1450,11 @@ int TScanContext::tokenizeIdentifier()
#endif
case NOPERSPECTIVE:
#ifdef NV_EXTENSIONS
if (parseContext.profile == EEsProfile && parseContext.version >= 300 &&
parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation))
return keyword;
#endif
return es30ReservedFromGLSL(130);
case SMOOTH:

View File

@ -225,6 +225,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable;
extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable;
extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable;
extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable;
#endif
// AEP
@ -319,6 +320,13 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_OES_texture_cube_map_array 1\n"
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
;
#ifdef NV_EXTENSIONS
if (profile == EEsProfile && version >= 300) {
preamble += "#define GL_NV_shader_noperspective_interpolation 1\n";
}
#endif
} else {
preamble =
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"

View File

@ -196,6 +196,7 @@ const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_
const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes";
const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64";
const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation";
const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation";
// Arrays of extensions for the above viewportEXTs duplications

View File

@ -1117,7 +1117,11 @@ interpolation_qualifier
}
| NOPERSPECTIVE {
parseContext.globalCheck($1.loc, "noperspective");
#ifdef NV_EXTENSIONS
parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
#else
parseContext.requireProfile($1.loc, ~EEsProfile, "noperspective");
#endif
parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective");
$$.init($1.loc);
$$.qualifier.nopersp = true;

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0. */
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -437,7 +437,7 @@ extern int yydebug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */
@ -477,6 +477,8 @@ union YYSTYPE
#line 479 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif