mesa/dd: burn a bunch of legacy driver interfaces down

None of these are used anymore in the gallium world, there
are some more to get rid off but this is a good start.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14074>
This commit is contained in:
Dave Airlie 2021-12-06 14:31:44 +10:00
parent e2c05539fe
commit 279471bda6
23 changed files with 22 additions and 497 deletions

View file

@ -964,10 +964,6 @@ get_program_iv(struct gl_program *prog, GLenum target, GLenum pname,
/* default/null program */
*params = GL_FALSE;
}
else if (ctx->Driver.IsProgramNative) {
/* ask the driver */
*params = ctx->Driver.IsProgramNative( ctx, target, prog );
}
else {
/* probably running in software */
*params = GL_TRUE;

View file

@ -547,80 +547,11 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat
ctx->Texture.CurrentUnit = u;
if (ctx->Driver.TexEnv || ctx->Driver.TexGen) {
/* Slow path for legacy classic drivers. */
_mesa_set_enable(ctx, GL_TEXTURE_1D, !!(unit->Enabled & TEXTURE_1D_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_2D, !!(unit->Enabled & TEXTURE_2D_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_3D, !!(unit->Enabled & TEXTURE_3D_BIT));
if (ctx->Extensions.ARB_texture_cube_map) {
_mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP,
!!(unit->Enabled & TEXTURE_CUBE_BIT));
}
if (ctx->Extensions.NV_texture_rectangle) {
_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
!!(unit->Enabled & TEXTURE_RECT_BIT));
}
_mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode);
_mesa_TexGeni(GL_T, GL_TEXTURE_GEN_MODE, unit->GenT.Mode);
_mesa_TexGeni(GL_R, GL_TEXTURE_GEN_MODE, unit->GenR.Mode);
_mesa_TexGeni(GL_Q, GL_TEXTURE_GEN_MODE, unit->GenQ.Mode);
_mesa_TexGenfv(GL_S, GL_OBJECT_PLANE, unit->ObjectPlane[GEN_S]);
_mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->ObjectPlane[GEN_T]);
_mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->ObjectPlane[GEN_R]);
_mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->ObjectPlane[GEN_Q]);
/* Eye plane done differently to avoid re-transformation */
{
COPY_4FV(destUnit->EyePlane[GEN_S], unit->EyePlane[GEN_S]);
COPY_4FV(destUnit->EyePlane[GEN_T], unit->EyePlane[GEN_T]);
COPY_4FV(destUnit->EyePlane[GEN_R], unit->EyePlane[GEN_R]);
COPY_4FV(destUnit->EyePlane[GEN_Q], unit->EyePlane[GEN_Q]);
if (ctx->Driver.TexGen) {
ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->EyePlane[GEN_S]);
ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->EyePlane[GEN_T]);
ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->EyePlane[GEN_R]);
ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->EyePlane[GEN_Q]);
}
}
_mesa_set_enable(ctx, GL_TEXTURE_GEN_S, !!(unit->TexGenEnabled & S_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_GEN_T, !!(unit->TexGenEnabled & T_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_GEN_R, !!(unit->TexGenEnabled & R_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, !!(unit->TexGenEnabled & Q_BIT));
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
_mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
_mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS,
texstate->LodBias[u]);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB,
unit->Combine.ModeRGB);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
unit->Combine.ModeA);
{
const GLuint n = ctx->Extensions.NV_texture_env_combine4 ? 4 : 3;
GLuint i;
for (i = 0; i < n; i++) {
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB + i,
unit->Combine.SourceRGB[i]);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA + i,
unit->Combine.SourceA[i]);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB + i,
unit->Combine.OperandRGB[i]);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA + i,
unit->Combine.OperandA[i]);
}
}
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE,
1 << unit->Combine.ScaleShiftRGB);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE,
1 << unit->Combine.ScaleShiftA);
} else {
/* Fast path for other drivers. */
memcpy(destUnit, unit, sizeof(*unit));
destUnit->_CurrentCombine = NULL;
ctx->Texture.Unit[u].LodBias = texstate->LodBias[u];
ctx->Texture.Unit[u].LodBiasQuantized = texstate->LodBiasQuantized[u];
}
/* Fast path for other drivers. */
memcpy(destUnit, unit, sizeof(*unit));
destUnit->_CurrentCombine = NULL;
ctx->Texture.Unit[u].LodBias = texstate->LodBias[u];
ctx->Texture.Unit[u].LodBiasQuantized = texstate->LodBiasQuantized[u];
}
/* Restore saved textures. */
@ -955,69 +886,20 @@ _mesa_PopAttrib(void)
if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top))
_math_matrix_analyse(ctx->ModelviewMatrixStack.Top);
if (ctx->Driver.Lightfv) {
/* Legacy slow path for some classic drivers. */
for (i = 0; i < ctx->Const.MaxLights; i++) {
const struct gl_light_uniforms *lu = &attr->Light.LightSource[i];
const struct gl_light *l = &attr->Light.Light[i];
TEST_AND_UPDATE(ctx->Light.Light[i].Enabled, l->Enabled,
GL_LIGHT0 + i);
_mesa_light(ctx, i, GL_AMBIENT, lu->Ambient);
_mesa_light(ctx, i, GL_DIFFUSE, lu->Diffuse);
_mesa_light(ctx, i, GL_SPECULAR, lu->Specular);
_mesa_light(ctx, i, GL_POSITION, lu->EyePosition);
_mesa_light(ctx, i, GL_SPOT_DIRECTION, lu->SpotDirection);
{
GLfloat p[4] = { 0 };
p[0] = lu->SpotExponent;
_mesa_light(ctx, i, GL_SPOT_EXPONENT, p);
}
{
GLfloat p[4] = { 0 };
p[0] = lu->SpotCutoff;
_mesa_light(ctx, i, GL_SPOT_CUTOFF, p);
}
{
GLfloat p[4] = { 0 };
p[0] = lu->ConstantAttenuation;
_mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, p);
}
{
GLfloat p[4] = { 0 };
p[0] = lu->LinearAttenuation;
_mesa_light(ctx, i, GL_LINEAR_ATTENUATION, p);
}
{
GLfloat p[4] = { 0 };
p[0] = lu->QuadraticAttenuation;
_mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, p);
}
}
/* light model */
_mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT,
attr->Light.Model.Ambient);
_mesa_LightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER,
(GLfloat) attr->Light.Model.LocalViewer);
_mesa_LightModelf(GL_LIGHT_MODEL_TWO_SIDE,
(GLfloat) attr->Light.Model.TwoSide);
_mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
(GLfloat) attr->Light.Model.ColorControl);
} else {
/* Fast path for other drivers. */
ctx->NewState |= _NEW_LIGHT_CONSTANTS | _NEW_FF_VERT_PROGRAM;
/* Fast path for other drivers. */
ctx->NewState |= _NEW_LIGHT_CONSTANTS | _NEW_FF_VERT_PROGRAM;
memcpy(ctx->Light.LightSource, attr->Light.LightSource,
sizeof(attr->Light.LightSource));
memcpy(&ctx->Light.Model, &attr->Light.Model,
sizeof(attr->Light.Model));
memcpy(ctx->Light.LightSource, attr->Light.LightSource,
sizeof(attr->Light.LightSource));
memcpy(&ctx->Light.Model, &attr->Light.Model,
sizeof(attr->Light.Model));
for (i = 0; i < ctx->Const.MaxLights; i++) {
TEST_AND_UPDATE(ctx->Light.Light[i].Enabled,
attr->Light.Light[i].Enabled,
GL_LIGHT0 + i);
memcpy(&ctx->Light.Light[i], &attr->Light.Light[i],
sizeof(struct gl_light));
}
for (i = 0; i < ctx->Const.MaxLights; i++) {
TEST_AND_UPDATE(ctx->Light.Light[i].Enabled,
attr->Light.Light[i].Enabled,
GL_LIGHT0 + i);
memcpy(&ctx->Light.Light[i], &attr->Light.Light[i],
sizeof(struct gl_light));
}
/* shade model */
TEST_AND_CALL1(Light.ShadeModel, ShadeModel);
@ -1066,18 +948,6 @@ _mesa_PopAttrib(void)
if (ctx->Point.CoordReplace != attr->Point.CoordReplace) {
ctx->NewState |= _NEW_POINT | _NEW_FF_VERT_PROGRAM;
ctx->Point.CoordReplace = attr->Point.CoordReplace;
if (ctx->Driver.TexEnv) {
unsigned active_texture = ctx->Texture.CurrentUnit;
for (unsigned i = 0; i < ctx->Const.MaxTextureUnits; i++) {
float param = !!(ctx->Point.CoordReplace & (1 << i));
ctx->Texture.CurrentUnit = i;
ctx->Driver.TexEnv(ctx, GL_POINT_SPRITE, GL_COORD_REPLACE,
&param);
}
ctx->Texture.CurrentUnit = active_texture;
}
}
TEST_AND_UPDATE(ctx->Point.PointSprite, attr->Point.PointSprite,
GL_POINT_SPRITE);
@ -1115,9 +985,6 @@ _mesa_PopAttrib(void)
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonStipple;
else
ctx->NewState |= _NEW_POLYGONSTIPPLE;
if (ctx->Driver.PolygonStipple)
ctx->Driver.PolygonStipple(ctx, (const GLubyte *) attr->PolygonStipple);
}
if (mask & GL_SCISSOR_BIT) {
@ -1187,8 +1054,6 @@ _mesa_PopAttrib(void)
TEST_AND_UPDATE_BIT(ctx->Transform.ClipPlanesEnabled,
attr->Transform.ClipPlanesEnabled, i,
GL_CLIP_PLANE0 + i);
if (ctx->Driver.ClipPlane)
ctx->Driver.ClipPlane(ctx, GL_CLIP_PLANE0 + i, eyePlane);
}
/* normalize/rescale */
@ -1237,8 +1102,6 @@ _mesa_PopAttrib(void)
if (ctx->Driver.Viewport)
ctx->Driver.Viewport(ctx);
if (ctx->Driver.DepthRange)
ctx->Driver.DepthRange(ctx);
}
}

View file

@ -263,11 +263,6 @@ blend_func_separate(struct gl_context *ctx,
_mesa_update_valid_to_render_state(ctx);
ctx->Color._BlendFuncPerBuffer = GL_FALSE;
if (ctx->Driver.BlendFuncSeparate) {
ctx->Driver.BlendFuncSeparate(ctx, sfactorRGB, dfactorRGB,
sfactorA, dfactorA);
}
}
@ -574,9 +569,6 @@ _mesa_BlendEquation( GLenum mode )
}
ctx->Color._BlendEquationPerBuffer = GL_FALSE;
set_advanced_blend_mode(ctx, advanced_mode);
if (ctx->Driver.BlendEquationSeparate)
ctx->Driver.BlendEquationSeparate(ctx, mode, mode);
}
@ -698,9 +690,6 @@ blend_equation_separate(struct gl_context *ctx, GLenum modeRGB, GLenum modeA,
}
ctx->Color._BlendEquationPerBuffer = GL_FALSE;
set_advanced_blend_mode(ctx, BLEND_NONE);
if (ctx->Driver.BlendEquationSeparate)
ctx->Driver.BlendEquationSeparate(ctx, modeRGB, modeA);
}
@ -829,9 +818,6 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
ctx->Color.BlendColor[1] = CLAMP(tmp[1], 0.0F, 1.0F);
ctx->Color.BlendColor[2] = CLAMP(tmp[2], 0.0F, 1.0F);
ctx->Color.BlendColor[3] = CLAMP(tmp[3], 0.0F, 1.0F);
if (ctx->Driver.BlendColor)
ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor);
}
@ -872,9 +858,6 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
ctx->Color.AlphaFunc = func;
ctx->Color.AlphaRefUnclamped = ref;
ctx->Color.AlphaRef = CLAMP(ref, 0.0F, 1.0F);
if (ctx->Driver.AlphaFunc)
ctx->Driver.AlphaFunc(ctx, func, ctx->Color.AlphaRef);
return;
default:
@ -939,9 +922,6 @@ logic_op(struct gl_context *ctx, GLenum opcode, bool no_error)
ctx->Color.LogicOp = opcode;
ctx->Color._LogicOp = color_logicop_mapping[opcode & 0x0f];
_mesa_update_allow_draw_out_of_order(ctx);
if (ctx->Driver.LogicOpcode)
ctx->Driver.LogicOpcode(ctx, ctx->Color._LogicOp);
}
@ -1028,9 +1008,6 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
ctx->Color.ColorMask = mask;
_mesa_update_allow_draw_out_of_order(ctx);
if (ctx->Driver.ColorMask)
ctx->Driver.ColorMask( ctx, red, green, blue, alpha );
}

