This commit is contained in:
Branimir Karadžić 2017-12-15 19:24:31 -08:00
Родитель 07a173e248
Коммит 65d402479f
38 изменённых файлов: 998 добавлений и 162 удалений

7
3rdparty/glslang/SPIRV/GLSL.ext.AMD.h поставляемый
Просмотреть файл

@ -104,14 +104,7 @@ static const char* const E_SPV_AMD_gpu_shader_int16 = "SPV_AMD_gpu_shader_int16"
// SPV_AMD_shader_image_load_store_lod // SPV_AMD_shader_image_load_store_lod
static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader_image_load_store_lod"; static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader_image_load_store_lod";
static const Capability CapabilityImageReadWriteLodAMD = static_cast<Capability>(5015);
// SPV_AMD_shader_fragment_mask // SPV_AMD_shader_fragment_mask
static const char* const E_SPV_AMD_shader_fragment_mask = "SPV_AMD_shader_fragment_mask"; static const char* const E_SPV_AMD_shader_fragment_mask = "SPV_AMD_shader_fragment_mask";
static const Capability CapabilityFragmentMaskAMD = static_cast<Capability>(5010);
static const Op OpFragmentMaskFetchAMD = static_cast<Op>(5011);
static const Op OpFragmentFetchAMD = static_cast<Op>(5012);
#endif // #ifndef GLSLextAMD_H #endif // #ifndef GLSLextAMD_H

39
3rdparty/glslang/SPIRV/GLSL.ext.EXT.h поставляемый Normal file
Просмотреть файл

@ -0,0 +1,39 @@
/*
** Copyright (c) 2014-2016 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and/or associated documentation files (the "Materials"),
** to deal in the Materials without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Materials, and to permit persons to whom the
** Materials are furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Materials.
**
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
** IN THE MATERIALS.
*/
#ifndef GLSLextEXT_H
#define GLSLextEXT_H
enum BuiltIn;
enum Op;
enum Capability;
static const int GLSLextEXTVersion = 100;
static const int GLSLextEXTRevision = 1;
static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered";
#endif // #ifndef GLSLextEXT_H

29
3rdparty/glslang/SPIRV/GlslangToSpv.cpp поставляемый
Просмотреть файл

@ -44,6 +44,7 @@
namespace spv { namespace spv {
#include "GLSL.std.450.h" #include "GLSL.std.450.h"
#include "GLSL.ext.KHR.h" #include "GLSL.ext.KHR.h"
#include "GLSL.ext.EXT.h"
#ifdef AMD_EXTENSIONS #ifdef AMD_EXTENSIONS
#include "GLSL.ext.AMD.h" #include "GLSL.ext.AMD.h"
#endif #endif
@ -646,6 +647,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addCapability(spv::CapabilityPerViewAttributesNV); builder.addCapability(spv::CapabilityPerViewAttributesNV);
} }
return spv::BuiltInViewportMaskPerViewNV; return spv::BuiltInViewportMaskPerViewNV;
case glslang::EbvFragFullyCoveredNV:
builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered);
builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT);
return spv::BuiltInFullyCoveredEXT;
#endif #endif
default: default:
return spv::BuiltInMax; return spv::BuiltInMax;
@ -2656,13 +2661,6 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
builder.addCapability(spv::CapabilityGeometryStreams); builder.addCapability(spv::CapabilityGeometryStreams);
builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream);
} }
if (glslangIntermediate->getXfbMode()) {
builder.addCapability(spv::CapabilityTransformFeedback);
if (type.getQualifier().hasXfbStride())
builder.addDecoration(spvType, spv::DecorationXfbStride, type.getQualifier().layoutXfbStride);
if (type.getQualifier().hasXfbBuffer())
builder.addDecoration(spvType, spv::DecorationXfbBuffer, type.getQualifier().layoutXfbBuffer);
}
} }
// Turn the expression forming the array size into an id. // Turn the expression forming the array size into an id.
@ -5503,15 +5501,6 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex); builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex);
if (symbol->getQualifier().hasComponent()) if (symbol->getQualifier().hasComponent())
builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent); builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent);
if (glslangIntermediate->getXfbMode()) {
builder.addCapability(spv::CapabilityTransformFeedback);
if (symbol->getQualifier().hasXfbStride())
builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride);
if (symbol->getQualifier().hasXfbBuffer())
builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer);
if (symbol->getQualifier().hasXfbOffset())
builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutXfbOffset);
}
// atomic counters use this: // atomic counters use this:
if (symbol->getQualifier().hasOffset()) if (symbol->getQualifier().hasOffset())
builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset); builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset);
@ -5538,8 +5527,14 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addCapability(spv::CapabilityTransformFeedback); builder.addCapability(spv::CapabilityTransformFeedback);
if (symbol->getQualifier().hasXfbStride()) if (symbol->getQualifier().hasXfbStride())
builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride); builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride);
if (symbol->getQualifier().hasXfbBuffer()) if (symbol->getQualifier().hasXfbBuffer()) {
builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer);
unsigned stride = glslangIntermediate->getXfbStride(symbol->getQualifier().layoutXfbBuffer);
if (stride != glslang::TQualifier::layoutXfbStrideEnd)
builder.addDecoration(id, spv::DecorationXfbStride, stride);
}
if (symbol->getQualifier().hasXfbOffset())
builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutXfbOffset);
} }
if (symbol->getType().isImage()) { if (symbol->getType().isImage()) {

5
3rdparty/glslang/SPIRV/doc.cpp поставляемый
Просмотреть файл

@ -49,6 +49,7 @@ namespace spv {
extern "C" { extern "C" {
// Include C-based headers that don't have a namespace // Include C-based headers that don't have a namespace
#include "GLSL.ext.KHR.h" #include "GLSL.ext.KHR.h"
#include "GLSL.ext.EXT.h"
#ifdef AMD_EXTENSIONS #ifdef AMD_EXTENSIONS
#include "GLSL.ext.AMD.h" #include "GLSL.ext.AMD.h"
#endif #endif
@ -351,6 +352,8 @@ const char* BuiltInString(int builtIn)
case 5262: return "ViewportMaskPerViewNV"; case 5262: return "ViewportMaskPerViewNV";
#endif #endif
case 5264: return "FullyCoveredEXT";
case BuiltInCeiling: case BuiltInCeiling:
default: return "Bad"; default: return "Bad";
} }
@ -862,6 +865,8 @@ const char* CapabilityString(int info)
case 5260: return "PerViewAttributesNV"; case 5260: return "PerViewAttributesNV";
#endif #endif
case 5265: return "FragmentFullyCoveredEXT";
case CapabilityCeiling: case CapabilityCeiling:
default: return "Bad"; default: return "Bad";
} }

18
3rdparty/glslang/SPIRV/spirv.hpp поставляемый
Просмотреть файл

@ -123,6 +123,7 @@ enum ExecutionMode {
ExecutionModeVecTypeHint = 30, ExecutionModeVecTypeHint = 30,
ExecutionModeContractionOff = 31, ExecutionModeContractionOff = 31,
ExecutionModePostDepthCoverage = 4446, ExecutionModePostDepthCoverage = 4446,
ExecutionModeStencilRefReplacingEXT = 5027,
ExecutionModeMax = 0x7fffffff, ExecutionModeMax = 0x7fffffff,
}; };
@ -450,6 +451,7 @@ enum BuiltIn {
BuiltInSecondaryViewportMaskNV = 5258, BuiltInSecondaryViewportMaskNV = 5258,
BuiltInPositionPerViewNV = 5261, BuiltInPositionPerViewNV = 5261,
BuiltInViewportMaskPerViewNV = 5262, BuiltInViewportMaskPerViewNV = 5262,
BuiltInFullyCoveredEXT = 5264,
BuiltInMax = 0x7fffffff, BuiltInMax = 0x7fffffff,
}; };
@ -641,7 +643,9 @@ enum Capability {
CapabilityAtomicStorageOps = 4445, CapabilityAtomicStorageOps = 4445,
CapabilitySampleMaskPostDepthCoverage = 4447, CapabilitySampleMaskPostDepthCoverage = 4447,
CapabilityImageGatherBiasLodAMD = 5009, CapabilityImageGatherBiasLodAMD = 5009,
CapabilityFragmentMaskAMD = 5010,
CapabilityStencilExportEXT = 5013, CapabilityStencilExportEXT = 5013,
CapabilityImageReadWriteLodAMD = 5015,
CapabilitySampleMaskOverrideCoverageNV = 5249, CapabilitySampleMaskOverrideCoverageNV = 5249,
CapabilityGeometryShaderPassthroughNV = 5251, CapabilityGeometryShaderPassthroughNV = 5251,
CapabilityShaderViewportIndexLayerEXT = 5254, CapabilityShaderViewportIndexLayerEXT = 5254,
@ -649,6 +653,10 @@ enum Capability {
CapabilityShaderViewportMaskNV = 5255, CapabilityShaderViewportMaskNV = 5255,
CapabilityShaderStereoViewNV = 5259, CapabilityShaderStereoViewNV = 5259,
CapabilityPerViewAttributesNV = 5260, CapabilityPerViewAttributesNV = 5260,
CapabilityFragmentFullyCoveredEXT = 5265,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
CapabilityMax = 0x7fffffff, CapabilityMax = 0x7fffffff,
}; };
@ -961,6 +969,16 @@ enum Op {
OpGroupFMaxNonUniformAMD = 5005, OpGroupFMaxNonUniformAMD = 5005,
OpGroupUMaxNonUniformAMD = 5006, OpGroupUMaxNonUniformAMD = 5006,
OpGroupSMaxNonUniformAMD = 5007, OpGroupSMaxNonUniformAMD = 5007,
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
OpSubgroupShuffleXorINTEL = 5574,
OpSubgroupBlockReadINTEL = 5575,
OpSubgroupBlockWriteINTEL = 5576,
OpSubgroupImageBlockReadINTEL = 5577,
OpSubgroupImageBlockWriteINTEL = 5578,
OpMax = 0x7fffffff, OpMax = 0x7fffffff,
}; };

8
3rdparty/glslang/StandAlone/StandAlone.cpp поставляемый
Просмотреть файл

@ -98,6 +98,7 @@ enum TOptions {
EOptionStdin = (1 << 27), EOptionStdin = (1 << 27),
EOptionOptimizeDisable = (1 << 28), EOptionOptimizeDisable = (1 << 28),
EOptionOptimizeSize = (1 << 29), EOptionOptimizeSize = (1 << 29),
EOptionInvertY = (1 << 30),
}; };
// //
@ -519,6 +520,9 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
variableName = argv[1]; variableName = argv[1];
bumpArg(); bumpArg();
break; break;
} else if (lowerword == "invert-y" || // synonyms
lowerword == "iy") {
Options |= EOptionInvertY;
} else { } else {
usage(); usage();
} }
@ -840,6 +844,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
if (Options & EOptionAutoMapLocations) if (Options & EOptionAutoMapLocations)
shader->setAutoMapLocations(true); shader->setAutoMapLocations(true);
if (Options & EOptionInvertY)
shader->setInvertY(true);
// Set up the environment, some subsettings take precedence over earlier // Set up the environment, some subsettings take precedence over earlier
// ways of setting things. // ways of setting things.
if (Options & EOptionSpv) { if (Options & EOptionSpv) {
@ -1359,6 +1366,7 @@ void usage()
" uint32_t array named <name>\n" " uint32_t array named <name>\n"
" initialized with the shader binary code.\n" " initialized with the shader binary code.\n"
" --vn <name> synonym for --variable-name <name>\n" " --vn <name> synonym for --variable-name <name>\n"
" --invert-y | --iy invert position.Y output in vertex shader\n"
); );
exit(EFailUsage); exit(EFailUsage);

6
3rdparty/glslang/Test/440.vert поставляемый
Просмотреть файл

@ -174,6 +174,12 @@ out layout(xfb_buffer=7, xfb_offset=0) bblck10 { // link ERROR, implicit stride
float f; float f;
} bbinst10; } bbinst10;
layout(xfb_buffer = 3) out;
layout(xfb_offset = 32) out gl_PerVertex {
layout(xfb_buffer = 2) float gl_PointSize; // ERROR, change in xfb_buffer
vec4 gl_Position;
};
int drawParamsBad() int drawParamsBad()
{ {
return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested

Просмотреть файл

@ -1,7 +1,7 @@
400.geom 400.geom
ERROR: 0:12: 'invocations' : can only apply to a standalone qualifier ERROR: 0:12: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:20: 'patch' : not supported in this stage: geometry ERROR: 0:20: 'patch' : not supported in this stage: geometry
ERROR: 0:20: 'gl_PointSize' : cannot add layout to redeclared block member ERROR: 0:20: 'gl_PointSize' : cannot add non-XFB layout to redeclared block member
ERROR: 0:20: 'gl_PointSize' : cannot add patch to redeclared block member ERROR: 0:20: 'gl_PointSize' : cannot add patch to redeclared block member
ERROR: 0:25: 'length' : array must first be sized by a redeclaration or layout qualifier ERROR: 0:25: 'length' : array must first be sized by a redeclaration or layout qualifier
ERROR: 0:36: 'length' : array must first be sized by a redeclaration or layout qualifier ERROR: 0:36: 'length' : array must first be sized by a redeclaration or layout qualifier

Просмотреть файл

@ -46,51 +46,52 @@ ERROR: 0:166: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers
ERROR: 0:169: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 ERROR: 0:169: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
ERROR: 0:169: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64 ERROR: 0:169: 'xfb_stride' : 1/4 stride is too large: gl_MaxTransformFeedbackInterleavedComponents is 64
ERROR: 0:171: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4 ERROR: 0:171: 'xfb_buffer' : buffer is too large: gl_MaxTransformFeedbackBuffers is 4
ERROR: 0:179: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters ERROR: 0:179: 'xfb_buffer' : member cannot contradict block (or what block inherited from global)
ERROR: 0:179: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters ERROR: 0:185: 'gl_BaseVertexARB' : required extension not requested: GL_ARB_shader_draw_parameters
ERROR: 0:179: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters ERROR: 0:185: 'gl_BaseInstanceARB' : required extension not requested: GL_ARB_shader_draw_parameters
ERROR: 0:187: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shader input) ERROR: 0:185: 'gl_DrawIDARB' : required extension not requested: GL_ARB_shader_draw_parameters
ERROR: 0:188: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input) ERROR: 0:193: 'assign' : l-value required "gl_BaseVertexARB" (can't modify shader input)
ERROR: 0:189: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input) ERROR: 0:194: 'assign' : l-value required "gl_BaseInstanceARB" (can't modify shader input)
ERROR: 0:190: 'glBaseInstanceARB' : undeclared identifier ERROR: 0:195: 'assign' : l-value required "gl_DrawIDARB" (can't modify shader input)
ERROR: 54 compilation errors. No code generated. ERROR: 0:196: 'glBaseInstanceARB' : undeclared identifier
ERROR: 55 compilation errors. No code generated.
Shader version: 440 Shader version: 440
Requested GL_ARB_shader_draw_parameters Requested GL_ARB_shader_draw_parameters
in xfb mode in xfb mode
ERROR: node is still EOpNull! ERROR: node is still EOpNull!
0:177 Function Definition: drawParamsBad( ( global int) 0:183 Function Definition: drawParamsBad( ( global int)
0:177 Function Parameters: 0:183 Function Parameters:
0:179 Sequence 0:185 Sequence
0:179 Branch: Return with expression 0:185 Branch: Return with expression
0:179 add ( temp int) 0:185 add ( temp int)
0:179 add ( temp int) 0:185 add ( temp int)
0:179 'gl_BaseVertexARB' ( in int BaseVertex) 0:185 'gl_BaseVertexARB' ( in int BaseVertex)
0:179 'gl_BaseInstanceARB' ( in int BaseInstance) 0:185 'gl_BaseInstanceARB' ( in int BaseInstance)
0:179 'gl_DrawIDARB' ( in int DrawId) 0:185 'gl_DrawIDARB' ( in int DrawId)
0:184 Function Definition: drawParams( ( global int) 0:190 Function Definition: drawParams( ( global int)
0:184 Function Parameters: 0:190 Function Parameters:
0:186 Sequence 0:192 Sequence
0:186 Branch: Return with expression 0:192 Branch: Return with expression
0:186 add ( temp int) 0:192 add ( temp int)
0:186 add ( temp int) 0:192 add ( temp int)
0:186 'gl_BaseVertexARB' ( in int BaseVertex) 0:192 'gl_BaseVertexARB' ( in int BaseVertex)
0:186 'gl_BaseInstanceARB' ( in int BaseInstance) 0:192 'gl_BaseInstanceARB' ( in int BaseInstance)
0:186 'gl_DrawIDARB' ( in int DrawId) 0:192 'gl_DrawIDARB' ( in int DrawId)
0:187 move second child to first child ( temp int) 0:193 move second child to first child ( temp int)
0:187 'gl_BaseVertexARB' ( in int BaseVertex) 0:193 'gl_BaseVertexARB' ( in int BaseVertex)
0:187 Constant: 0:193 Constant:
0:187 3 (const int) 0:193 3 (const int)
0:188 move second child to first child ( temp int) 0:194 move second child to first child ( temp int)
0:188 'gl_BaseInstanceARB' ( in int BaseInstance) 0:194 'gl_BaseInstanceARB' ( in int BaseInstance)
0:188 Constant: 0:194 Constant:
0:188 3 (const int) 0:194 3 (const int)
0:189 move second child to first child ( temp int) 0:195 move second child to first child ( temp int)
0:189 'gl_DrawIDARB' ( in int DrawId) 0:195 'gl_DrawIDARB' ( in int DrawId)
0:189 Constant: 0:195 Constant:
0:189 3 (const int) 0:195 3 (const int)
0:190 'glBaseInstanceARB' ( temp float) 0:196 'glBaseInstanceARB' ( temp float)
0:? Linker Objects 0:? Linker Objects
0:? 'a' (layout( location=2 component=2) in 2-component vector of float) 0:? 'a' (layout( location=2 component=2) in 2-component vector of float)
0:? 'b' (layout( location=2 component=1) in float) 0:? 'b' (layout( location=2 component=1) in float)
@ -153,6 +154,7 @@ ERROR: node is still EOpNull!
0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s}) 0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s})
0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float) 0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float)
0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f}) 0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f})
0:? 'anon@0' ( out block{layout( xfb_buffer=0 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=0 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, })
0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
@ -235,6 +237,7 @@ ERROR: node is still EOpNull!
0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s}) 0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s})
0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float) 0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float)
0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f}) 0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f})
0:? 'anon@0' ( out block{layout( xfb_buffer=0 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=0 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, })
0:? 'gl_VertexID' ( gl_VertexId int VertexId) 0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) 0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)

