GLSL_SAMPLER_DIM_EXTERNAL, 0, 0, GLSL_TYPE_FLOAT, "samplerExternalOES"),
};
/*@}*/
+
+/** \name Sampler types added by GL_ARB_texture_cube_map_array
+ */
+/*@{*/
+const glsl_type glsl_type::builtin_ARB_texture_cube_map_array_types[] = {
+ glsl_type(GL_SAMPLER_CUBE_MAP_ARRAY,
+ GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_FLOAT, "samplerCubeArray"),
+ glsl_type(GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW,
+ GLSL_SAMPLER_DIM_CUBE, 1, 1, GLSL_TYPE_FLOAT, "samplerCubeArrayShadow"),
+ glsl_type(GL_INT_SAMPLER_CUBE_MAP_ARRAY,
+ GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_INT, "isamplerCubeArray"),
+ glsl_type(GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY,
+ GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_UINT, "usamplerCubeArray"),
+};
+/*@}*/
--- /dev/null
+#version 130
+#extension GL_ARB_texture_cube_map_array : enable
+
+ivec3 textureSize(samplerCubeArray sampler, int lod);
+ivec3 textureSize(isamplerCubeArray sampler, int lod);
+ivec3 textureSize(usamplerCubeArray sampler, int lod);
+ivec3 textureSize(samplerCubeArrayShadow sampler, int lod);
+
+ vec4 texture( samplerCubeArray sampler, vec4 coord);
+ vec4 texture( samplerCubeArray sampler, vec4 coord, float bias);
+float texture( samplerCubeArrayShadow sampler, vec4 P, float compare);
+
+ vec4 textureGrad( samplerCubeArray sampler, vec4 P, vec3 dPdx, vec3 dPdy);
+ivec4 textureGrad( isamplerCubeArray sampler, vec4 P, vec3 dPdx, vec3 dPdy);
+uvec4 textureGrad( usamplerCubeArray sampler, vec4 P, vec3 dPdx, vec3 dPdy);
+
+ vec4 textureLod( samplerCubeArray sampler, vec4 P, float lod);
+ivec4 textureLod( isamplerCubeArray sampler, vec4 P, float lod);
+uvec4 textureLod( usamplerCubeArray sampler, vec4 P, float lod);
st->EXT_texture_array_enable = true;
st->OES_EGL_image_external_enable = true;
st->ARB_shader_bit_encoding_enable = true;
+ st->ARB_texture_cube_map_array_enable = true;
_mesa_glsl_initialize_types(st);
sh->ir = new(sh) exec_list;
# Get the number of extra vector components (i.e. shadow comparitor)
def get_extra_dim(sampler_type, use_proj, unused_fields):
extra_dim = unused_fields
+ if sampler_type == "CubeArrayShadow":
+ return 0
if sampler_type.find("Shadow") != -1:
extra_dim += 1
if use_proj:
return extra_dim
def get_txs_dim(sampler_type):
+ if sampler_type.startswith("CubeArray"):
+ return 3
if sampler_type.startswith("Cube"):
return 2
return get_coord_dim(sampler_type)
grad_type = vec_type("", sampler_dim)
print "\n (declare (in) " + grad_type + " dPdx)",
print "\n (declare (in) " + grad_type + " dPdy)",
+ if sampler_type == "CubeArrayShadow" and tex_inst == "tex":
+ print "\n (declare (in) float compare)",
if variant & Offset:
print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)",
print "1",
# Shadow comparitor
- if sampler_type == "2DArrayShadow" or sampler_type == "CubeShadow": # a special case:
+ if sampler_type == "CubeArrayShadow": # a special case
+ print "(var_ref compare)",
+ elif sampler_type == "2DArrayShadow" or sampler_type == "CubeShadow": # a special case:
print "(swiz w (var_ref P))", # ...array layer is z; shadow is w
elif sampler_type.endswith("Shadow"):
print "(swiz z (var_ref P))",
generate_fiu_sigs("txs", "2DRect")
generate_sigs("", "txs", "2DRectShadow")
generate_fiu_sigs("txs", "Buffer")
+ generate_fiu_sigs("txs", "CubeArray")
+ generate_sigs("", "txs", "CubeArrayShadow")
end_function(fs, "textureSize")
start_function("texture")
generate_sigs("", "tex", "2DArrayShadow", Single);
generate_fiu_sigs("tex", "2DRect")
generate_sigs("", "tex", "2DRectShadow", Single);
+ # ARB_texture_cube_map_array extension
+ generate_fiu_sigs("tex", "CubeArray")
+ generate_sigs("", "tex", "CubeArrayShadow", Single);
generate_fiu_sigs("txb", "1D")
generate_fiu_sigs("txb", "2D")
generate_fiu_sigs("txb", "Cube")
generate_fiu_sigs("txb", "1DArray")
generate_fiu_sigs("txb", "2DArray")
+ generate_fiu_sigs("txb", "CubeArray")
generate_sigs("", "txb", "1DShadow", Single, 1);
generate_sigs("", "txb", "2DShadow", Single);
generate_sigs("", "txb", "CubeShadow", Single);
generate_sigs("", "txl", "1DShadow", Single, 1);
generate_sigs("", "txl", "2DShadow", Single);
generate_sigs("", "txl", "1DArrayShadow", Single);
+ # ARB_texture_cube_map_array extension
+ generate_fiu_sigs("txl", "CubeArray")
end_function(fs, "textureLod")
start_function("textureLodOffset")
generate_sigs("", "txd", "CubeShadow", Single);
generate_sigs("", "txd", "1DArrayShadow", Single);
generate_sigs("", "txd", "2DArrayShadow", Single);
+ # ARB_texture_cube_map_array extension
+ generate_fiu_sigs("txd", "CubeArray")
end_function(fs, "textureGrad")
start_function("textureGradOffset")
if (extensions->ARB_uniform_buffer_object)
add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);
+
+ if (extensions->ARB_texture_cube_map_array)
+ add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
}
language_version = 110;
usampler1DArray KEYWORD(130, 130, USAMPLER1DARRAY);
usampler2DArray KEYWORD(130, 130, USAMPLER2DARRAY);
-samplerExternalOES {
+samplerCubeArray {
+ if (yyextra->ARB_texture_cube_map_array_enable)
+ return SAMPLERCUBEARRAY;
+ else
+ return IDENTIFIER;
+ }
+isamplerCubeArray {
+ if (yyextra->ARB_texture_cube_map_array_enable)
+ return ISAMPLERCUBEARRAY;
+ else
+ return IDENTIFIER;
+ }
+usamplerCubeArray {
+ if (yyextra->ARB_texture_cube_map_array_enable)
+ return USAMPLERCUBEARRAY;
+ else
+ return IDENTIFIER;
+ }
+samplerCubeArrayShadow {
+ if (yyextra->ARB_texture_cube_map_array_enable)
+ return SAMPLERCUBEARRAYSHADOW;
+ else
+ return IDENTIFIER;
+ }
+
+samplerExternalOES {
if (yyextra->OES_EGL_image_external_enable)
return SAMPLEREXTERNALOES;
else
return IDENTIFIER;
- }
+ }
struct return STRUCT;
%token MAT4X2 MAT4X3 MAT4X4
%token SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW
%token SAMPLERCUBESHADOW SAMPLER1DARRAY SAMPLER2DARRAY SAMPLER1DARRAYSHADOW
-%token SAMPLER2DARRAYSHADOW ISAMPLER1D ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
-%token ISAMPLER1DARRAY ISAMPLER2DARRAY USAMPLER1D USAMPLER2D USAMPLER3D
-%token USAMPLERCUBE USAMPLER1DARRAY USAMPLER2DARRAY
+%token SAMPLER2DARRAYSHADOW SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
+%token ISAMPLER1D ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
+%token ISAMPLER1DARRAY ISAMPLER2DARRAY ISAMPLERCUBEARRAY
+%token USAMPLER1D USAMPLER2D USAMPLER3D USAMPLERCUBE USAMPLER1DARRAY
+%token USAMPLER2DARRAY USAMPLERCUBEARRAY
%token SAMPLER2DRECT ISAMPLER2DRECT USAMPLER2DRECT SAMPLER2DRECTSHADOW
%token SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
%token SAMPLEREXTERNALOES
| SAMPLER1DARRAYSHADOW { $$ = "sampler1DArrayShadow"; }
| SAMPLER2DARRAYSHADOW { $$ = "sampler2DArrayShadow"; }
| SAMPLERBUFFER { $$ = "samplerBuffer"; }
+ | SAMPLERCUBEARRAY { $$ = "samplerCubeArray"; }
+ | SAMPLERCUBEARRAYSHADOW { $$ = "samplerCubeArrayShadow"; }
| ISAMPLER1D { $$ = "isampler1D"; }
| ISAMPLER2D { $$ = "isampler2D"; }
| ISAMPLER2DRECT { $$ = "isampler2DRect"; }
| ISAMPLER1DARRAY { $$ = "isampler1DArray"; }
| ISAMPLER2DARRAY { $$ = "isampler2DArray"; }
| ISAMPLERBUFFER { $$ = "isamplerBuffer"; }
+ | ISAMPLERCUBEARRAY { $$ = "isamplerCubeArray"; }
| USAMPLER1D { $$ = "usampler1D"; }
| USAMPLER2D { $$ = "usampler2D"; }
| USAMPLER2DRECT { $$ = "usampler2DRect"; }
| USAMPLER1DARRAY { $$ = "usampler1DArray"; }
| USAMPLER2DARRAY { $$ = "usampler2DArray"; }
| USAMPLERBUFFER { $$ = "usamplerBuffer"; }
+ | USAMPLERCUBEARRAY { $$ = "usamplerCubeArray"; }
;
precision_qualifier:
EXT(ARB_shader_bit_encoding, true, true, true, true, false, ARB_shader_bit_encoding),
EXT(ARB_uniform_buffer_object, true, false, true, true, false, ARB_uniform_buffer_object),
EXT(OES_standard_derivatives, false, false, true, false, true, OES_standard_derivatives),
+ EXT(ARB_texture_cube_map_array, true, false, true, true, false, ARB_texture_cube_map_array),
};
#undef EXT
bool ARB_uniform_buffer_object_warn;
bool OES_standard_derivatives_enable;
bool OES_standard_derivatives_warn;
+ bool ARB_texture_cube_map_array_enable;
+ bool ARB_texture_cube_map_array_warn;
/*@}*/
/** Extensions supported by the OpenGL implementation. */
case GLSL_SAMPLER_DIM_3D:
return TEXTURE_3D_INDEX;
case GLSL_SAMPLER_DIM_CUBE:
- return TEXTURE_CUBE_INDEX;
+ return (t->sampler_array) ? TEXTURE_CUBE_ARRAY_INDEX : TEXTURE_CUBE_INDEX;
case GLSL_SAMPLER_DIM_RECT:
return TEXTURE_RECT_INDEX;
case GLSL_SAMPLER_DIM_BUF:
warn);
}
+void
+glsl_type::generate_ARB_texture_cube_map_array_types(glsl_symbol_table *symtab,
+ bool warn)
+{
+ add_types_to_symbol_table(symtab, builtin_ARB_texture_cube_map_array_types,
+ Elements(builtin_ARB_texture_cube_map_array_types),
+ warn);
+}
+
void
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
{
glsl_type::generate_OES_EGL_image_external_types(state->symbols,
state->OES_EGL_image_external_warn);
}
+
+ if (state->ARB_texture_cube_map_array_enable) {
+ glsl_type::generate_ARB_texture_cube_map_array_types(state->symbols,
+ state->ARB_texture_cube_map_array_warn);
+ }
}
static const glsl_type builtin_EXT_texture_array_types[];
static const glsl_type builtin_EXT_texture_buffer_object_types[];
static const glsl_type builtin_OES_EGL_image_external_types[];
+ static const glsl_type builtin_ARB_texture_cube_map_array_types[];
/*@}*/
/**
static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);
static void generate_OES_texture_3D_types(glsl_symbol_table *, bool);
static void generate_OES_EGL_image_external_types(glsl_symbol_table *, bool);
+ static void generate_ARB_texture_cube_map_array_types(glsl_symbol_table *, bool);
/*@}*/
/**
ctx->Extensions.OES_EGL_image_external = true;
ctx->Extensions.ARB_shader_bit_encoding = true;
ctx->Extensions.OES_standard_derivatives = true;
+ ctx->Extensions.ARB_texture_cube_map_array = true;
ctx->Const.GLSLVersion = 120;