Commit 302b46ae by John Kessenich

Implement GL_OES_texture_buffer.

parent 30314590
...@@ -181,3 +181,53 @@ void pfoo() ...@@ -181,3 +181,53 @@ void pfoo()
textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); textureGatherOffsets(sArray[0], vec2(0.1), constOffsets);
textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant
} }
uniform samplerBuffer badSamp1; // ERROR, reserved
uniform isamplerBuffer badSamp2; // ERROR, reserved
uniform usamplerBuffer badSamp3; // ERROR, reserved
uniform writeonly imageBuffer badSamp4; // ERROR, reserved
uniform writeonly iimageBuffer badSamp5; // ERROR, reserved
uniform writeonly uimageBuffer badSamp6; // ERROR, reserved
#extension GL_OES_texture_buffer : enable
#extension GL_EXT_texture_buffer : enable
uniform samplerBuffer noPreSamp1; // ERROR, no default precision
uniform isamplerBuffer noPreSamp2; // ERROR, no default precision
uniform usamplerBuffer noPreSamp3; // ERROR, no default precision
uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision
uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision
uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision
precision highp samplerBuffer;
precision highp isamplerBuffer;
precision highp usamplerBuffer;
precision highp imageBuffer;
precision highp iimageBuffer;
precision highp uimageBuffer;
#ifdef GL_OES_texture_buffer
uniform samplerBuffer bufSamp1;
uniform isamplerBuffer bufSamp2;
uniform usamplerBuffer bufSamp3;
#endif
#ifdef GL_EXT_texture_buffer
uniform writeonly imageBuffer bufSamp4;
uniform writeonly iimageBuffer bufSamp5;
uniform writeonly uimageBuffer bufSamp6;
#endif
void bufferT()
{
highp int s1 = textureSize(bufSamp1);
highp int s2 = textureSize(bufSamp2);
highp int s3 = textureSize(bufSamp3);
highp int s4 = imageSize(bufSamp4);
highp int s5 = imageSize(bufSamp5);
highp int s6 = imageSize(bufSamp6);
highp vec4 f1 = texelFetch(bufSamp1, s1);
highp ivec4 f2 = texelFetch(bufSamp2, s2);
highp uvec4 f3 = texelFetch(bufSamp3, s3);
}
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits. // For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run). // For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "2.3.715" #define GLSLANG_REVISION "2.3.716"
#define GLSLANG_DATE "16-Aug-2015" #define GLSLANG_DATE "16-Aug-2015"
...@@ -1827,6 +1827,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) ...@@ -1827,6 +1827,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
// //
TBasicType bTypes[3] = { EbtFloat, EbtInt, EbtUint }; TBasicType bTypes[3] = { EbtFloat, EbtInt, EbtUint };
bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140);
bool skipCubeArrayed = (profile == EEsProfile || version < 130);
// enumerate all the types // enumerate all the types
for (int image = 0; image <= 1; ++image) { // loop over "bool" image vs sampler for (int image = 0; image <= 1; ++image) { // loop over "bool" image vs sampler
...@@ -1854,9 +1856,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) ...@@ -1854,9 +1856,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
continue; continue;
if (dim == Esd3D && shadow) if (dim == Esd3D && shadow)
continue; continue;
if (dim == EsdCube && arrayed && (profile == EEsProfile || version < 130)) if (dim == EsdCube && arrayed && skipCubeArrayed)
continue; continue;
if (dim == EsdBuffer && (profile == EEsProfile || version < 140)) if (dim == EsdBuffer && skipBuffer)
continue; continue;
if (dim == EsdBuffer && (shadow || arrayed || ms)) if (dim == EsdBuffer && (shadow || arrayed || ms))
continue; continue;
......
...@@ -781,9 +781,13 @@ int TScanContext::tokenizeIdentifier() ...@@ -781,9 +781,13 @@ int TScanContext::tokenizeIdentifier()
case IMAGE2DRECT: case IMAGE2DRECT:
case IIMAGE2DRECT: case IIMAGE2DRECT:
case UIMAGE2DRECT: case UIMAGE2DRECT:
return firstGenerationImage(false);
case IMAGEBUFFER: case IMAGEBUFFER:
case IIMAGEBUFFER: case IIMAGEBUFFER:
case UIMAGEBUFFER: case UIMAGEBUFFER:
if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
return keyword;
return firstGenerationImage(false); return firstGenerationImage(false);
case IMAGE2D: case IMAGE2D:
...@@ -834,7 +838,6 @@ int TScanContext::tokenizeIdentifier() ...@@ -834,7 +838,6 @@ int TScanContext::tokenizeIdentifier()
case SAMPLER1DARRAYSHADOW: case SAMPLER1DARRAYSHADOW:
case USAMPLER1D: case USAMPLER1D:
case USAMPLER1DARRAY: case USAMPLER1DARRAY:
case SAMPLERBUFFER:
afterType = true; afterType = true;
return es30ReservedFromGLSL(130); return es30ReservedFromGLSL(130);
...@@ -858,9 +861,20 @@ int TScanContext::tokenizeIdentifier() ...@@ -858,9 +861,20 @@ int TScanContext::tokenizeIdentifier()
case ISAMPLER2DRECT: case ISAMPLER2DRECT:
case USAMPLER2DRECT: case USAMPLER2DRECT:
afterType = true;
return es30ReservedFromGLSL(140);
case SAMPLERBUFFER:
afterType = true;
if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
return keyword;
return es30ReservedFromGLSL(130);
case ISAMPLERBUFFER: case ISAMPLERBUFFER:
case USAMPLERBUFFER: case USAMPLERBUFFER:
afterType = true; afterType = true;
if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
return keyword;
return es30ReservedFromGLSL(140); return es30ReservedFromGLSL(140);
case SAMPLER2DMS: case SAMPLER2DMS:
......
...@@ -192,7 +192,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -192,7 +192,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_shader_io_blocks] = EBhDisable; extensionBehavior[E_GL_EXT_shader_io_blocks] = EBhDisable;
extensionBehavior[E_GL_EXT_tessellation_shader] = EBhDisable; extensionBehavior[E_GL_EXT_tessellation_shader] = EBhDisable;
extensionBehavior[E_GL_EXT_tessellation_point_size] = EBhDisable; extensionBehavior[E_GL_EXT_tessellation_point_size] = EBhDisable;
extensionBehavior[E_GL_EXT_texture_buffer] = EBhDisablePartial; extensionBehavior[E_GL_EXT_texture_buffer] = EBhDisable;
extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisablePartial; extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisablePartial;
// OES matching AEP // OES matching AEP
...@@ -203,7 +203,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -203,7 +203,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[E_GL_OES_shader_io_blocks] = EBhDisable; extensionBehavior[E_GL_OES_shader_io_blocks] = EBhDisable;
extensionBehavior[E_GL_OES_tessellation_shader] = EBhDisable; extensionBehavior[E_GL_OES_tessellation_shader] = EBhDisable;
extensionBehavior[E_GL_OES_tessellation_point_size] = EBhDisable; extensionBehavior[E_GL_OES_tessellation_point_size] = EBhDisable;
extensionBehavior[E_GL_OES_texture_buffer] = EBhDisablePartial; extensionBehavior[E_GL_OES_texture_buffer] = EBhDisable;
extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisablePartial; extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisablePartial;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment