mesa: fix MSVC signed/unsigned warnings in context.c
[mesa.git] / src / mesa / main / samplerobj.c
index 5bb90cf72f0913713b574f15135907f0d82ba8da..09cbd2939fa8bc63a1b04911459c4c34ac49fda4 100644 (file)
@@ -130,7 +130,6 @@ _mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
    sampObj->MaxAnisotropy = 1.0F;
    sampObj->CompareMode = GL_NONE;
    sampObj->CompareFunc = GL_LEQUAL;
-   sampObj->CompareFailValue = 0.0;
    sampObj->sRGBDecode = GL_DECODE_EXT;
    sampObj->CubeMapSeamless = GL_FALSE;
 }
@@ -156,11 +155,11 @@ void
 _mesa_delete_sampler_object(struct gl_context *ctx,
                             struct gl_sampler_object *sampObj)
 {
-   FREE(sampObj);
+   free(sampObj);
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_GenSamplers(GLsizei count, GLuint *samplers)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -192,7 +191,7 @@ _mesa_GenSamplers(GLsizei count, GLuint *samplers)
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -242,7 +241,7 @@ _mesa_IsSampler(GLuint sampler)
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_BindSampler(GLuint unit, GLuint sampler)
 {
    struct gl_sampler_object *sampObj;
@@ -600,7 +599,7 @@ set_sampler_srgb_decode(struct gl_context *ctx,
    return GL_TRUE;
 }
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
 {
    struct gl_sampler_object *sampObj;
@@ -1445,7 +1444,8 @@ _mesa_init_sampler_object_functions(struct dd_function_table *driver)
 
 
 void
-_mesa_init_sampler_object_dispatch(struct _glapi_table *disp)
+_mesa_init_sampler_object_dispatch(const struct gl_context *ctx,
+                                   struct _glapi_table *disp)
 {
    SET_GenSamplers(disp, _mesa_GenSamplers);
    SET_DeleteSamplers(disp, _mesa_DeleteSamplers);
@@ -1455,10 +1455,13 @@ _mesa_init_sampler_object_dispatch(struct _glapi_table *disp)
    SET_SamplerParameterf(disp, _mesa_SamplerParameterf);
    SET_SamplerParameteriv(disp, _mesa_SamplerParameteriv);
    SET_SamplerParameterfv(disp, _mesa_SamplerParameterfv);
-   SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv);
-   SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv);
    SET_GetSamplerParameteriv(disp, _mesa_GetSamplerParameteriv);
    SET_GetSamplerParameterfv(disp, _mesa_GetSamplerParameterfv);
-   SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv);
-   SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv);
+
+   if (_mesa_is_desktop_gl(ctx)) {
+      SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv);
+      SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv);
+      SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv);
+      SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv);
+   }
 }