static struct gl_sampler_object *
sampler_parameter_error_check(struct gl_context *ctx, GLuint sampler,
- const char *name)
+ bool get, const char *name)
{
struct gl_sampler_object *sampObj;
return NULL;
}
+ if (!get && sampObj->HandleAllocated) {
+ /* The ARB_bindless_texture spec says:
+ *
+ * "The error INVALID_OPERATION is generated by SamplerParameter* if
+ * <sampler> identifies a sampler object referenced by one or more
+ * texture handles."
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(immutable sampler)", name);
+ return NULL;
+ }
+
return sampObj;
}
GLuint res;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, false,
"glSamplerParameteri");
if (!sampObj)
return;
GLuint res;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, false,
"glSamplerParameterf");
if (!sampObj)
return;
GLuint res;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, false,
"glSamplerParameteriv");
if (!sampObj)
return;
GLuint res;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, false,
"glSamplerParameterfv");
if (!sampObj)
return;
GLuint res;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, false,
"glSamplerParameterIiv");
if (!sampObj)
return;
GLuint res;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, false,
"glSamplerParameterIuiv");
if (!sampObj)
return;
struct gl_sampler_object *sampObj;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, true,
"glGetSamplerParameteriv");
if (!sampObj)
return;
struct gl_sampler_object *sampObj;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, true,
"glGetSamplerParameterfv");
if (!sampObj)
return;
struct gl_sampler_object *sampObj;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, true,
"glGetSamplerParameterIiv");
if (!sampObj)
return;
struct gl_sampler_object *sampObj;
GET_CURRENT_CONTEXT(ctx);
- sampObj = sampler_parameter_error_check(ctx, sampler,
+ sampObj = sampler_parameter_error_check(ctx, sampler, true,
"glGetSamplerParameterIuiv");
if (!sampObj)
return;