View file

@ -315,8 +315,6 @@ draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
/* Call device driver function only if fb is the bound draw buffer */
if (fb == ctx->DrawBuffer) {
if (ctx->Driver.DrawBuffer)
ctx->Driver.DrawBuffer(ctx);
if (ctx->Driver.DrawBufferAllocate)
ctx->Driver.DrawBufferAllocate(ctx);
}
@ -624,8 +622,6 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n,
* may not be valid.
*/
if (fb == ctx->DrawBuffer) {
if (ctx->Driver.DrawBuffer)
ctx->Driver.DrawBuffer(ctx);
if (ctx->Driver.DrawBufferAllocate)
ctx->Driver.DrawBufferAllocate(ctx);
}

View file

@ -92,9 +92,6 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
_mesa_update_clip_plane(ctx, p);
}
if (ctx->Driver.ClipPlane)
ctx->Driver.ClipPlane( ctx, plane, equation );
}

View file

@ -376,12 +376,6 @@ struct dd_function_table {
*/
/*@{*/
/**
* Called by glBindTexture() and glBindTextures().
*/
void (*BindTexture)( struct gl_context *ctx, GLuint texUnit,
GLenum target, struct gl_texture_object *tObj );
/**
* Called to allocate a new texture object. Drivers will usually
* allocate/return a subclass of gl_texture_object.
@ -469,13 +463,6 @@ struct dd_function_table {
void (*UnmapRenderbuffer)(struct gl_context *ctx,
struct gl_renderbuffer *rb);
/**
* Optional driver entrypoint that binds a non-texture renderbuffer's
* contents to a texture image.
*/
GLboolean (*BindRenderbufferTexImage)(struct gl_context *ctx,
struct gl_renderbuffer *rb,
struct gl_texture_image *texImage);
/*@}*/
@ -502,17 +489,6 @@ struct dd_function_table {
GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
struct gl_program *prog);
/**
* Notify driver that the sampler uniforms for the current program have
* changed. On some drivers, this may require shader recompiles.
*/
void (*SamplerUniformChange)(struct gl_context *ctx, GLenum target,
struct gl_program *prog);
/** Query if program can be loaded onto hardware */
GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
struct gl_program *prog);
/*@}*/
/**
@ -678,89 +654,14 @@ struct dd_function_table {
* May add more functions like these to the device driver in the future.
*/
/*@{*/
/** Specify the alpha test function */
void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
/** Set the blend color */
void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
/** Set the blend equation */
void (*BlendEquationSeparate)(struct gl_context *ctx,
GLenum modeRGB, GLenum modeA);
/** Specify pixel arithmetic */
void (*BlendFuncSeparate)(struct gl_context *ctx,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
/** Specify a plane against which all geometry is clipped */
void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *eq);
/** Enable and disable writing of frame buffer color components */
void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
GLboolean bmask, GLboolean amask );
/** Cause a material color to track the current color */
void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
/** Specify whether front- or back-facing facets can be culled */
void (*CullFace)(struct gl_context *ctx, GLenum mode);
/** Define front- and back-facing polygons */
void (*FrontFace)(struct gl_context *ctx, GLenum mode);
/** Specify the value used for depth buffer comparisons */
void (*DepthFunc)(struct gl_context *ctx, GLenum func);
/** Enable or disable writing into the depth buffer */
void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
/** Specify mapping of depth values from NDC to window coordinates */
void (*DepthRange)(struct gl_context *ctx);
/** Specify the current buffer for writing */
void (*DrawBuffer)(struct gl_context *ctx);
/** Used to allocated any buffers with on-demand creation */
void (*DrawBufferAllocate)(struct gl_context *ctx);
/** Enable or disable server-side gl capabilities */
void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
/** Specify fog parameters */
void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
/** Set light source parameters.
* Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
* been transformed to eye-space.
*/
void (*Lightfv)(struct gl_context *ctx, GLenum light,
GLenum pname, const GLfloat *params );
/** Set the lighting model parameters */
void (*LightModelfv)(struct gl_context *ctx, GLenum pname,
const GLfloat *params);
/** Specify the line stipple pattern */
void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
/** Specify the width of rasterized lines */
void (*LineWidth)(struct gl_context *ctx, GLfloat width);
/** Specify a logical pixel operation for color index rendering */
void (*LogicOpcode)(struct gl_context *ctx, enum gl_logicop_mode opcode);
void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
const GLfloat *params);
/** Specify the diameter of rasterized points */
void (*PointSize)(struct gl_context *ctx, GLfloat size);
/** Select a polygon rasterization mode */
void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
/** Set the scale and units used to calculate depth values */
void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units, GLfloat clamp);
/** Set the polygon stippling pattern */
void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
/* Specifies the current buffer for reading */
void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
/** Set rasterization mode */
void (*RenderMode)(struct gl_context *ctx, GLenum mode );
/** Define the scissor box */
void (*Scissor)(struct gl_context *ctx);
/** Select flat or smooth shading */
void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
/** OpenGL 2.0 two-sided StencilFunc */
void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
GLint ref, GLuint mask);
/** OpenGL 2.0 two-sided StencilMask */
void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
/** OpenGL 2.0 two-sided StencilOp */
void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
GLenum zfail, GLenum zpass);
/** Control the generation of texture coordinates */
void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
const GLfloat *params);
/** Set texture environment parameters */
void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
const GLfloat *param);
/** Set texture parameter (callee gets param value from the texObj) */
void (*TexParameter)(struct gl_context *ctx,
struct gl_texture_object *texObj, GLenum pname);
@ -858,9 +759,6 @@ struct dd_function_table {
GLuint name);
struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx,
GLuint name);
void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
struct gl_framebuffer *drawFb,
struct gl_framebuffer *readFb);
void (*FramebufferRenderbuffer)(struct gl_context *ctx,
struct gl_framebuffer *fb,
GLenum attachment,
@ -897,7 +795,6 @@ struct dd_function_table {
struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
void (*QueryCounter)(struct gl_context *ctx, struct gl_query_object *q);
void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
@ -1020,12 +917,6 @@ struct dd_function_table {
/** Need to call vbo_save_SaveFlushVertices() upon state change? */
GLboolean SaveNeedFlush;
/**
* Notify driver that the special derived value _NeedEyeCoords has
* changed.
*/
void (*LightingSpaceChange)( struct gl_context *ctx );
/**@}*/
/**
@ -1092,14 +983,6 @@ struct dd_function_table {
void (*ResumeTransformFeedback)(struct gl_context *ctx,
struct gl_transform_feedback_object *obj);
/**
* Return the number of vertices written to a stream during the last
* Begin/EndTransformFeedback block.
*/
GLsizei (*GetTransformFeedbackVertexCount)(struct gl_context *ctx,
struct gl_transform_feedback_object *obj,
GLuint stream);
/**
* \name GL_NV_texture_barrier interface
*/

View file

@ -87,9 +87,6 @@ depth_func(struct gl_context *ctx, GLenum func, bool no_error)
ctx->NewDriverState |= ctx->DriverFlags.NewDepth;
ctx->Depth.Func = func;
_mesa_update_allow_draw_out_of_order(ctx);
if (ctx->Driver.DepthFunc)
ctx->Driver.DepthFunc(ctx, func);
}
@ -134,9 +131,6 @@ _mesa_DepthMask( GLboolean flag )
ctx->NewDriverState |= ctx->DriverFlags.NewDepth;
ctx->Depth.Mask = flag;
_mesa_update_allow_draw_out_of_order(ctx);
if (ctx->Driver.DepthMask)
ctx->Driver.DepthMask( ctx, flag );
}

View file

@ -2295,15 +2295,6 @@ _mesa_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
numInstances))
return;
if (ctx->Driver.GetTransformFeedbackVertexCount &&
(ctx->Const.AlwaysUseGetTransformFeedbackVertexCount ||
!_mesa_all_varyings_in_vbos(ctx->Array.VAO))) {
GLsizei n =
ctx->Driver.GetTransformFeedbackVertexCount(ctx, obj, stream);
_mesa_draw_arrays(ctx, mode, 0, n, numInstances, 0);
return;
}
/* Maybe we should do some primitive splitting for primitive restart
* (like in DrawArrays), but we have no way to know how many vertices
* will be rendered. */