Просмотреть файл

@ -159,10 +159,9 @@ triangle order = cw
0:? 'cpid' ( in uint InvocationID) 0:? 'cpid' ( in uint InvocationID)
0:39 Sequence 0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float) 0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position) 0:39 indirect index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant: 0:? 'cpid' ( in uint InvocationID)
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) 0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
@ -400,10 +399,9 @@ triangle order = cw
0:? 'cpid' ( in uint InvocationID) 0:? 'cpid' ( in uint InvocationID)
0:39 Sequence 0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float) 0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position) 0:39 indirect index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant: 0:? 'cpid' ( in uint InvocationID)
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal}) 0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
@ -479,12 +477,12 @@ triangle order = cw
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80002 // Generated by (magic number): 80002
// Id's are bound by 127 // Id's are bound by 128
Capability Tessellation Capability Tessellation
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 56 64 83 86 110 123 EntryPoint TessellationControl 4 "main" 56 64 83 86 111 124
ExecutionMode 4 OutputVertices 3 ExecutionMode 4 OutputVertices 3
ExecutionMode 4 Triangles ExecutionMode 4 Triangles
ExecutionMode 4 SpacingFractionalOdd ExecutionMode 4 SpacingFractionalOdd
@ -514,20 +512,20 @@ triangle order = cw
Name 81 "cpid" Name 81 "cpid"
Name 83 "cpid" Name 83 "cpid"
Name 86 "@entryPointOutput.m_Position" Name 86 "@entryPointOutput.m_Position"
Name 87 "param" Name 88 "param"
Name 89 "param" Name 90 "param"
Name 103 "@patchConstantResult" Name 104 "@patchConstantResult"
Name 104 "param" Name 105 "param"
Name 110 "@patchConstantOutput.fTessFactor" Name 111 "@patchConstantOutput.fTessFactor"
Name 123 "@patchConstantOutput.fInsideTessFactor" Name 124 "@patchConstantOutput.fInsideTessFactor"
Decorate 56(I.m_Position) BuiltIn Position Decorate 56(I.m_Position) BuiltIn Position
Decorate 64(I) Location 0 Decorate 64(I) Location 0
Decorate 83(cpid) BuiltIn InvocationId Decorate 83(cpid) BuiltIn InvocationId
Decorate 86(@entryPointOutput.m_Position) BuiltIn Position Decorate 86(@entryPointOutput.m_Position) BuiltIn Position
Decorate 110(@patchConstantOutput.fTessFactor) Patch Decorate 111(@patchConstantOutput.fTessFactor) Patch
Decorate 110(@patchConstantOutput.fTessFactor) BuiltIn TessLevelOuter Decorate 111(@patchConstantOutput.fTessFactor) BuiltIn TessLevelOuter
Decorate 123(@patchConstantOutput.fInsideTessFactor) Patch Decorate 124(@patchConstantOutput.fInsideTessFactor) Patch
Decorate 123(@patchConstantOutput.fInsideTessFactor) BuiltIn TessLevelInner Decorate 124(@patchConstantOutput.fInsideTessFactor) BuiltIn TessLevelInner
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -568,27 +566,27 @@ triangle order = cw
83(cpid): 82(ptr) Variable Input 83(cpid): 82(ptr) Variable Input
85: TypePointer Output 54 85: TypePointer Output 54
86(@entryPointOutput.m_Position): 85(ptr) Variable Output 86(@entryPointOutput.m_Position): 85(ptr) Variable Output
93: TypePointer Output 7(fvec4) 94: TypePointer Output 7(fvec4)
95: 9(int) Constant 2 96: 9(int) Constant 2
96: 9(int) Constant 1 97: 9(int) Constant 1
97: 9(int) Constant 0 98: 9(int) Constant 0
99: TypeBool 100: TypeBool
107: 9(int) Constant 4 108: 9(int) Constant 4
108: TypeArray 6(float) 107 109: TypeArray 6(float) 108
109: TypePointer Output 108 110: TypePointer Output 109
110(@patchConstantOutput.fTessFactor): 109(ptr) Variable Output 111(@patchConstantOutput.fTessFactor): 110(ptr) Variable Output
113: TypePointer Output 6(float) 114: TypePointer Output 6(float)
121: TypeArray 6(float) 95 122: TypeArray 6(float) 96
122: TypePointer Output 121 123: TypePointer Output 122
123(@patchConstantOutput.fInsideTessFactor): 122(ptr) Variable Output 124(@patchConstantOutput.fInsideTessFactor): 123(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
53(I): 12(ptr) Variable Function 53(I): 12(ptr) Variable Function
81(cpid): 19(ptr) Variable Function 81(cpid): 19(ptr) Variable Function
87(param): 12(ptr) Variable Function 88(param): 12(ptr) Variable Function
89(param): 19(ptr) Variable Function 90(param): 19(ptr) Variable Function
103(@patchConstantResult): 26(ptr) Variable Function 104(@patchConstantResult): 26(ptr) Variable Function
104(param): 12(ptr) Variable Function 105(param): 12(ptr) Variable Function
58: 57(ptr) AccessChain 56(I.m_Position) 33 58: 57(ptr) AccessChain 56(I.m_Position) 33
59: 7(fvec4) Load 58 59: 7(fvec4) Load 58
60: 48(ptr) AccessChain 53(I) 33 33 60: 48(ptr) AccessChain 53(I) 33 33
@ -615,42 +613,43 @@ triangle order = cw
Store 80 79 Store 80 79
84: 9(int) Load 83(cpid) 84: 9(int) Load 83(cpid)
Store 81(cpid) 84 Store 81(cpid) 84
88: 11 Load 53(I) 87: 9(int) Load 83(cpid)
Store 87(param) 88 89: 11 Load 53(I)
90: 9(int) Load 81(cpid) Store 88(param) 89
Store 89(param) 90 91: 9(int) Load 81(cpid)
91:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 87(param) 89(param) Store 90(param) 91
92: 7(fvec4) CompositeExtract 91 0 92:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 88(param) 90(param)
94: 93(ptr) AccessChain 86(@entryPointOutput.m_Position) 33 93: 7(fvec4) CompositeExtract 92 0
Store 94 92 95: 94(ptr) AccessChain 86(@entryPointOutput.m_Position) 87
ControlBarrier 95 96 97 Store 95 93
98: 9(int) Load 83(cpid) ControlBarrier 96 97 98
100: 99(bool) IEqual 98 33 99: 9(int) Load 83(cpid)
SelectionMerge 102 None 101: 100(bool) IEqual 99 33
BranchConditional 100 101 102 SelectionMerge 103 None
101: Label BranchConditional 101 102 103
105: 11 Load 53(I) 102: Label
Store 104(param) 105 106: 11 Load 53(I)
106:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 104(param) Store 105(param) 106
Store 103(@patchConstantResult) 106 107:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 105(param)
111: 34(ptr) AccessChain 103(@patchConstantResult) 33 33 Store 104(@patchConstantResult) 107
112: 6(float) Load 111 112: 34(ptr) AccessChain 104(@patchConstantResult) 33 33
114: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 33 113: 6(float) Load 112
Store 114 112 115: 114(ptr) AccessChain 111(@patchConstantOutput.fTessFactor) 33
115: 34(ptr) AccessChain 103(@patchConstantResult) 33 32 Store 115 113
116: 6(float) Load 115 116: 34(ptr) AccessChain 104(@patchConstantResult) 33 32
117: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 32 117: 6(float) Load 116
Store 117 116 118: 114(ptr) AccessChain 111(@patchConstantOutput.fTessFactor) 32
118: 34(ptr) AccessChain 103(@patchConstantResult) 33 74 Store 118 117
119: 6(float) Load 118 119: 34(ptr) AccessChain 104(@patchConstantResult) 33 74
120: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 74 120: 6(float) Load 119
Store 120 119 121: 114(ptr) AccessChain 111(@patchConstantOutput.fTessFactor) 74
124: 34(ptr) AccessChain 103(@patchConstantResult) 32 Store 121 120
125: 6(float) Load 124 125: 34(ptr) AccessChain 104(@patchConstantResult) 32
126: 113(ptr) AccessChain 123(@patchConstantOutput.fInsideTessFactor) 33 126: 6(float) Load 125
Store 126 125 127: 114(ptr) AccessChain 124(@patchConstantOutput.fInsideTessFactor) 33
Branch 102 Store 127 126
102: Label Branch 103
103: Label
Return Return
FunctionEnd FunctionEnd
17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];):14(HS_Output) Function None 15 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];):14(HS_Output) Function None 15

Просмотреть файл

@ -80,10 +80,9 @@ ERROR: node is still EOpNull!
0:? 'cpid' ( in uint InvocationID) 0:? 'cpid' ( in uint InvocationID)
0:39 Sequence 0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float) 0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position) 0:39 indirect index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant: 0:? 'cpid' ( in uint InvocationID)
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'cpid' ( temp uint) 0:? 'cpid' ( temp uint)
@ -174,10 +173,9 @@ ERROR: node is still EOpNull!
0:? 'cpid' ( in uint InvocationID) 0:? 'cpid' ( in uint InvocationID)
0:39 Sequence 0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float) 0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position) 0:39 indirect index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position) 0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant: 0:? 'cpid' ( in uint InvocationID)
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float) 0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position}) 0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'cpid' ( temp uint) 0:? 'cpid' ( temp uint)

113
3rdparty/glslang/Test/baseResults/hlsl.y-negate-1.vert.out поставляемый Normal file
Просмотреть файл

@ -0,0 +1,113 @@
hlsl.y-negate-1.vert
Shader version: 500
0:? Sequence
0:7 Function Definition: @main( ( temp 4-component vector of float)
0:7 Function Parameters:
0:? Sequence
0:8 Branch: Return with expression
0:8 pos: direct index for structure ( uniform 4-component vector of float)
0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:8 Constant:
0:8 0 (const uint)
0:7 Function Definition: main( ( temp void)
0:7 Function Parameters:
0:? Sequence
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 '@position' ( temp 4-component vector of float)
0:7 Function Call: @main( ( temp 4-component vector of float)
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 '@position' ( temp 4-component vector of float)
0:7 Constant:
0:7 1 (const int)
0:7 Negate value ( temp float)
0:7 direct index ( temp float)
0:7 '@position' ( temp 4-component vector of float)
0:7 Constant:
0:7 1 (const int)
0:7 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' ( out 4-component vector of float Position)
0:7 '@position' ( temp 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:? '@entryPointOutput' ( out 4-component vector of float Position)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:7 Function Definition: @main( ( temp 4-component vector of float)
0:7 Function Parameters:
0:? Sequence
0:8 Branch: Return with expression
0:8 pos: direct index for structure ( uniform 4-component vector of float)
0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:8 Constant:
0:8 0 (const uint)
0:7 Function Definition: main( ( temp void)
0:7 Function Parameters:
0:? Sequence
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 '@position' ( temp 4-component vector of float)
0:7 Function Call: @main( ( temp 4-component vector of float)
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 '@position' ( temp 4-component vector of float)
0:7 Constant:
0:7 1 (const int)
0:7 Negate value ( temp float)
0:7 direct index ( temp float)
0:7 '@position' ( temp 4-component vector of float)
0:7 Constant:
0:7 1 (const int)
0:7 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' ( out 4-component vector of float Position)
0:7 '@position' ( temp 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 41
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 32
Source HLSL 500
Name 4 "main"
Name 11 "$Global"
MemberName 11($Global) 0 "pos"
Name 13 ""
Name 32 "@entryPointOutput"
MemberDecorate 11($Global) 0 Offset 0
Decorate 11($Global) Block
Decorate 13 DescriptorSet 0
Decorate 32(@entryPointOutput) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
11($Global): TypeStruct 7(fvec4)
12: TypePointer Uniform 11($Global)
13: 12(ptr) Variable Uniform
14: TypeInt 32 1
15: 14(int) Constant 0
16: TypePointer Uniform 7(fvec4)
31: TypePointer Output 7(fvec4)
32(@entryPointOutput): 31(ptr) Variable Output
4(main): 2 Function None 3
5: Label
35: 16(ptr) AccessChain 13 15
36: 7(fvec4) Load 35
38: 6(float) CompositeExtract 36 1
29: 6(float) FNegate 38
40: 7(fvec4) CompositeInsert 29 36 1
Store 32(@entryPointOutput) 40
Return
FunctionEnd

121
3rdparty/glslang/Test/baseResults/hlsl.y-negate-2.vert.out поставляемый Normal file
Просмотреть файл

@ -0,0 +1,121 @@
hlsl.y-negate-2.vert
Shader version: 500
0:? Sequence
0:6 Function Definition: @main(vf4; ( temp void)
0:6 Function Parameters:
0:6 'position' ( out 4-component vector of float)
0:? Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'position' ( out 4-component vector of float)
0:7 pos: direct index for structure ( uniform 4-component vector of float)
0:7 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:7 Constant:
0:7 0 (const uint)
0:6 Function Definition: main( ( temp void)
0:6 Function Parameters:
0:? Sequence
0:6 Function Call: @main(vf4; ( temp void)
0:? 'position' ( temp 4-component vector of float)
0:6 Sequence
0:6 move second child to first child ( temp 4-component vector of float)
0:6 '@position' ( temp 4-component vector of float)
0:? 'position' ( temp 4-component vector of float)
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float)
0:6 '@position' ( temp 4-component vector of float)
0:6 Constant:
0:6 1 (const int)
0:6 Negate value ( temp float)
0:6 direct index ( temp float)
0:6 '@position' ( temp 4-component vector of float)
0:6 Constant:
0:6 1 (const int)
0:6 move second child to first child ( temp 4-component vector of float)
0:? 'position' ( out 4-component vector of float Position)
0:6 '@position' ( temp 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:? 'position' ( out 4-component vector of float Position)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:6 Function Definition: @main(vf4; ( temp void)
0:6 Function Parameters:
0:6 'position' ( out 4-component vector of float)
0:? Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'position' ( out 4-component vector of float)
0:7 pos: direct index for structure ( uniform 4-component vector of float)
0:7 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:7 Constant:
0:7 0 (const uint)
0:6 Function Definition: main( ( temp void)
0:6 Function Parameters:
0:? Sequence
0:6 Function Call: @main(vf4; ( temp void)
0:? 'position' ( temp 4-component vector of float)
0:6 Sequence
0:6 move second child to first child ( temp 4-component vector of float)
0:6 '@position' ( temp 4-component vector of float)
0:? 'position' ( temp 4-component vector of float)
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float)
0:6 '@position' ( temp 4-component vector of float)
0:6 Constant:
0:6 1 (const int)
0:6 Negate value ( temp float)
0:6 direct index ( temp float)
0:6 '@position' ( temp 4-component vector of float)
0:6 Constant:
0:6 1 (const int)
0:6 move second child to first child ( temp 4-component vector of float)
0:? 'position' ( out 4-component vector of float Position)
0:6 '@position' ( temp 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float pos})
0:? 'position' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 43
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 35
Source HLSL 500
Name 4 "main"
Name 13 "$Global"
MemberName 13($Global) 0 "pos"
Name 15 ""
Name 35 "position"
MemberDecorate 13($Global) 0 Offset 0
Decorate 13($Global) Block
Decorate 15 DescriptorSet 0
Decorate 35(position) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
13($Global): TypeStruct 7(fvec4)
14: TypePointer Uniform 13($Global)
15: 14(ptr) Variable Uniform
16: TypeInt 32 1
17: 16(int) Constant 0
18: TypePointer Uniform 7(fvec4)
34: TypePointer Output 7(fvec4)
35(position): 34(ptr) Variable Output
4(main): 2 Function None 3
5: Label
37: 18(ptr) AccessChain 15 17
38: 7(fvec4) Load 37
40: 6(float) CompositeExtract 38 1
32: 6(float) FNegate 40
42: 7(fvec4) CompositeInsert 32 38 1
Store 35(position) 42
Return
FunctionEnd

177
3rdparty/glslang/Test/baseResults/hlsl.y-negate-3.vert.out поставляемый Normal file
Просмотреть файл

@ -0,0 +1,177 @@
hlsl.y-negate-3.vert
Shader version: 500
0:? Sequence
0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Function Parameters:
0:? Sequence
0:14 move second child to first child ( temp 4-component vector of float)
0:14 pos: direct index for structure ( temp 4-component vector of float)
0:14 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:14 Constant:
0:14 0 (const int)
0:14 position: direct index for structure ( uniform 4-component vector of float)
0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position})
0:14 Constant:
0:14 0 (const uint)
0:15 move second child to first child ( temp int)
0:15 somethingelse: direct index for structure ( temp int)
0:15 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:15 Constant:
0:15 1 (const int)
0:15 Constant:
0:15 42 (const int)
0:17 Branch: Return with expression
0:17 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:11 '@position' ( temp 4-component vector of float)
0:11 pos: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:11 '@position' ( temp 4-component vector of float)
0:11 Constant:
0:11 1 (const int)
0:11 Negate value ( temp float)
0:11 direct index ( temp float)
0:11 '@position' ( temp 4-component vector of float)
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.pos' ( out 4-component vector of float Position)
0:11 '@position' ( temp 4-component vector of float)
0:11 move second child to first child ( temp int)
0:? '@entryPointOutput.somethingelse' (layout( location=0) out int)
0:11 somethingelse: direct index for structure ( temp int)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Constant:
0:11 1 (const int)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position})
0:? '@entryPointOutput.pos' ( out 4-component vector of float Position)
0:? '@entryPointOutput.somethingelse' (layout( location=0) out int)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:11 Function Definition: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Function Parameters:
0:? Sequence
0:14 move second child to first child ( temp 4-component vector of float)
0:14 pos: direct index for structure ( temp 4-component vector of float)
0:14 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:14 Constant:
0:14 0 (const int)
0:14 position: direct index for structure ( uniform 4-component vector of float)
0:14 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position})
0:14 Constant:
0:14 0 (const uint)
0:15 move second child to first child ( temp int)
0:15 somethingelse: direct index for structure ( temp int)
0:15 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:15 Constant:
0:15 1 (const int)
0:15 Constant:
0:15 42 (const int)
0:17 Branch: Return with expression
0:17 'vsout' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Function Definition: main( ( temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Function Call: @main( ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Sequence
0:11 move second child to first child ( temp 4-component vector of float)
0:11 '@position' ( temp 4-component vector of float)
0:11 pos: direct index for structure ( temp 4-component vector of float)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp float)
0:11 direct index ( temp float)
0:11 '@position' ( temp 4-component vector of float)
0:11 Constant:
0:11 1 (const int)
0:11 Negate value ( temp float)
0:11 direct index ( temp float)
0:11 '@position' ( temp 4-component vector of float)
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.pos' ( out 4-component vector of float Position)
0:11 '@position' ( temp 4-component vector of float)
0:11 move second child to first child ( temp int)
0:? '@entryPointOutput.somethingelse' (layout( location=0) out int)
0:11 somethingelse: direct index for structure ( temp int)
0:11 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp int somethingelse})
0:11 Constant:
0:11 1 (const int)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float position})
0:? '@entryPointOutput.pos' ( out 4-component vector of float Position)
0:? '@entryPointOutput.somethingelse' (layout( location=0) out int)
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 67
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 44 47
Source HLSL 500
Name 4 "main"
Name 9 "VS_OUT"
MemberName 9(VS_OUT) 0 "pos"
MemberName 9(VS_OUT) 1 "somethingelse"
Name 16 "$Global"
MemberName 16($Global) 0 "position"
Name 18 ""
Name 44 "@entryPointOutput.pos"
Name 47 "@entryPointOutput.somethingelse"
MemberDecorate 16($Global) 0 Offset 0
Decorate 16($Global) Block
Decorate 18 DescriptorSet 0
Decorate 44(@entryPointOutput.pos) BuiltIn Position
Decorate 47(@entryPointOutput.somethingelse) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeInt 32 1
9(VS_OUT): TypeStruct 7(fvec4) 8(int)
15: 8(int) Constant 0
16($Global): TypeStruct 7(fvec4)
17: TypePointer Uniform 16($Global)
18: 17(ptr) Variable Uniform
19: TypePointer Uniform 7(fvec4)
25: 8(int) Constant 42
43: TypePointer Output 7(fvec4)
44(@entryPointOutput.pos): 43(ptr) Variable Output
46: TypePointer Output 8(int)
47(@entryPointOutput.somethingelse): 46(ptr) Variable Output
4(main): 2 Function None 3
5: Label
52: 19(ptr) AccessChain 18 15
53: 7(fvec4) Load 52
64: 6(float) CompositeExtract 53 1
41: 6(float) FNegate 64
66: 7(fvec4) CompositeInsert 41 53 1
Store 44(@entryPointOutput.pos) 66
Store 47(@entryPointOutput.somethingelse) 25
Return
FunctionEnd

47
3rdparty/glslang/Test/baseResults/spv.builtInXFB.vert.out поставляемый Executable file
Просмотреть файл

@ -0,0 +1,47 @@
spv.builtInXFB.vert
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 21
Capability Shader
Capability TransformFeedback
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 10
ExecutionMode 4 Xfb
Source GLSL 450
Name 4 "main"
Name 8 "gl_PerVertex"
MemberName 8(gl_PerVertex) 0 "gl_Position"
MemberName 8(gl_PerVertex) 1 "gl_PointSize"
Name 10 ""
MemberDecorate 8(gl_PerVertex) 0 Offset 20
MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 8(gl_PerVertex) 1 Offset 16
MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize
Decorate 8(gl_PerVertex) Block
Decorate 10 XfbBuffer 1
Decorate 10 XfbStride 64
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8(gl_PerVertex): TypeStruct 7(fvec4) 6(float)
9: TypePointer Output 8(gl_PerVertex)
10: 9(ptr) Variable Output
11: TypeInt 32 1
12: 11(int) Constant 0
13: 6(float) Constant 1065353216
14: 7(fvec4) ConstantComposite 13 13 13 13
15: TypePointer Output 7(fvec4)
17: 11(int) Constant 1
18: 6(float) Constant 1073741824
19: TypePointer Output 6(float)
4(main): 2 Function None 3
5: Label
16: 15(ptr) AccessChain 10 12
Store 16 14
20: 19(ptr) AccessChain 10 17
Store 20 18
Return
FunctionEnd

37
3rdparty/glslang/Test/baseResults/spv.fullyCovered.frag.out поставляемый Normal file
Просмотреть файл

@ -0,0 +1,37 @@
spv.fullyCovered.frag
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 18
Capability Shader
Capability FragmentFullyCoveredEXT
Extension "SPV_EXT_fragment_fully_covered"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9 12
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_NV_conservative_raster_underestimation"
Name 4 "main"
Name 9 "color"
Name 12 "gl_FragFullyCoveredNV"
Decorate 12(gl_FragFullyCoveredNV) BuiltIn FullyCoveredEXT
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(color): 8(ptr) Variable Output
10: TypeBool
11: TypePointer Input 10(bool)
12(gl_FragFullyCoveredNV): 11(ptr) Variable Input
14: 6(float) Constant 0
15: 6(float) Constant 1065353216
4(main): 2 Function None 3
5: Label
13: 10(bool) Load 12(gl_FragFullyCoveredNV)
16: 6(float) Select 13 15 14
17: 7(fvec4) CompositeConstruct 16 14 14 14
Store 9(color) 17
Return
FunctionEnd

55
3rdparty/glslang/Test/baseResults/spv.xfb.vert.out поставляемый Executable file
Просмотреть файл

@ -0,0 +1,55 @@
spv.xfb.vert
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 16
Capability Shader
Capability TransformFeedback
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 8 11 14 15
ExecutionMode 4 Xfb
Source GLSL 450
Name 4 "main"
Name 8 "out1"
Name 9 "outXfb"
MemberName 9(outXfb) 0 "out2"
Name 11 ""
Name 12 "outXfb2"
MemberName 12(outXfb2) 0 "out3"
Name 14 ""
Name 15 "out4"
Decorate 8(out1) Location 0
Decorate 8(out1) XfbBuffer 3
Decorate 8(out1) XfbStride 48
Decorate 8(out1) Offset 12
MemberDecorate 9(outXfb) 0 Offset 8
Decorate 9(outXfb) Block
Decorate 11 Location 1
Decorate 11 XfbBuffer 2
Decorate 11 XfbStride 32
MemberDecorate 12(outXfb2) 0 Offset 60
Decorate 12(outXfb2) Block
Decorate 14 Location 3
Decorate 14 XfbBuffer 1
Decorate 14 XfbStride 64
Decorate 15(out4) Location 4
Decorate 15(out4) XfbBuffer 0
Decorate 15(out4) XfbStride 8
Decorate 15(out4) Offset 4
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(out1): 7(ptr) Variable Output
9(outXfb): TypeStruct 6(float)
10: TypePointer Output 9(outXfb)
11: 10(ptr) Variable Output
12(outXfb2): TypeStruct 6(float)
13: TypePointer Output 12(outXfb2)
14: 13(ptr) Variable Output
15(out4): 7(ptr) Variable Output
4(main): 2 Function None 3
5: Label
Return
FunctionEnd

2
3rdparty/glslang/Test/hlsl.PointSize.geom поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
struct S { struct S {
[[vk::builtin("PointSize")]] float ps; [[vk::builtin("PointSize")]] float ps : PSIZE;
}; };
[maxvertexcount(4)] [maxvertexcount(4)]

9
3rdparty/glslang/Test/hlsl.y-negate-1.vert поставляемый Normal file
Просмотреть файл

@ -0,0 +1,9 @@
// Test Y negation from entry point return
float4 pos;
float4 main() : SV_Position
{
return pos;
}

8
3rdparty/glslang/Test/hlsl.y-negate-2.vert поставляемый Normal file
Просмотреть файл

@ -0,0 +1,8 @@
// Test Y negation from entry point out parameter
float4 pos;
void main(out float4 position : SV_Position)
{
position = pos;
}

18
3rdparty/glslang/Test/hlsl.y-negate-3.vert поставляемый Normal file
Просмотреть файл

@ -0,0 +1,18 @@
// Test Y negation from entry point out parameter
float4 position;
struct VS_OUT {
float4 pos : SV_Position;
int somethingelse;
};
VS_OUT main()
{
VS_OUT vsout;
vsout.pos = position;
vsout.somethingelse = 42;
return vsout;
}

11
3rdparty/glslang/Test/runtests поставляемый
Просмотреть файл

@ -186,6 +186,17 @@ diff -b $BASEDIR/remap.invalid-spirv-1.out $TARGETDIR/remap.invalid-spirv-1.out
$REMAPEXE --do-everything -i remap.invalid-spirv-2.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-2.out && HASERROR=1 $REMAPEXE --do-everything -i remap.invalid-spirv-2.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-2.out && HASERROR=1
diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1 diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1
#
# Testing position Y inversion
#
echo "Testing position Y inversion"
$EXE -H -e main -V -D -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out
diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1
$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out
diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1
$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out
diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1
# #
# Final checking # Final checking
# #

15
3rdparty/glslang/Test/spv.builtInXFB.vert поставляемый Normal file
Просмотреть файл

@ -0,0 +1,15 @@
#version 450
layout(xfb_buffer = 1, xfb_stride = 64) out;
layout (xfb_buffer = 1, xfb_offset = 16) out gl_PerVertex
{
float gl_PointSize;
vec4 gl_Position;
};
void main()
{
gl_Position = vec4(1.0);
gl_PointSize = 2.0;
}

9
3rdparty/glslang/Test/spv.fullyCovered.frag поставляемый Normal file
Просмотреть файл

@ -0,0 +1,9 @@
#version 450
#extension GL_NV_conservative_raster_underestimation : enable
out vec4 color;
void main() {
color = vec4(gl_FragFullyCoveredNV, 0, 0, 0);
}

20
3rdparty/glslang/Test/spv.xfb.vert поставляемый Normal file
Просмотреть файл

@ -0,0 +1,20 @@
#version 450
layout(xfb_buffer = 3) out;
layout(xfb_stride = 48) out;
layout(xfb_offset = 12, location = 0) out float out1;
layout(xfb_buffer = 2) out;
layout(location=1) out outXfb {
layout(xfb_buffer = 2, xfb_stride = 32, xfb_offset = 8) float out2;
};
layout(xfb_buffer = 1, location=3) out outXfb2 {
layout(xfb_stride = 64, xfb_offset = 60) float out3;
};
layout(location = 4, xfb_buffer = 0, xfb_offset = 4) out float out4;
void main()
{
}

Просмотреть файл

@ -218,6 +218,7 @@ enum TBuiltInVariable {
EbvSecondaryViewportMaskNV, EbvSecondaryViewportMaskNV,
EbvPositionPerViewNV, EbvPositionPerViewNV,
EbvViewportMaskPerViewNV, EbvViewportMaskPerViewNV,
EbvFragFullyCoveredNV,
#endif #endif
// HLSL built-ins that live only temporarily, until they get remapped // HLSL built-ins that live only temporarily, until they get remapped
@ -355,6 +356,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
case EbvPositionPerViewNV: return "PositionPerViewNV"; case EbvPositionPerViewNV: return "PositionPerViewNV";
case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
case EbvFragFullyCoveredNV: return "FragFullyCoveredNV";
#endif #endif
default: return "unknown built-in variable"; default: return "unknown built-in variable";
} }

8
3rdparty/glslang/glslang/Include/Types.h поставляемый
Просмотреть файл

@ -650,15 +650,19 @@ public:
layoutXfbOffset = layoutXfbOffsetEnd; layoutXfbOffset = layoutXfbOffsetEnd;
} }
bool hasLayout() const bool hasNonXfbLayout() const
{ {
return hasUniformLayout() || return hasUniformLayout() ||
hasAnyLocation() || hasAnyLocation() ||
hasStream() || hasStream() ||
hasXfb() ||
hasFormat() || hasFormat() ||
layoutPushConstant; layoutPushConstant;
} }
bool hasLayout() const
{
return hasNonXfbLayout() ||
hasXfb();
}
TLayoutMatrix layoutMatrix : 3; TLayoutMatrix layoutMatrix : 3;
TLayoutPacking layoutPacking : 4; TLayoutPacking layoutPacking : 4;
int layoutOffset; int layoutOffset;

Просмотреть файл

@ -3963,6 +3963,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in vec3 gl_BaryCoordPullModelAMD;" "in vec3 gl_BaryCoordPullModelAMD;"
); );
#endif #endif
#ifdef NV_EXTENSIONS
if (version >= 430)
stageBuiltins[EShLangFragment].append(
"in bool gl_FragFullyCoveredNV;"
);
#endif
} else { } else {
// ES profile // ES profile
@ -5858,6 +5865,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
} }
#endif #endif
#ifdef NV_EXTENSIONS
if (profile != EEsProfile && version >= 430) {
symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation);
BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable);
}
#endif
symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth);
if (profile == EEsProfile && version < 320) { if (profile == EEsProfile && version < 320) {

Просмотреть файл

@ -2560,7 +2560,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
// now, knowing it is a shader in/out, do all the in/out semantic checks // now, knowing it is a shader in/out, do all the in/out semantic checks
if (publicType.basicType == EbtBool) { if (publicType.basicType == EbtBool && !parsingBuiltins) {
error(loc, "cannot be bool", GetStorageQualifierString(qualifier.storage), ""); error(loc, "cannot be bool", GetStorageQualifierString(qualifier.storage), "");
return; return;
} }
@ -3478,17 +3478,24 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
return; return;
} }
// Fix XFB stuff up, it applies to the order of the redeclaration, not
// the order of the original members.
if (currentBlockQualifier.storage == EvqVaryingOut && globalOutputDefaults.hasXfbBuffer()) {
currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer;
fixBlockXfbOffsets(currentBlockQualifier, newTypeList);
}
// Edit and error check the container against the redeclaration // Edit and error check the container against the redeclaration
// - remove unused members // - remove unused members
// - ensure remaining qualifiers/types match // - ensure remaining qualifiers/types match
TType& type = block->getWritableType(); TType& type = block->getWritableType();
#ifdef NV_EXTENSIONS #ifdef NV_EXTENSIONS
// if gl_PerVertex is redeclared for the purpose of passing through "gl_Position" // if gl_PerVertex is redeclared for the purpose of passing through "gl_Position"
// for passthrough purpose, the redclared block should have the same qualifers as // for passthrough purpose, the redeclared block should have the same qualifers as
// the current one // the current one
if (currentBlockQualifier.layoutPassthrough) if (currentBlockQualifier.layoutPassthrough) {
{
type.getQualifier().layoutPassthrough = currentBlockQualifier.layoutPassthrough; type.getQualifier().layoutPassthrough = currentBlockQualifier.layoutPassthrough;
type.getQualifier().storage = currentBlockQualifier.storage; type.getQualifier().storage = currentBlockQualifier.storage;
type.getQualifier().layoutStream = currentBlockQualifier.layoutStream; type.getQualifier().layoutStream = currentBlockQualifier.layoutStream;
@ -3529,10 +3536,12 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
arrayLimitCheck(loc, member->type->getFieldName(), newType.getOuterArraySize()); arrayLimitCheck(loc, member->type->getFieldName(), newType.getOuterArraySize());
if (newType.getQualifier().isMemory()) if (newType.getQualifier().isMemory())
error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), "");
if (newType.getQualifier().hasLayout()) if (newType.getQualifier().hasNonXfbLayout())
error(memberLoc, "cannot add layout to redeclared block member", member->type->getFieldName().c_str(), ""); error(memberLoc, "cannot add non-XFB layout to redeclared block member", member->type->getFieldName().c_str(), "");
if (newType.getQualifier().patch) if (newType.getQualifier().patch)
error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), ""); error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), "");
if (newType.getQualifier().hasXfbBuffer() && newType.getQualifier().layoutXfbBuffer != currentBlockQualifier.layoutXfbBuffer)
error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", "");
oldType.getQualifier().centroid = newType.getQualifier().centroid; oldType.getQualifier().centroid = newType.getQualifier().centroid;
oldType.getQualifier().sample = newType.getQualifier().sample; oldType.getQualifier().sample = newType.getQualifier().sample;
oldType.getQualifier().invariant = newType.getQualifier().invariant; oldType.getQualifier().invariant = newType.getQualifier().invariant;
@ -3540,7 +3549,9 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
oldType.getQualifier().smooth = newType.getQualifier().smooth; oldType.getQualifier().smooth = newType.getQualifier().smooth;
oldType.getQualifier().flat = newType.getQualifier().flat; oldType.getQualifier().flat = newType.getQualifier().flat;
oldType.getQualifier().nopersp = newType.getQualifier().nopersp; oldType.getQualifier().nopersp = newType.getQualifier().nopersp;
oldType.getQualifier().layoutXfbOffset = newType.getQualifier().layoutXfbOffset;
if (oldType.getQualifier().layoutXfbOffset != TQualifier::layoutXfbBufferEnd)
type.getQualifier().layoutXfbBuffer = currentBlockQualifier.layoutXfbBuffer;
if (oldType.isImplicitlySizedArray() && newType.isExplicitlySizedArray()) if (oldType.isImplicitlySizedArray() && newType.isExplicitlySizedArray())
oldType.changeOuterArraySize(newType.getOuterArraySize()); oldType.changeOuterArraySize(newType.getOuterArraySize());

Просмотреть файл

@ -1686,6 +1686,8 @@ void TShader::setShiftUavBinding(unsigned int base) { setShiftBinding(EResUa
void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSsbo, base); } void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSsbo, base); }
// Enables binding automapping using TIoMapper // Enables binding automapping using TIoMapper
void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); } void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); }
// Enables position.Y output negation in vertex shader
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
// Fragile: currently within one stage: simple auto-assignment of location // Fragile: currently within one stage: simple auto-assignment of location
void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); }
// See comment above TDefaultHlslIoMapper in iomapper.cpp: // See comment above TDefaultHlslIoMapper in iomapper.cpp:

Просмотреть файл

@ -212,6 +212,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_NV_stereo_view_rendering] = EBhDisable; extensionBehavior[E_GL_NV_stereo_view_rendering] = EBhDisable;
extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable; extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable;
extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable; extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable;
extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable;
#endif #endif
// AEP // AEP
@ -345,6 +346,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#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"
"#define GL_NV_shader_atomic_int64 1\n" "#define GL_NV_shader_atomic_int64 1\n"
"#define GL_NV_conservative_raster_underestimation 1\n"
#endif #endif
; ;

Просмотреть файл

@ -183,6 +183,7 @@ const char* const E_GL_NV_viewport_array2 = "GL_NV_viewpor
const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering";
const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; 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_shader_atomic_int64 = "GL_NV_shader_atomic_int64";
const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation";
// Arrays of extensions for the above viewportEXTs duplications // Arrays of extensions for the above viewportEXTs duplications

