mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 05:30:24 +01:00
i915: Only call CalcViewport from DrawBuffers instead of Viewport.
This saves an inadvertent round-trip to the X Server on DrawBuffers, which was hurting some metaops.
This commit is contained in:
parent
3ee21f30cd
commit
ac0dfbdf0f
3 changed files with 10 additions and 9 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include "intel_fbo.h"
|
||||
#include "intel_screen.h"
|
||||
#include "intel_batchbuffer.h"
|
||||
#include "intel_buffers.h"
|
||||
|
||||
#include "i915_context.h"
|
||||
#include "i915_reg.h"
|
||||
|
|
@ -309,7 +310,7 @@ i915DepthMask(GLcontext * ctx, GLboolean flag)
|
|||
* - depthrange
|
||||
* - window pos/size or FBO size
|
||||
*/
|
||||
static void
|
||||
void
|
||||
intelCalcViewport(GLcontext * ctx)
|
||||
{
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
|
|
|
|||
|
|
@ -284,14 +284,11 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
|
|||
fb->_NumColorDrawBuffers);
|
||||
|
||||
/* update viewport since it depends on window size */
|
||||
if (ctx->Driver.Viewport) {
|
||||
ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y,
|
||||
ctx->Viewport.Width, ctx->Viewport.Height);
|
||||
}
|
||||
else {
|
||||
ctx->NewState |= _NEW_VIEWPORT;
|
||||
}
|
||||
|
||||
#ifdef I915
|
||||
intelCalcViewport(ctx);
|
||||
#else
|
||||
ctx->NewState |= _NEW_VIEWPORT;
|
||||
#endif
|
||||
/* Set state we know depends on drawable parameters:
|
||||
*/
|
||||
if (ctx->Driver.Scissor)
|
||||
|
|
|
|||
|
|
@ -53,5 +53,8 @@ void intel_get_cliprects(struct intel_context *intel,
|
|||
struct drm_clip_rect **cliprects,
|
||||
unsigned int *num_cliprects,
|
||||
int *x_off, int *y_off);
|
||||
#ifdef I915
|
||||
void intelCalcViewport(GLcontext * ctx);
|
||||
#endif
|
||||
|
||||
#endif /* INTEL_BUFFERS_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue