diff options
author | marha <marha@users.sourceforge.net> | 2015-05-26 19:43:34 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-05-26 19:43:34 +0200 |
commit | 912e881bec8b16f2331225960645c3bdf5a8ba2d (patch) | |
tree | 92afd568d4b3eaab1faf26d8d95d8c6df0173079 /mesalib/src/mesa/main/shader_query.cpp | |
parent | 2e00f3764228cfc91180bbe9375a8d85e0e65a5b (diff) | |
parent | 843964ee791452b197e41dacb0146f5b456ffaa5 (diff) | |
download | vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.tar.gz vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.tar.bz2 vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mapi/glapi/glapi_priv.h
mesalib/src/mesa/drivers/dri/swrast/swrast.c
xorg-server/dix/dispatch.c
xorg-server/os/utils.c
xorg-server/record/record.c
Diffstat (limited to 'mesalib/src/mesa/main/shader_query.cpp')
-rw-r--r-- | mesalib/src/mesa/main/shader_query.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/shader_query.cpp b/mesalib/src/mesa/main/shader_query.cpp index d2ca49b43..3445f89a3 100644 --- a/mesalib/src/mesa/main/shader_query.cpp +++ b/mesalib/src/mesa/main/shader_query.cpp @@ -28,6 +28,7 @@ * \author Ian Romanick <ian.d.romanick@intel.com> */ +#include "main/context.h" #include "main/core.h" #include "glsl_symbol_table.h" #include "ir.h" @@ -809,6 +810,8 @@ stage_from_enum(GLenum ref) return MESA_SHADER_GEOMETRY; case GL_REFERENCED_BY_FRAGMENT_SHADER: return MESA_SHADER_FRAGMENT; + case GL_REFERENCED_BY_COMPUTE_SHADER: + return MESA_SHADER_COMPUTE; default: assert(!"shader stage not supported"); return MESA_SHADER_STAGES; @@ -824,6 +827,10 @@ is_resource_referenced(struct gl_shader_program *shProg, struct gl_program_resource *res, GLuint index, uint8_t stage) { + /* First, check if we even have such a stage active. */ + if (!shProg->_LinkedShaders[stage]) + return false; + if (res->Type == GL_ATOMIC_COUNTER_BUFFER) return RESOURCE_ATC(res)->StageReferences[stage]; @@ -979,6 +986,10 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg, case GL_NUM_ACTIVE_VARIABLES: case GL_ACTIVE_VARIABLES: return get_buffer_property(shProg, res, prop, val, caller); + case GL_REFERENCED_BY_COMPUTE_SHADER: + if (!_mesa_has_compute_shaders(ctx)) + goto invalid_enum; + /* fallthrough */ case GL_REFERENCED_BY_VERTEX_SHADER: case GL_REFERENCED_BY_GEOMETRY_SHADER: case GL_REFERENCED_BY_FRAGMENT_SHADER: @@ -1015,17 +1026,18 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg, case GL_IS_PER_PATCH: case GL_REFERENCED_BY_TESS_CONTROL_SHADER: case GL_REFERENCED_BY_TESS_EVALUATION_SHADER: - /* GL_ARB_compute_shader */ - case GL_REFERENCED_BY_COMPUTE_SHADER: default: - _mesa_error(ctx, GL_INVALID_ENUM, "%s(%s prop %s)", caller, - _mesa_lookup_enum_by_nr(res->Type), - _mesa_lookup_enum_by_nr(prop)); - return 0; + goto invalid_enum; } #undef VALIDATE_TYPE +invalid_enum: + _mesa_error(ctx, GL_INVALID_ENUM, "%s(%s prop %s)", caller, + _mesa_lookup_enum_by_nr(res->Type), + _mesa_lookup_enum_by_nr(prop)); + return 0; + invalid_operation: _mesa_error(ctx, GL_INVALID_OPERATION, "%s(%s prop %s)", caller, _mesa_lookup_enum_by_nr(res->Type), |