Просмотреть файл

@ -224,6 +224,7 @@ public:
#endif #endif
autoMapBindings(false), autoMapBindings(false),
autoMapLocations(false), autoMapLocations(false),
invertY(false),
flattenUniformArrays(false), flattenUniformArrays(false),
useUnknownFormat(false), useUnknownFormat(false),
hlslOffsets(false), hlslOffsets(false),
@ -317,6 +318,14 @@ public:
processes.addProcess("auto-map-locations"); processes.addProcess("auto-map-locations");
} }
bool getAutoMapLocations() const { return autoMapLocations; } bool getAutoMapLocations() const { return autoMapLocations; }
void setInvertY(bool invert)
{
invertY = invert;
if (invertY)
processes.addProcess("invert-y");
}
bool getInvertY() const { return invertY; }
void setFlattenUniformArrays(bool flatten) void setFlattenUniformArrays(bool flatten)
{ {
flattenUniformArrays = flatten; flattenUniformArrays = flatten;
@ -574,6 +583,7 @@ public:
xfbBuffers[buffer].stride = stride; xfbBuffers[buffer].stride = stride;
return true; return true;
} }
unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; }
int addXfbBufferOffset(const TType&); int addXfbBufferOffset(const TType&);
unsigned int computeTypeXfbSize(const TType&, bool& containsDouble) const; unsigned int computeTypeXfbSize(const TType&, bool& containsDouble) const;
static int getBaseAlignmentScalar(const TType&, int& size); static int getBaseAlignmentScalar(const TType&, int& size);
@ -682,6 +692,7 @@ protected:
std::vector<std::string> resourceSetBinding; std::vector<std::string> resourceSetBinding;
bool autoMapBindings; bool autoMapBindings;
bool autoMapLocations; bool autoMapLocations;
bool invertY;
bool flattenUniformArrays; bool flattenUniformArrays;
bool useUnknownFormat; bool useUnknownFormat;
bool hlslOffsets; bool hlslOffsets;

