Implement GL_OES_texture_buffer.

This commit is contained in:
John Kessenich 2015-08-16 12:52:19 -06:00
parent 30314590ff
commit 302b46aebc
6 changed files with 233 additions and 7 deletions

View file

@ -1827,6 +1827,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
//
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
for (int image = 0; image <= 1; ++image) { // loop over "bool" image vs sampler
@ -1854,9 +1856,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
continue;
if (dim == Esd3D && shadow)
continue;
if (dim == EsdCube && arrayed && (profile == EEsProfile || version < 130))
if (dim == EsdCube && arrayed && skipCubeArrayed)
continue;
if (dim == EsdBuffer && (profile == EEsProfile || version < 140))
if (dim == EsdBuffer && skipBuffer)
continue;
if (dim == EsdBuffer && (shadow || arrayed || ms))
continue;

View file

@ -781,9 +781,13 @@ int TScanContext::tokenizeIdentifier()
case IMAGE2DRECT:
case IIMAGE2DRECT:
case UIMAGE2DRECT:
return firstGenerationImage(false);
case IMAGEBUFFER:
case IIMAGEBUFFER:
case UIMAGEBUFFER:
if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
return keyword;
return firstGenerationImage(false);
case IMAGE2D:
@ -834,7 +838,6 @@ int TScanContext::tokenizeIdentifier()
case SAMPLER1DARRAYSHADOW:
case USAMPLER1D:
case USAMPLER1DARRAY:
case SAMPLERBUFFER:
afterType = true;
return es30ReservedFromGLSL(130);
@ -858,9 +861,20 @@ int TScanContext::tokenizeIdentifier()
case ISAMPLER2DRECT:
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 USAMPLERBUFFER:
afterType = true;
if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
return keyword;
return es30ReservedFromGLSL(140);
case SAMPLER2DMS:

View file

@ -192,7 +192,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_shader_io_blocks] = EBhDisable;
extensionBehavior[E_GL_EXT_tessellation_shader] = 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;
// OES matching AEP
@ -203,7 +203,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[E_GL_OES_shader_io_blocks] = EBhDisable;
extensionBehavior[E_GL_OES_tessellation_shader] = 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;
}