#include "compiler/glsl_types.h"
#include "glsl_parser_extras.h"
#include "util/macros.h"
+#include "main/mtypes.h"
/**
* Declarations of type flyweights (glsl_type::_foo_type) and
&glsl_type::_struct_##NAME##_type;
static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = {
- glsl_struct_field(glsl_type::float_type, "near"),
- glsl_struct_field(glsl_type::float_type, "far"),
- glsl_struct_field(glsl_type::float_type, "diff"),
+ glsl_struct_field(glsl_type::float_type, GLSL_PRECISION_HIGH, "near"),
+ glsl_struct_field(glsl_type::float_type, GLSL_PRECISION_HIGH, "far"),
+ glsl_struct_field(glsl_type::float_type, GLSL_PRECISION_HIGH, "diff"),
};
static const struct glsl_struct_field gl_PointParameters_fields[] = {
/* Add deprecated structure types. While these were deprecated in 1.30,
* they're still present. We've removed them in 1.40+ (OpenGL 3.1+).
*/
- if (state->compat_shader) {
+ if (state->compat_shader || state->ARB_compatibility_enable) {
for (unsigned i = 0; i < ARRAY_SIZE(deprecated_types); i++) {
add_type(symbols, deprecated_types[i]);
}
add_type(symbols, glsl_type::sampler2DRectShadow_type);
}
+ if (state->EXT_gpu_shader4_enable) {
+ add_type(symbols, glsl_type::uint_type);
+ add_type(symbols, glsl_type::uvec2_type);
+ add_type(symbols, glsl_type::uvec3_type);
+ add_type(symbols, glsl_type::uvec4_type);
+
+ add_type(symbols, glsl_type::samplerCubeShadow_type);
+
+ if (state->ctx->Extensions.EXT_texture_array) {
+ add_type(symbols, glsl_type::sampler1DArray_type);
+ add_type(symbols, glsl_type::sampler2DArray_type);
+ add_type(symbols, glsl_type::sampler1DArrayShadow_type);
+ add_type(symbols, glsl_type::sampler2DArrayShadow_type);
+ }
+ if (state->ctx->Extensions.EXT_texture_buffer_object) {
+ add_type(symbols, glsl_type::samplerBuffer_type);
+ }
+
+ if (state->ctx->Extensions.EXT_texture_integer) {
+ add_type(symbols, glsl_type::isampler1D_type);
+ add_type(symbols, glsl_type::isampler2D_type);
+ add_type(symbols, glsl_type::isampler3D_type);
+ add_type(symbols, glsl_type::isamplerCube_type);
+
+ add_type(symbols, glsl_type::usampler1D_type);
+ add_type(symbols, glsl_type::usampler2D_type);
+ add_type(symbols, glsl_type::usampler3D_type);
+ add_type(symbols, glsl_type::usamplerCube_type);
+
+ if (state->ctx->Extensions.NV_texture_rectangle) {
+ add_type(symbols, glsl_type::isampler2DRect_type);
+ add_type(symbols, glsl_type::usampler2DRect_type);
+ }
+ if (state->ctx->Extensions.EXT_texture_array) {
+ add_type(symbols, glsl_type::isampler1DArray_type);
+ add_type(symbols, glsl_type::isampler2DArray_type);
+ add_type(symbols, glsl_type::usampler1DArray_type);
+ add_type(symbols, glsl_type::usampler2DArray_type);
+ }
+ if (state->ctx->Extensions.EXT_texture_buffer_object) {
+ add_type(symbols, glsl_type::isamplerBuffer_type);
+ add_type(symbols, glsl_type::usamplerBuffer_type);
+ }
+ }
+ }
+
if (state->EXT_texture_array_enable) {
add_type(symbols, glsl_type::sampler1DArray_type);
add_type(symbols, glsl_type::sampler2DArray_type);
add_type(symbols, glsl_type::sampler2DArrayShadow_type);
}
- if (state->OES_EGL_image_external_enable) {
+ if (state->OES_EGL_image_external_enable ||
+ state->OES_EGL_image_external_essl3_enable) {
add_type(symbols, glsl_type::samplerExternalOES_type);
}
add_type(symbols, glsl_type::dmat4x3_type);
}
- if (state->ARB_gpu_shader_int64_enable) {
+ if (state->ARB_gpu_shader_int64_enable ||
+ state->AMD_gpu_shader_int64_enable) {
add_type(symbols, glsl_type::int64_t_type);
add_type(symbols, glsl_type::i64vec2_type);
add_type(symbols, glsl_type::i64vec3_type);