Просмотреть файл

@ -371,6 +371,7 @@ public:
void setResourceSetBinding(const std::vector<std::string>& base); void setResourceSetBinding(const std::vector<std::string>& base);
void setAutoMapBindings(bool map); void setAutoMapBindings(bool map);
void setAutoMapLocations(bool map); void setAutoMapLocations(bool map);
void setInvertY(bool invert);
void setHlslIoMapping(bool hlslIoMap); void setHlslIoMapping(bool hlslIoMap);
void setFlattenUniformArrays(bool flatten); void setFlattenUniformArrays(bool flatten);
void setNoStorageFormat(bool useUnknownFormat); void setNoStorageFormat(bool useUnknownFormat);

3
3rdparty/glslang/gtests/Spv.FromFile.cpp поставляемый
Просмотреть файл

@ -232,6 +232,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.bool.vert", "spv.bool.vert",
"spv.boolInBlock.frag", "spv.boolInBlock.frag",
"spv.branch-return.vert", "spv.branch-return.vert",
"spv.builtInXFB.vert",
"spv.conditionalDiscard.frag", "spv.conditionalDiscard.frag",
"spv.conversion.frag", "spv.conversion.frag",
"spv.dataOut.frag", "spv.dataOut.frag",
@ -249,6 +250,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.flowControl.frag", "spv.flowControl.frag",
"spv.forLoop.frag", "spv.forLoop.frag",
"spv.forwardFun.frag", "spv.forwardFun.frag",
"spv.fullyCovered.frag",
"spv.functionCall.frag", "spv.functionCall.frag",
"spv.functionNestedOpaque.vert", "spv.functionNestedOpaque.vert",
"spv.functionSemantics.frag", "spv.functionSemantics.frag",
@ -327,6 +329,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.storageBuffer.vert", "spv.storageBuffer.vert",
"spv.precise.tese", "spv.precise.tese",
"spv.precise.tesc", "spv.precise.tesc",
"spv.xfb.vert",
})), })),
FileNameAsCustomTestSuffix FileNameAsCustomTestSuffix
); );

