Commit dc9eff72 by John Kessenich

Implement GL_OES_texture_cube_map_array.

parent 302b46ae
...@@ -222,3 +222,32 @@ void pfoo() ...@@ -222,3 +222,32 @@ 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
} }
#extension GL_EXT_texture_cube_map_array : enable
precision highp imageCubeArray ;
precision highp iimageCubeArray ;
precision highp uimageCubeArray ;
precision highp samplerCubeArray ;
precision highp samplerCubeArrayShadow;
precision highp isamplerCubeArray ;
precision highp usamplerCubeArray ;
uniform writeonly imageCubeArray CA1;
uniform writeonly iimageCubeArray CA2;
uniform writeonly uimageCubeArray CA3;
#ifdef GL_EXT_texture_cube_map_array
uniform samplerCubeArray CA4;
uniform samplerCubeArrayShadow CA5;
uniform isamplerCubeArray CA6;
uniform usamplerCubeArray CA7;
#endif
void CAT()
{
highp vec4 b4 = texture(CA4, vec4(0.5), 0.24);
highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26);
highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27);
}
...@@ -231,3 +231,77 @@ void bufferT() ...@@ -231,3 +231,77 @@ void bufferT()
highp ivec4 f2 = texelFetch(bufSamp2, s2); highp ivec4 f2 = texelFetch(bufSamp2, s2);
highp uvec4 f3 = texelFetch(bufSamp3, s3); highp uvec4 f3 = texelFetch(bufSamp3, s3);
} }
uniform writeonly imageCubeArray badCA1; // ERROR, reserved
uniform writeonly iimageCubeArray badCA2; // ERROR, reserved
uniform writeonly uimageCubeArray badCA3; // ERROR, reserved
uniform samplerCubeArray badCA4; // ERROR, reserved
uniform samplerCubeArrayShadow badCA5; // ERROR, reserved
uniform isamplerCubeArray badCA6; // ERROR, reserved
uniform usamplerCubeArray badCA7; // ERROR, reserved
#extension GL_OES_texture_cube_map_array : enable
uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision
uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision
uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision
uniform samplerCubeArray noPreCA4; // ERROR, no default precision
uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision
uniform isamplerCubeArray noPreCA6; // ERROR, no default precision
uniform usamplerCubeArray noPreCA7; // ERROR, no default precision
precision highp imageCubeArray ;
precision highp iimageCubeArray ;
precision highp uimageCubeArray ;
precision highp samplerCubeArray ;
precision highp samplerCubeArrayShadow;
precision highp isamplerCubeArray ;
precision highp usamplerCubeArray ;
uniform writeonly imageCubeArray CA1;
uniform writeonly iimageCubeArray CA2;
uniform writeonly uimageCubeArray CA3;
#ifdef GL_OES_texture_cube_map_array
uniform samplerCubeArray CA4;
uniform samplerCubeArrayShadow CA5;
uniform isamplerCubeArray CA6;
uniform usamplerCubeArray CA7;
#endif
void CAT()
{
highp ivec3 s4 = textureSize(CA4, 1);
highp ivec3 s5 = textureSize(CA5, 1);
highp ivec3 s6 = textureSize(CA6, 1);
highp ivec3 s7 = textureSize(CA7, 1);
highp vec4 t4 = texture(CA4, vec4(0.5));
highp float t5 = texture(CA5, vec4(0.5), 3.0);
highp ivec4 t6 = texture(CA6, vec4(0.5));
highp uvec4 t7 = texture(CA7, vec4(0.5));
highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24);
highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26);
highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27);
highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2));
highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2));
highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2));
highp vec4 gath4 = textureGather(CA4, vec4(0.5));
highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2);
highp ivec4 gath6 = textureGather(CA6, vec4(0.5));
highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1);
highp uvec4 gath7 = textureGather(CA7, vec4(0.5));
highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0);
highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5);
highp ivec3 s1 = imageSize(CA1);
highp ivec3 s2 = imageSize(CA2);
highp ivec3 s3 = imageSize(CA3);
}
...@@ -75,6 +75,7 @@ ERROR: 62 compilation errors. No code generated. ...@@ -75,6 +75,7 @@ ERROR: 62 compilation errors. No code generated.
Shader version: 310 Shader version: 310
Requested GL_EXT_shader_io_blocks Requested GL_EXT_shader_io_blocks
Requested GL_EXT_texture_cube_map_array
Requested GL_OES_geometry_shader Requested GL_OES_geometry_shader
Requested GL_OES_gpu_shader5 Requested GL_OES_gpu_shader5
Requested GL_OES_shader_io_blocks Requested GL_OES_shader_io_blocks
...@@ -443,6 +444,45 @@ ERROR: node is still EOpNull! ...@@ -443,6 +444,45 @@ ERROR: node is still EOpNull!
0:223 0.100000 0:223 0.100000
0:223 0.100000 0:223 0.100000
0:223 'offsets' (uniform 4-element array of mediump 2-component vector of int) 0:223 'offsets' (uniform 4-element array of mediump 2-component vector of int)
0:248 Function Definition: CAT( (global void)
0:248 Function Parameters:
0:250 Sequence
0:250 Sequence
0:250 move second child to first child (temp highp 4-component vector of float)
0:250 'b4' (temp highp 4-component vector of float)
0:250 Function Call: texture(sAC1;vf4;f1; (global highp 4-component vector of float)
0:250 'CA4' (uniform highp samplerCubeArray)
0:250 Constant:
0:250 0.500000
0:250 0.500000
0:250 0.500000
0:250 0.500000
0:250 Constant:
0:250 0.240000
0:251 Sequence
0:251 move second child to first child (temp highp 4-component vector of int)
0:251 'b6' (temp highp 4-component vector of int)
0:251 Function Call: texture(isAC1;vf4;f1; (global mediump 4-component vector of int)
0:251 'CA6' (uniform highp isamplerCubeArray)
0:251 Constant:
0:251 0.500000
0:251 0.500000
0:251 0.500000
0:251 0.500000
0:251 Constant:
0:251 0.260000
0:252 Sequence
0:252 move second child to first child (temp highp 4-component vector of uint)
0:252 'b7' (temp highp 4-component vector of uint)
0:252 Function Call: texture(usAC1;vf4;f1; (global mediump 4-component vector of uint)
0:252 'CA7' (uniform highp usamplerCubeArray)
0:252 Constant:
0:252 0.500000
0:252 0.500000
0:252 0.500000
0:252 0.500000
0:252 Constant:
0:252 0.270000
0:? Linker Objects 0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float) 0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float) 0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...@@ -509,6 +549,13 @@ ERROR: node is still EOpNull! ...@@ -509,6 +549,13 @@ ERROR: node is still EOpNull!
0:? 0 (const int) 0:? 0 (const int)
0:? 0 (const int) 0:? 0 (const int)
0:? 0 (const int) 0:? 0 (const int)
0:? 'CA1' (writeonly uniform highp imageCubeArray)
0:? 'CA2' (writeonly uniform highp iimageCubeArray)
0:? 'CA3' (writeonly uniform highp uimageCubeArray)
0:? 'CA4' (uniform highp samplerCubeArray)
0:? 'CA5' (uniform highp samplerCubeArrayShadow)
0:? 'CA6' (uniform highp isamplerCubeArray)
0:? 'CA7' (uniform highp usamplerCubeArray)
Linked fragment stage: Linked fragment stage:
...@@ -517,6 +564,7 @@ ERROR: Linking fragment stage: when more than one fragment shader output, all mu ...@@ -517,6 +564,7 @@ ERROR: Linking fragment stage: when more than one fragment shader output, all mu
Shader version: 310 Shader version: 310
Requested GL_EXT_shader_io_blocks Requested GL_EXT_shader_io_blocks
Requested GL_EXT_texture_cube_map_array
Requested GL_OES_geometry_shader Requested GL_OES_geometry_shader
Requested GL_OES_gpu_shader5 Requested GL_OES_gpu_shader5
Requested GL_OES_shader_io_blocks Requested GL_OES_shader_io_blocks
...@@ -885,6 +933,45 @@ ERROR: node is still EOpNull! ...@@ -885,6 +933,45 @@ ERROR: node is still EOpNull!
0:223 0.100000 0:223 0.100000
0:223 0.100000 0:223 0.100000
0:223 'offsets' (uniform 4-element array of mediump 2-component vector of int) 0:223 'offsets' (uniform 4-element array of mediump 2-component vector of int)
0:248 Function Definition: CAT( (global void)
0:248 Function Parameters:
0:250 Sequence
0:250 Sequence
0:250 move second child to first child (temp highp 4-component vector of float)
0:250 'b4' (temp highp 4-component vector of float)
0:250 Function Call: texture(sAC1;vf4;f1; (global highp 4-component vector of float)
0:250 'CA4' (uniform highp samplerCubeArray)
0:250 Constant:
0:250 0.500000
0:250 0.500000
0:250 0.500000
0:250 0.500000
0:250 Constant:
0:250 0.240000
0:251 Sequence
0:251 move second child to first child (temp highp 4-component vector of int)
0:251 'b6' (temp highp 4-component vector of int)
0:251 Function Call: texture(isAC1;vf4;f1; (global mediump 4-component vector of int)
0:251 'CA6' (uniform highp isamplerCubeArray)
0:251 Constant:
0:251 0.500000
0:251 0.500000
0:251 0.500000
0:251 0.500000
0:251 Constant:
0:251 0.260000
0:252 Sequence
0:252 move second child to first child (temp highp 4-component vector of uint)
0:252 'b7' (temp highp 4-component vector of uint)
0:252 Function Call: texture(usAC1;vf4;f1; (global mediump 4-component vector of uint)
0:252 'CA7' (uniform highp usamplerCubeArray)
0:252 Constant:
0:252 0.500000
0:252 0.500000
0:252 0.500000
0:252 0.500000
0:252 Constant:
0:252 0.270000
0:? Linker Objects 0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float) 0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float) 0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...@@ -951,4 +1038,11 @@ ERROR: node is still EOpNull! ...@@ -951,4 +1038,11 @@ ERROR: node is still EOpNull!
0:? 0 (const int) 0:? 0 (const int)
0:? 0 (const int) 0:? 0 (const int)
0:? 0 (const int) 0:? 0 (const int)
0:? 'CA1' (writeonly uniform highp imageCubeArray)
0:? 'CA2' (writeonly uniform highp iimageCubeArray)
0:? 'CA3' (writeonly uniform highp uimageCubeArray)
0:? 'CA4' (uniform highp samplerCubeArray)
0:? 'CA5' (uniform highp samplerCubeArrayShadow)
0:? 'CA6' (uniform highp isamplerCubeArray)
0:? 'CA7' (uniform highp usamplerCubeArray)
...@@ -1828,7 +1828,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) ...@@ -1828,7 +1828,7 @@ 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 skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140);
bool skipCubeArrayed = (profile == EEsProfile || version < 130); bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (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
......
...@@ -781,11 +781,13 @@ int TScanContext::tokenizeIdentifier() ...@@ -781,11 +781,13 @@ int TScanContext::tokenizeIdentifier()
case IMAGE2DRECT: case IMAGE2DRECT:
case IIMAGE2DRECT: case IIMAGE2DRECT:
case UIMAGE2DRECT: case UIMAGE2DRECT:
afterType = true;
return firstGenerationImage(false); return firstGenerationImage(false);
case IMAGEBUFFER: case IMAGEBUFFER:
case IIMAGEBUFFER: case IIMAGEBUFFER:
case UIMAGEBUFFER: case UIMAGEBUFFER:
afterType = true;
if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer)) if (parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
return keyword; return keyword;
return firstGenerationImage(false); return firstGenerationImage(false);
...@@ -802,17 +804,24 @@ int TScanContext::tokenizeIdentifier() ...@@ -802,17 +804,24 @@ int TScanContext::tokenizeIdentifier()
case IMAGE2DARRAY: case IMAGE2DARRAY:
case IIMAGE2DARRAY: case IIMAGE2DARRAY:
case UIMAGE2DARRAY: case UIMAGE2DARRAY:
afterType = true;
return firstGenerationImage(true); return firstGenerationImage(true);
case IMAGECUBEARRAY: case IMAGECUBEARRAY:
case IIMAGECUBEARRAY: case IIMAGECUBEARRAY:
case UIMAGECUBEARRAY: case UIMAGECUBEARRAY:
afterType = true;
if (parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
return keyword;
return secondGenerationImage();
case IMAGE2DMS: case IMAGE2DMS:
case IIMAGE2DMS: case IIMAGE2DMS:
case UIMAGE2DMS: case UIMAGE2DMS:
case IMAGE2DMSARRAY: case IMAGE2DMSARRAY:
case IIMAGE2DMSARRAY: case IIMAGE2DMSARRAY:
case UIMAGE2DMSARRAY: case UIMAGE2DMSARRAY:
afterType = true;
return secondGenerationImage(); return secondGenerationImage();
case DOUBLE: case DOUBLE:
...@@ -829,6 +838,8 @@ int TScanContext::tokenizeIdentifier() ...@@ -829,6 +838,8 @@ int TScanContext::tokenizeIdentifier()
case ISAMPLERCUBEARRAY: case ISAMPLERCUBEARRAY:
case USAMPLERCUBEARRAY: case USAMPLERCUBEARRAY:
afterType = true; afterType = true;
if (parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
return keyword;
if (parseContext.profile == EEsProfile || (parseContext.version < 400 && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_cube_map_array))) if (parseContext.profile == EEsProfile || (parseContext.version < 400 && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_cube_map_array)))
reservedWord(); reservedWord();
return keyword; return keyword;
...@@ -1127,8 +1138,6 @@ int TScanContext::dMat() ...@@ -1127,8 +1138,6 @@ int TScanContext::dMat()
int TScanContext::firstGenerationImage(bool inEs310) int TScanContext::firstGenerationImage(bool inEs310)
{ {
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() || if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || (parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) ||
(inEs310 && parseContext.profile == EEsProfile && parseContext.version >= 310)) (inEs310 && parseContext.profile == EEsProfile && parseContext.version >= 310))
...@@ -1149,8 +1158,6 @@ int TScanContext::firstGenerationImage(bool inEs310) ...@@ -1149,8 +1158,6 @@ int TScanContext::firstGenerationImage(bool inEs310)
int TScanContext::secondGenerationImage() int TScanContext::secondGenerationImage()
{ {
afterType = true;
if (parseContext.profile == EEsProfile && parseContext.version >= 310) { if (parseContext.profile == EEsProfile && parseContext.version >= 310) {
reservedWord(); reservedWord();
return keyword; return keyword;
......
...@@ -193,7 +193,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -193,7 +193,7 @@ void TParseContext::initializeExtensionBehavior()
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] = EBhDisable; extensionBehavior[E_GL_EXT_texture_buffer] = EBhDisable;
extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisablePartial; extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisable;
// OES matching AEP // OES matching AEP
extensionBehavior[E_GL_OES_geometry_shader] = EBhDisable; extensionBehavior[E_GL_OES_geometry_shader] = EBhDisable;
...@@ -204,7 +204,7 @@ void TParseContext::initializeExtensionBehavior() ...@@ -204,7 +204,7 @@ void TParseContext::initializeExtensionBehavior()
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] = EBhDisable; extensionBehavior[E_GL_OES_texture_buffer] = EBhDisable;
extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisablePartial; extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisable;
} }
// Get code that is not part of a shared symbol table, is specific to this shader, // Get code that is not part of a shared symbol table, is specific to this shader,
......
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