View file

@ -3061,7 +3061,7 @@ static void
check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
{
/* Skip if we know NeedsFinishRenderTexture won't be set. */
if (_mesa_is_winsys_fbo(fb) && !ctx->Driver.BindRenderbufferTexImage)
if (_mesa_is_winsys_fbo(fb))
return;
if (ctx->Driver.FinishRenderTexture) {
@ -3188,15 +3188,6 @@ _mesa_bind_framebuffers(struct gl_context *ctx,
_mesa_update_allow_draw_out_of_order(ctx);
_mesa_update_valid_to_render_state(ctx);
}
if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) {
/* The few classic drivers that actually hook this function really only
* want to know if the draw framebuffer changed.
*/
ctx->Driver.BindFramebuffer(ctx,
bindDrawBuf ? GL_FRAMEBUFFER : GL_READ_FRAMEBUFFER,
newDrawFb, newReadFb);
}
}
void GLAPIENTRY

View file

@ -184,10 +184,6 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
goto invalid_pname;
}
if (ctx->Driver.Fogfv) {
ctx->Driver.Fogfv( ctx, pname, params );
}
return;
invalid_pname:

View file

@ -53,9 +53,6 @@ _mesa_ShadeModel( GLenum mode )
FLUSH_VERTICES(ctx, _NEW_LIGHT_STATE, GL_LIGHTING_BIT);
ctx->Light.ShadeModel = mode;
if (ctx->Driver.ShadeModel)
ctx->Driver.ShadeModel( ctx, mode );
}
@ -249,9 +246,6 @@ _mesa_light(struct gl_context *ctx, GLuint lnum, GLenum pname, const GLfloat *pa
default:
unreachable("Unexpected pname in _mesa_light()");
}
if (ctx->Driver.Lightfv)
ctx->Driver.Lightfv( ctx, GL_LIGHT0 + lnum, pname, params );
}
@ -550,9 +544,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
goto invalid_pname;
}
if (ctx->Driver.LightModelfv)
ctx->Driver.LightModelfv( ctx, pname, params );
return;
invalid_pname:
@ -823,9 +814,6 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
FLUSH_CURRENT(ctx, _NEW_FF_VERT_PROGRAM);
_mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
if (ctx->Driver.ColorMaterial)
ctx->Driver.ColorMaterial( ctx, face, mode );
}
@ -1161,8 +1149,6 @@ _mesa_update_tnl_spaces( struct gl_context *ctx, GLuint new_state )
update_modelview_scale(ctx);
compute_light_positions( ctx );
if (ctx->Driver.LightingSpaceChange)
ctx->Driver.LightingSpaceChange( ctx );
return true;
}
else {

View file

@ -70,9 +70,6 @@ line_width(struct gl_context *ctx, GLfloat width, bool no_error)
FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLineState ? 0 : _NEW_LINE, GL_LINE_BIT);
ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
ctx->Line.Width = width;
if (ctx->Driver.LineWidth)
ctx->Driver.LineWidth(ctx, width);
}
@ -126,9 +123,6 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
ctx->NewDriverState |= ctx->DriverFlags.NewLineState;
ctx->Line.StippleFactor = factor;
ctx->Line.StipplePattern = pattern;
if (ctx->Driver.LineStipple)
ctx->Driver.LineStipple( ctx, factor, pattern );
}

