diff options
author | Samuel Pitoiset <[email protected]> | 2017-04-24 14:16:15 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-14 10:04:36 +0200 |
commit | eb9c708ee2f7d676c6428920adbca4d665fb4174 (patch) | |
tree | 6b1c5c2ddc3d4ef22985eb154f0c432ed02c978e | |
parent | 67ab372c60cd18d88468aa586ceaf2810da79200 (diff) |
mesa: refuse to update tex parameters when a handle is allocated
The ARB_bindless_texture spec says:
"The ARB_bindless_texture spec says: "The error INVALID_OPERATION
is generated by TexImage*, CopyTexImage*, CompressedTexImage*,
TexBuffer*, TexParameter*, as well as other functions defined in
terms of these, if the texture object to be modified is referenced
by one or more texture or image handles."
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/mesa/main/texparam.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index c75adc6417d..6c0a5c46d60 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -273,6 +273,19 @@ set_tex_parameteri(struct gl_context *ctx, { const char *suffix = dsa ? "ture" : ""; + if (texObj->HandleAllocated) { + /* The ARB_bindless_texture spec says: + * + * "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, + * CompressedTexImage*, TexBuffer*, TexParameter*, as well as other + * functions defined in terms of these, if the texture object to be + * modified is referenced by one or more texture or image handles." + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTex%sParameter(immutable texture)", suffix); + return GL_FALSE; + } + switch (pname) { case GL_TEXTURE_MIN_FILTER: if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target)) @@ -636,6 +649,19 @@ set_tex_parameterf(struct gl_context *ctx, { const char *suffix = dsa ? "ture" : ""; + if (texObj->HandleAllocated) { + /* The ARB_bindless_texture spec says: + * + * "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, + * CompressedTexImage*, TexBuffer*, TexParameter*, as well as other + * functions defined in terms of these, if the texture object to be + * modified is referenced by one or more texture or image handles." + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTex%sParameter(immutable texture)", suffix); + return GL_FALSE; + } + switch (pname) { case GL_TEXTURE_MIN_LOD: if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) @@ -974,6 +1000,12 @@ _mesa_texture_parameterIiv(struct gl_context *ctx, { switch (pname) { case GL_TEXTURE_BORDER_COLOR: + if (texObj->HandleAllocated) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTextureParameterIiv(immutable texture)"); + return; + } + if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameterIiv(texture)"); return; @@ -996,6 +1028,12 @@ _mesa_texture_parameterIuiv(struct gl_context *ctx, { switch (pname) { case GL_TEXTURE_BORDER_COLOR: + if (texObj->HandleAllocated) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTextureParameterIuiv(immutable texture)"); + return; + } + if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glTextureParameterIuiv(texture)"); return; |