100
3rdparty/glslang/hlsl/hlslParseHelper.cpp поставляемый
Просмотреть файл

@ -2301,6 +2301,63 @@ void HlslParseContext::handleFunctionArgument(TFunction* function,
arguments = newArg; arguments = newArg;
} }
// Position may require special handling: we can optionally invert Y.
// See: https://github.com/KhronosGroup/glslang/issues/1173
// https://github.com/KhronosGroup/glslang/issues/494
TIntermTyped* HlslParseContext::assignPosition(const TSourceLoc& loc, TOperator op,
TIntermTyped* left, TIntermTyped* right)
{
// If we are not asked for Y inversion, use a plain old assign.
if (!intermediate.getInvertY())
return intermediate.addAssign(op, left, right, loc);
// If we get here, we should invert Y.
TIntermAggregate* assignList = nullptr;
// If this is a complex rvalue, we don't want to dereference it many times. Create a temporary.
TVariable* rhsTempVar = nullptr;
rhsTempVar = makeInternalVariable("@position", right->getType());
rhsTempVar->getWritableType().getQualifier().makeTemporary();
{
TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc);
assignList = intermediate.growAggregate(assignList,
intermediate.addAssign(EOpAssign, rhsTempSym, right, loc), loc);
}
// pos.y = -pos.y
{
const int Y = 1;
TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc);
TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc);
TIntermTyped* index = intermediate.addConstantUnion(Y, loc);
TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc);
TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc);
const TType derefType(right->getType(), 0);
lhsElement->setType(derefType);
rhsElement->setType(derefType);
TIntermTyped* yNeg = intermediate.addUnaryMath(EOpNegative, rhsElement, loc);
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(EOpAssign, lhsElement, yNeg, loc));
}
// Assign the rhs temp (now with Y inversion) to the final output
{
TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc);
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, rhsTempSym, loc));
}
assert(assignList != nullptr);
assignList->setOperator(EOpSequence);
return assignList;
}
// Clip and cull distance require special handling due to a semantic mismatch. In HLSL, // Clip and cull distance require special handling due to a semantic mismatch. In HLSL,
// these can be float scalar, float vector, or arrays of float scalar or float vector. // these can be float scalar, float vector, or arrays of float scalar or float vector.
// In SPIR-V, they are arrays of scalar floats in all cases. We must copy individual components // In SPIR-V, they are arrays of scalar floats in all cases. We must copy individual components
@ -2566,6 +2623,12 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
wasSplit(binaryNode->getLeft()); wasSplit(binaryNode->getLeft());
}; };
// Return true if this stage assigns clip position with potentially inverted Y
const auto assignsClipPos = [this](const TIntermTyped* node) -> bool {
return node->getType().getQualifier().builtIn == EbvPosition &&
(language == EShLangVertex || language == EShLangGeometry || language == EShLangTessEvaluation);
};
const bool isSplitLeft = wasSplit(left) || indexesSplit(left); const bool isSplitLeft = wasSplit(left) || indexesSplit(left);
const bool isSplitRight = wasSplit(right) || indexesSplit(right); const bool isSplitRight = wasSplit(right) || indexesSplit(right);
@ -2581,6 +2644,9 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
const int semanticId = (isOutput ? left : right)->getType().getQualifier().layoutLocation; const int semanticId = (isOutput ? left : right)->getType().getQualifier().layoutLocation;
return assignClipCullDistance(loc, op, semanticId, left, right); return assignClipCullDistance(loc, op, semanticId, left, right);
} else if (assignsClipPos(left)) {
// Position can require special handling: see comment above assignPosition
return assignPosition(loc, op, left, right);
} }
return intermediate.addAssign(op, left, right, loc); return intermediate.addAssign(op, left, right, loc);
@ -2665,13 +2731,23 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
// copy from interstage IO built-in if needed // copy from interstage IO built-in if needed
subTree = intermediate.addSymbol(*builtInVar); subTree = intermediate.addSymbol(*builtInVar);
// Arrayness of builtIn symbols isn't handled by the normal recursion: if (subTree->getType().isArray()) {
// it's been extracted and moved to the built-in. // Arrayness of builtIn symbols isn't handled by the normal recursion:
if (subTree->getType().isArray() && !arrayElement.empty()) { // it's been extracted and moved to the built-in.
const TType splitDerefType(subTree->getType(), arrayElement.back()); if (!arrayElement.empty()) {
subTree = intermediate.addIndex(EOpIndexDirect, subTree, const TType splitDerefType(subTree->getType(), arrayElement.back());
intermediate.addConstantUnion(arrayElement.back(), loc), loc); subTree = intermediate.addIndex(EOpIndexDirect, subTree,
subTree->setType(splitDerefType); intermediate.addConstantUnion(arrayElement.back(), loc), loc);
subTree->setType(splitDerefType);
} else if (splitNode->getAsOperator() != nullptr && (splitNode->getAsOperator()->getOp() == EOpIndexIndirect)) {
// This might also be a stage with arrayed outputs, in which case there's an index
// operation we should transfer to the output builtin.
const TType splitDerefType(subTree->getType(), 0);
subTree = intermediate.addIndex(splitNode->getAsOperator()->getOp(), subTree,
splitNode->getAsBinaryNode()->getRight(), loc);
subTree->setType(splitDerefType);
}
} }
} else if (flattened && !shouldFlatten(derefType, isLeft ? leftStorage : rightStorage, false)) { } else if (flattened && !shouldFlatten(derefType, isLeft ? leftStorage : rightStorage, false)) {
if (isLeft) if (isLeft)
@ -2792,7 +2868,10 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
subSplitLeft, subSplitRight); subSplitLeft, subSplitRight);
assignList = intermediate.growAggregate(assignList, clipCullAssign, loc); assignList = intermediate.growAggregate(assignList, clipCullAssign, loc);
} else if (assignsClipPos(subSplitLeft)) {
// Position can require special handling: see comment above assignPosition
TIntermTyped* positionAssign = assignPosition(loc, op, subSplitLeft, subSplitRight);
assignList = intermediate.growAggregate(assignList, positionAssign, loc);
} else if (!shouldFlattenSubsetLeft && !shouldFlattenSubsetRight && } else if (!shouldFlattenSubsetLeft && !shouldFlattenSubsetRight &&
!typeL.containsBuiltIn() && !typeR.containsBuiltIn()) { !typeL.containsBuiltIn() && !typeR.containsBuiltIn()) {
// If this is the final flattening (no nested types below to flatten) // If this is the final flattening (no nested types below to flatten)
@ -5777,7 +5856,8 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBu
break; break;
} }
qualifier.builtIn = builtIn; if (qualifier.builtIn == EbvNone)
qualifier.builtIn = builtIn;
qualifier.semanticName = intermediate.addSemanticName(upperCase); qualifier.semanticName = intermediate.addSemanticName(upperCase);
} }
@ -9046,7 +9126,7 @@ bool HlslParseContext::isOutputBuiltIn(const TQualifier& qualifier) const
return language == EShLangFragment; return language == EShLangFragment;
case EbvLayer: case EbvLayer:
case EbvViewportIndex: case EbvViewportIndex:
return language == EShLangGeometry; return language == EShLangGeometry || language == EShLangVertex;
case EbvPrimitiveId: case EbvPrimitiveId:
return language == EShLangGeometry; return language == EShLangGeometry;
case EbvTessLevelInner: case EbvTessLevelInner:

1
3rdparty/glslang/hlsl/hlslParseHelper.h поставляемый
Просмотреть файл

@ -93,6 +93,7 @@ public:
TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*);
TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right); TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* assignPosition(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);

2
3rdparty/glslang/known_good.json поставляемый
Просмотреть файл

@ -5,7 +5,7 @@
"site" : "github", "site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools", "subrepo" : "KhronosGroup/SPIRV-Tools",
"subdir" : "External/spirv-tools", "subdir" : "External/spirv-tools",
"commit" : "188cd3780d76256d6bfcbdb216b6368e9b070628" "commit" : "0f804063154f45af308f8ce31c41f58fae3f18dc"
}, },
{ {
"name" : "spirv-tools/external/spirv-headers", "name" : "spirv-tools/external/spirv-headers",