View file

@ -4141,12 +4141,6 @@ struct gl_constants
*/
bool GLSLTessLevelsAsInputs;
/**
* Always use the GetTransformFeedbackVertexCount() driver hook, rather
* than passing the transform feedback object to the drawing function.
*/
GLboolean AlwaysUseGetTransformFeedbackVertexCount;
/** GL_ARB_map_buffer_alignment */
GLuint MinMapBufferAlignment;

View file

@ -53,9 +53,6 @@ point_size(struct gl_context *ctx, GLfloat size, bool no_error)
FLUSH_VERTICES(ctx, _NEW_POINT, GL_POINT_BIT);
ctx->Point.Size = size;
if (ctx->Driver.PointSize)
ctx->Driver.PointSize(ctx, size);
}
@ -198,9 +195,6 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
"glPointParameterf[v]{EXT,ARB}(pname)" );
return;
}
if (ctx->Driver.PointParameterfv)
ctx->Driver.PointParameterfv(ctx, pname, params);
}

View file

@ -67,9 +67,6 @@ cull_face(struct gl_context *ctx, GLenum mode, bool no_error)
GL_POLYGON_BIT);
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.CullFaceMode = mode;
if (ctx->Driver.CullFace)
ctx->Driver.CullFace(ctx, mode);
}
@ -119,9 +116,6 @@ front_face(struct gl_context *ctx, GLenum mode, bool no_error)
GL_POLYGON_BIT);
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
ctx->Polygon.FrontFace = mode;
if (ctx->Driver.FrontFace)
ctx->Driver.FrontFace(ctx, mode);
}
@ -225,9 +219,6 @@ polygon_mode(struct gl_context *ctx, GLenum face, GLenum mode, bool no_error)
return;
}
if (ctx->Driver.PolygonMode)
ctx->Driver.PolygonMode(ctx, face, mode);
if (ctx->Extensions.INTEL_conservative_rasterization ||
(mode == GL_FILL_RECTANGLE_NV || old_mode_has_fill_rectangle))
_mesa_update_valid_to_render_state(ctx);
@ -277,9 +268,6 @@ _mesa_PolygonStipple(const GLubyte *pattern)
_mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
_mesa_unmap_pbo_source(ctx, &ctx->Unpack);
if (ctx->Driver.PolygonStipple)
ctx->Driver.PolygonStipple(ctx, pattern);
}
@ -331,9 +319,6 @@ _mesa_polygon_offset_clamp(struct gl_context *ctx,
ctx->Polygon.OffsetFactor = factor;
ctx->Polygon.OffsetUnits = units;
ctx->Polygon.OffsetClamp = clamp;
if (ctx->Driver.PolygonOffset)
ctx->Driver.PolygonOffset( ctx, factor, units, clamp );
}
void GLAPIENTRY

