Lines Matching refs:state
423 struct _mesa_glsl_parse_state *state);
516 struct _mesa_glsl_parse_state * const state;
544 exec_list *instructions, struct _mesa_glsl_parse_state *state)
545 : instructions(instructions), state(state), symtab(state->symbols),
546 compatibility(state->compat_shader || state->ARB_compatibility_enable),
591 if (state->es_shader)
637 if (state->es_shader)
731 add_const("gl_MaxVertexAttribs", state->Const.MaxVertexAttribs);
733 state->Const.MaxVertexTextureImageUnits);
735 state->Const.MaxCombinedTextureImageUnits);
736 add_const("gl_MaxTextureImageUnits", state->Const.MaxTextureImageUnits);
737 add_const("gl_MaxDrawBuffers", state->Const.MaxDrawBuffers);
743 if (!state->es_shader) {
745 state->Const.MaxFragmentUniformComponents);
747 state->Const.MaxVertexUniformComponents);
750 if (state->is_version(410, 100)) {
752 state->Const.MaxVertexUniformComponents / 4);
754 state->Const.MaxFragmentUniformComponents / 4);
759 if (state->is_version(0, 300)) {
761 state->consts->Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4);
763 state->consts->Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4);
766 state->consts->MaxVarying);
772 if (state->EXT_blend_func_extended_enable) {
774 state->Const.MaxDualSourceDrawBuffers);
781 if (compatibility || !state->is_version(420, 100)) {
782 add_const("gl_MaxVaryingFloats", state->consts->MaxVarying * 4);
789 if ((state->is_version(130, 0) &&
790 state->ARB_shading_language_420pack_enable) ||
791 state->is_version(420, 300)) {
793 state->Const.MinProgramTexelOffset);
795 state->Const.MaxProgramTexelOffset);
798 if (state->has_clip_distance()) {
799 add_const("gl_MaxClipDistances", state->Const.MaxClipPlanes);
801 if (state->is_version(130, 0)) {
802 add_const("gl_MaxVaryingComponents", state->consts->MaxVarying * 4);
804 if (state->has_cull_distance()) {
805 add_const("gl_MaxCullDistances", state->Const.MaxClipPlanes);
807 state->Const.MaxClipPlanes);
810 if (state->has_geometry_shader()) {
812 state->Const.MaxVertexOutputComponents);
814 state->Const.MaxGeometryInputComponents);
816 state->Const.MaxGeometryOutputComponents);
818 state->Const.MaxFragmentInputComponents);
820 state->Const.MaxGeometryTextureImageUnits);
822 state->Const.MaxGeometryOutputVertices);
824 state->Const.MaxGeometryTotalOutputComponents);
826 state->Const.MaxGeometryUniformComponents);
838 state->Const.MaxGeometryOutputComponents);
847 add_const("gl_MaxLights", state->Const.MaxLights);
849 add_const("gl_MaxClipPlanes", state->Const.MaxClipPlanes);
854 add_const("gl_MaxTextureUnits", state->Const.MaxTextureUnits);
860 add_const("gl_MaxTextureCoords", state->Const.MaxTextureCoords);
863 if (state->has_atomic_counters()) {
865 state->Const.MaxVertexAtomicCounters);
867 state->Const.MaxFragmentAtomicCounters);
869 state->Const.MaxCombinedAtomicCounters);
871 state->Const.MaxAtomicBufferBindings);
873 if (state->has_geometry_shader()) {
875 state->Const.MaxGeometryAtomicCounters);
877 if (state->is_version(110, 320)) {
879 state->Const.MaxTessControlAtomicCounters);
881 state->Const.MaxTessEvaluationAtomicCounters);
885 if (state->is_version(420, 310)) {
887 state->Const.MaxVertexAtomicCounterBuffers);
889 state->Const.MaxFragmentAtomicCounterBuffers);
891 state->Const.MaxCombinedAtomicCounterBuffers);
893 state->Const.MaxAtomicCounterBufferSize);
895 if (state->has_geometry_shader()) {
897 state->Const.MaxGeometryAtomicCounterBuffers);
899 if (state->is_version(110, 320)) {
901 state->Const.MaxTessControlAtomicCounterBuffers);
903 state->Const.MaxTessEvaluationAtomicCounterBuffers);
907 if (state->is_version(430, 310) || state->ARB_compute_shader_enable) {
909 state->Const.MaxComputeAtomicCounterBuffers);
911 state->Const.MaxComputeAtomicCounters);
913 state->Const.MaxComputeImageUniforms);
915 state->Const.MaxComputeTextureImageUnits);
917 state->Const.MaxComputeUniformComponents);
920 state->Const.MaxComputeWorkGroupCount[0],
921 state->Const.MaxComputeWorkGroupCount[1],
922 state->Const.MaxComputeWorkGroupCount[2]);
924 state->Const.MaxComputeWorkGroupSize[0],
925 state->Const.MaxComputeWorkGroupSize[1],
926 state->Const.MaxComputeWorkGroupSize[2]);
949 if (state->has_enhanced_layouts()) {
951 state->Const.MaxTransformFeedbackBuffers);
953 state->Const.MaxTransformFeedbackInterleavedComponents);
956 if (state->has_shader_image_load_store()) {
958 state->Const.MaxImageUnits);
960 state->Const.MaxVertexImageUniforms);
962 state->Const.MaxFragmentImageUniforms);
964 state->Const.MaxCombinedImageUniforms);
966 if (state->has_geometry_shader()) {
968 state->Const.MaxGeometryImageUniforms);
971 if (!state->es_shader) {
973 state->Const.MaxCombinedShaderOutputResources);
975 state->Const.MaxImageSamples);
978 if (state->has_tessellation_shader()) {
980 state->Const.MaxTessControlImageUniforms);
982 state->Const.MaxTessEvaluationImageUniforms);
986 if (state->is_version(440, 310) ||
987 state->ARB_ES3_1_compatibility_enable) {
989 state->Const.MaxCombinedShaderOutputResources);
992 if (state->is_version(410, 0) ||
993 state->ARB_viewport_array_enable ||
994 state->OES_viewport_array_enable) {
996 state->Const.MaxViewports);
999 if (state->has_tessellation_shader()) {
1000 add_const("gl_MaxPatchVertices", state->Const.MaxPatchVertices);
1001 add_const("gl_MaxTessGenLevel", state->Const.MaxTessGenLevel);
1002 add_const("gl_MaxTessControlInputComponents", state->Const.MaxTessControlInputComponents);
1003 add_const("gl_MaxTessControlOutputComponents", state->Const.MaxTessControlOutputComponents);
1004 add_const("gl_MaxTessControlTextureImageUnits", state->Const.MaxTessControlTextureImageUnits);
1005 add_const("gl_MaxTessEvaluationInputComponents", state->Const.MaxTessEvaluationInputComponents);
1006 add_const("gl_MaxTessEvaluationOutputComponents", state->Const.MaxTessEvaluationOutputComponents);
1007 add_const("gl_MaxTessEvaluationTextureImageUnits", state->Const.MaxTessEvaluationTextureImageUnits);
1008 add_const("gl_MaxTessPatchComponents", state->Const.MaxTessPatchComponents);
1009 add_const("gl_MaxTessControlTotalOutputComponents", state->Const.MaxTessControlTotalOutputComponents);
1010 add_const("gl_MaxTessControlUniformComponents", state->Const.MaxTessControlUniformComponents);
1011 add_const("gl_MaxTessEvaluationUniformComponents", state->Const.MaxTessEvaluationUniformComponents);
1014 if (state->is_version(450, 320) ||
1015 state->OES_sample_variables_enable ||
1016 state->ARB_ES3_1_compatibility_enable)
1017 add_const("gl_MaxSamples", state->Const.MaxSamples);
1027 if (state->is_version(400, 320) ||
1028 state->ARB_sample_shading_enable ||
1029 state->OES_sample_variables_enable)
1059 array(mat4_t, state->Const.MaxTextureCoords);
1065 add_uniform(array(vec4_t, state->Const.MaxClipPlanes), "gl_ClipPlane");
1074 state->Const.MaxLights),
1083 array(type("gl_LightProducts"), state->Const.MaxLights);
1087 add_uniform(array(vec4_t, state->Const.MaxTextureUnits),
1091 array(vec4_t, state->Const.MaxTextureCoords);
1112 if (state->ARB_shader_ballot_enable) {
1130 if (state->is_version(130, 300) || state->EXT_gpu_shader4_enable) {
1134 if (state->is_version(460, 0)) {
1139 if (state->EXT_draw_instanced_enable && state->is_version(0, 100))
1143 if (state->ARB_draw_instanced_enable)
1146 if (state->ARB_draw_instanced_enable || state->is_version(140, 300) ||
1147 state->EXT_gpu_shader4_enable) {
1151 if (state->ARB_shader_draw_parameters_enable) {
1192 int bbox_slot = state->consts->NoPrimitiveBoundingBoxOutput ? -1 :
1194 if (state->EXT_primitive_bounding_box_enable)
1197 if (state->OES_primitive_bounding_box_enable) {
1201 if (state->is_version(0, 320) || state->ARB_ES3_2_compatibility_enable) {
1210 if (state->NV_viewport_array2_enable) {
1233 if (this->state->consts->GLSLTessLevelsAsInputs) {
1244 if (state->ARB_shader_viewport_layer_array_enable ||
1245 state->NV_viewport_array2_enable) {
1251 if (state->NV_viewport_array2_enable) {
1269 if (state->is_version(410, 0) || state->ARB_viewport_array_enable ||
1270 state->OES_viewport_array_enable) {
1275 if (state->NV_viewport_array2_enable) {
1280 if (state->is_version(400, 320) || state->ARB_gpu_shader5_enable ||
1281 state->OES_geometry_shader_enable || state->EXT_geometry_shader_enable) {
1313 int frag_coord_precision = (state->is_version(0, 300) ?
1317 if (this->state->consts->GLSLFragCoordIsSysVal) {
1324 if (this->state->consts->GLSLFrontFacingIsSysVal) {
1332 if (state->is_version(120, 100)) {
1333 if (this->state->consts->GLSLPointCoordIsSysVal)
1341 if (state->has_geometry_shader() || state->EXT_gpu_shader4_enable) {
1351 if (compatibility || !state->is_version(420, 300)) {
1355 array(vec4_t, state->Const.MaxDrawBuffers),
1360 if (state->has_framebuffer_fetch() && !state->is_version(130, 300)) {
1363 array(vec4_t, state->Const.MaxDrawBuffers),
1371 if (state->has_framebuffer_fetch_zs()) {
1387 if (state->es_shader && state->language_version == 100 && state->EXT_blend_func_extended_enable) {
1391 array(vec4_t, state->Const.MaxDualSourceDrawBuffers),
1398 if (state->is_version(110, 300)) {
1403 if (state->EXT_frag_depth_enable)
1406 if (state->ARB_shader_stencil_export_enable) {
1409 if (state->ARB_shader_stencil_export_warn)
1413 if (state->AMD_shader_stencil_export_enable) {
1416 if (state->AMD_shader_stencil_export_warn)
1420 if (state->is_version(400, 320) ||
1421 state->ARB_sample_shading_enable ||
1422 state->OES_sample_variables_enable) {
1438 if (state->is_version(400, 320) ||
1439 state->ARB_gpu_shader5_enable ||
1440 state->OES_sample_variables_enable) {
1445 if (state->is_version(430, 320) ||
1446 state->ARB_fragment_layer_viewport_enable ||
1447 state->OES_geometry_shader_enable ||
1448 state->EXT_geometry_shader_enable) {
1453 if (state->is_version(430, 0) ||
1454 state->ARB_fragment_layer_viewport_enable ||
1455 state->OES_viewport_array_enable) {
1459 if (state->is_version(450, 310) || state->ARB_ES3_1_compatibility_enable)
1475 if (state->ARB_compute_variable_group_size_enable) {
1497 switch (state->stage) {
1526 &state->consts->ShaderCompilerOptions[state->stage];
1529 if (state->stage != MESA_SHADER_FRAGMENT) {
1531 if (!state->es_shader ||
1532 state->stage == MESA_SHADER_VERTEX ||
1533 (state->stage == MESA_SHADER_GEOMETRY &&
1534 (state->OES_geometry_point_size_enable ||
1535 state->EXT_geometry_point_size_enable)) ||
1536 ((state->stage == MESA_SHADER_TESS_CTRL ||
1537 state->stage == MESA_SHADER_TESS_EVAL) &&
1538 (state->OES_tessellation_point_size_enable ||
1539 state->EXT_tessellation_point_size_enable))) {
1542 state->is_version(0, 300) ?
1547 if (state->stage == MESA_SHADER_VERTEX) {
1548 if (state->AMD_vertex_shader_viewport_index_enable ||
1549 state->ARB_shader_viewport_layer_array_enable ||
1550 state->NV_viewport_array2_enable) {
1554 if (state->AMD_vertex_shader_layer_enable ||
1555 state->ARB_shader_viewport_layer_array_enable ||
1556 state->NV_viewport_array2_enable) {
1571 if (state->NV_viewport_array2_enable)
1577 if (state->has_clip_distance()) {
1581 if (state->has_cull_distance()) {
1589 if (state->stage == MESA_SHADER_FRAGMENT) {
1613 if (state->stage == MESA_SHADER_TESS_CTRL ||
1614 state->stage == MESA_SHADER_TESS_EVAL) {
1617 add_variable("gl_in", array(per_vertex_in_type, state->Const.MaxPatchVertices),
1620 if (state->stage == MESA_SHADER_GEOMETRY) {
1626 if (state->stage == MESA_SHADER_TESS_CTRL) {
1632 if (state->stage == MESA_SHADER_VERTEX ||
1633 state->stage == MESA_SHADER_TESS_EVAL ||
1634 state->stage == MESA_SHADER_GEOMETRY) {
1663 struct _mesa_glsl_parse_state *state)
1665 builtin_variable_generator gen(instructions, state);
1673 switch (state->stage) {