View file

@ -628,14 +628,10 @@ _mesa_QueryCounter(GLuint id, GLenum target)
q->Ready = GL_FALSE;
q->EverBound = GL_TRUE;
if (ctx->Driver.QueryCounter) {
ctx->Driver.QueryCounter(ctx, q);
} else {
/* QueryCounter is implemented using EndQuery without BeginQuery
* in drivers. This is actually Direct3D and Gallium convention.
*/
ctx->Driver.EndQuery(ctx, q);
}
/* QueryCounter is implemented using EndQuery without BeginQuery
* in drivers. This is actually Direct3D and Gallium convention.
*/
ctx->Driver.EndQuery(ctx, q);
}

View file

@ -77,9 +77,6 @@ scissor(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height)
*/
for (i = 0; i < ctx->Const.MaxViewports; i++)
set_scissor_no_notify(ctx, i, x, y, width, height);
if (ctx->Driver.Scissor)
ctx->Driver.Scissor(ctx);
}
/**
@ -127,9 +124,6 @@ _mesa_set_scissor(struct gl_context *ctx, unsigned idx,
GLint x, GLint y, GLsizei width, GLsizei height)
{
set_scissor_no_notify(ctx, idx, x, y, width, height);
if (ctx->Driver.Scissor)
ctx->Driver.Scissor(ctx);
}
static void
@ -140,9 +134,6 @@ scissor_array(struct gl_context *ctx, GLuint first, GLsizei count,
set_scissor_no_notify(ctx, i + first, rect[i].X, rect[i].Y,
rect[i].Width, rect[i].Height);
}
if (ctx->Driver.Scissor)
ctx->Driver.Scissor(ctx);
}
/**

View file

@ -165,12 +165,6 @@ _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLui
ctx->Stencil.Function[1] = backfunc;
ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
if (ctx->Driver.StencilFuncSeparate) {
ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT,
frontfunc, ref, mask);
ctx->Driver.StencilFuncSeparate(ctx, GL_BACK,
backfunc, ref, mask);
}
}
@ -203,13 +197,6 @@ stencil_func(struct gl_context *ctx, GLenum func, GLint ref, GLuint mask)
ctx->Stencil.Function[face] = func;
ctx->Stencil.Ref[face] = ref;
ctx->Stencil.ValueMask[face] = mask;
/* Only propagate the change to the driver if EXT_stencil_two_side
* is enabled.
*/
if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) {
ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask);
}
}
else {
/* set both front and back state */
@ -226,12 +213,6 @@ stencil_func(struct gl_context *ctx, GLenum func, GLint ref, GLuint mask)
ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func;
ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
if (ctx->Driver.StencilFuncSeparate) {
ctx->Driver.StencilFuncSeparate(ctx,
((ctx->Stencil.TestTwoSide)
? GL_FRONT : GL_FRONT_AND_BACK),
func, ref, mask);
}
}
}
@ -290,13 +271,6 @@ _mesa_StencilMask( GLuint mask )
GL_STENCIL_BUFFER_BIT);
ctx->NewDriverState |= ctx->DriverFlags.NewStencil;
ctx->Stencil.WriteMask[face] = mask;
/* Only propagate the change to the driver if EXT_stencil_two_side
* is enabled.
*/
if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) {
ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask);
}
}
else {
/* set both front and back state */
@ -307,12 +281,6 @@ _mesa_StencilMask( GLuint mask )
GL_STENCIL_BUFFER_BIT);
ctx->NewDriverState |= ctx->DriverFlags.NewStencil;
ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask;
if (ctx->Driver.StencilMaskSeparate) {
ctx->Driver.StencilMaskSeparate(ctx,
((ctx->Stencil.TestTwoSide)
? GL_FRONT : GL_FRONT_AND_BACK),
mask);
}
}
}
@ -348,13 +316,6 @@ stencil_op(struct gl_context *ctx, GLenum fail, GLenum zfail, GLenum zpass)
ctx->Stencil.ZFailFunc[face] = zfail;
ctx->Stencil.ZPassFunc[face] = zpass;
ctx->Stencil.FailFunc[face] = fail;
/* Only propagate the change to the driver if EXT_stencil_two_side
* is enabled.
*/
if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) {
ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass);
}
}
else {
/* set both front and back state */
@ -371,12 +332,6 @@ stencil_op(struct gl_context *ctx, GLenum fail, GLenum zfail, GLenum zpass)
ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail;
ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass;
ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail;
if (ctx->Driver.StencilOpSeparate) {
ctx->Driver.StencilOpSeparate(ctx,
((ctx->Stencil.TestTwoSide)
? GL_FRONT : GL_FRONT_AND_BACK),
fail, zfail, zpass);
}
}
}
@ -443,8 +398,6 @@ static void
stencil_op_separate(struct gl_context *ctx, GLenum face, GLenum sfail,
GLenum zfail, GLenum zpass)
{
GLboolean set = GL_FALSE;
if (face != GL_BACK) {
/* set front */
if (ctx->Stencil.ZFailFunc[0] != zfail ||
@ -456,7 +409,6 @@ stencil_op_separate(struct gl_context *ctx, GLenum face, GLenum sfail,
ctx->Stencil.ZFailFunc[0] = zfail;
ctx->Stencil.ZPassFunc[0] = zpass;
ctx->Stencil.FailFunc[0] = sfail;
set = GL_TRUE;
}
}
@ -471,13 +423,8 @@ stencil_op_separate(struct gl_context *ctx, GLenum face, GLenum sfail,
ctx->Stencil.ZFailFunc[1] = zfail;
ctx->Stencil.ZPassFunc[1] = zpass;
ctx->Stencil.FailFunc[1] = sfail;
set = GL_TRUE;
}
}
if (set && ctx->Driver.StencilOpSeparate) {
ctx->Driver.StencilOpSeparate(ctx, face, sfail, zfail, zpass);
}
}
@ -543,10 +490,6 @@ stencil_func_separate(struct gl_context *ctx, GLenum face, GLenum func,
ctx->Stencil.Ref[1] = ref;
ctx->Stencil.ValueMask[1] = mask;
}
if (ctx->Driver.StencilFuncSeparate) {
ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask);
}
}
@ -596,10 +539,6 @@ stencil_mask_separate(struct gl_context *ctx, GLenum face, GLuint mask)
if (face != GL_FRONT) {
ctx->Stencil.WriteMask[1] = mask;
}
if (ctx->Driver.StencilMaskSeparate) {
ctx->Driver.StencilMaskSeparate(ctx, face, mask);
}
}

View file

@ -522,11 +522,6 @@ _mesa_texenvfv_indexed( struct gl_context* ctx, GLuint texunit, GLenum target,
_mesa_enum_to_string(pname),
*param,
_mesa_enum_to_string((GLenum) iparam0));
/* Tell device driver about the new texture environment */
if (ctx->Driver.TexEnv) {
ctx->Driver.TexEnv(ctx, target, pname, param);
}
}

View file

@ -175,9 +175,6 @@ texgenfv( GLuint texunitIndex, GLenum coord, GLenum pname,
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" );
return;
}
if (ctx->Driver.TexGen)
ctx->Driver.TexGen( ctx, coord, pname, params );
}

View file

@ -1405,10 +1405,6 @@ unbind_textures_from_unit(struct gl_context *ctx, GLuint unit)
_mesa_reference_texobj(&texUnit->CurrentTex[index], texObj);
/* Pass BindTexture call to device driver */
if (ctx->Driver.BindTexture)
ctx->Driver.BindTexture(ctx, unit, 0, texObj);
texUnit->_BoundTextures &= ~(1 << index);
ctx->NewState |= _NEW_TEXTURE_OBJECT;
ctx->PopAttribState |= GL_TEXTURE_BIT;
@ -1663,11 +1659,6 @@ bind_texture_object(struct gl_context *ctx, unsigned unit,
texUnit->_BoundTextures |= (1 << targetIndex);
else
texUnit->_BoundTextures &= ~(1 << targetIndex);
/* Pass BindTexture call to device driver */
if (ctx->Driver.BindTexture) {
ctx->Driver.BindTexture(ctx, unit, texObj->Target, texObj);
}
}
/**

View file

@ -1402,8 +1402,6 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
if (changed) {
struct gl_program *const prog = sh->Program;
_mesa_update_shader_textures_used(shProg, prog);
if (ctx->Driver.SamplerUniformChange)
ctx->Driver.SamplerUniformChange(ctx, prog->Target, prog);
any_changed = true;
}
}

View file

@ -305,9 +305,6 @@ _mesa_set_depth_range(struct gl_context *ctx, unsigned idx,
GLclampd nearval, GLclampd farval)
{
set_depth_range_no_notify(ctx, idx, nearval, farval);
if (ctx->Driver.DepthRange)
ctx->Driver.DepthRange(ctx);
}
/**
@ -340,10 +337,6 @@ _mesa_DepthRange(GLclampd nearval, GLclampd farval)
*/
for (i = 0; i < ctx->Const.MaxViewports; i++)
set_depth_range_no_notify(ctx, i, nearval, farval);
if (ctx->Driver.DepthRange) {
ctx->Driver.DepthRange(ctx);
}
}
void GLAPIENTRY
@ -366,9 +359,6 @@ depth_range_arrayv(struct gl_context *ctx, GLuint first, GLsizei count,
{
for (GLsizei i = 0; i < count; i++)
set_depth_range_no_notify(ctx, i + first, inputs[i].Near, inputs[i].Far);
if (ctx->Driver.DepthRange)
ctx->Driver.DepthRange(ctx);
}
void GLAPIENTRY
@ -419,9 +409,6 @@ _mesa_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat *v)
for (i = 0; i < count; i++)
set_depth_range_no_notify(ctx, i + first, v[i * 2], v[i * 2 + 1]);
if (ctx->Driver.DepthRange)
ctx->Driver.DepthRange(ctx);
}
/**
@ -532,16 +519,10 @@ clip_control(struct gl_context *ctx, GLenum origin, GLenum depth, bool no_error)
ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState;
else
ctx->NewState |= _NEW_POLYGON;
if (ctx->Driver.FrontFace)
ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
}
if (ctx->Transform.ClipDepthMode != depth) {
ctx->Transform.ClipDepthMode = depth;
if (ctx->Driver.DepthRange)
ctx->Driver.DepthRange(ctx);
}
}