aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c18
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_state.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen6_scissor_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sf_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen6_viewport_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen7_clip_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/gen7_sf_state.c5
-rw-r--r--src/mesa/drivers/dri/i965/gen7_viewport_state.c3
11 files changed, 34 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 8af43000e3d..fd67318f550 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -35,6 +35,7 @@ extern "C" {
#include "main/macros.h"
#include "main/shaderobj.h"
#include "main/uniforms.h"
+#include "main/fbobject.h"
#include "program/prog_parameter.h"
#include "program/prog_print.h"
#include "program/register_allocate.h"
@@ -1828,7 +1829,7 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
if (fp->Base.InputsRead & FRAG_BIT_WPOS) {
key.drawable_height = ctx->DrawBuffer->Height;
- key.render_to_fbo = ctx->DrawBuffer->Name != 0;
+ key.render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
}
key.nr_color_regions = 1;
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 62bcc93eed2..51ea03b6a3f 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -40,6 +40,8 @@
#include "brw_state.h"
#include "brw_defines.h"
+#include "main/fbobject.h"
+
/* Constant single cliprect for framebuffer object or DRI2 drawing */
static void upload_drawing_rect(struct brw_context *brw)
{
@@ -507,7 +509,7 @@ static void upload_polygon_stipple(struct brw_context *brw)
* to a FBO (i.e. any named frame buffer object), we *don't*
* need to invert - we already match the layout.
*/
- if (ctx->DrawBuffer->Name == 0) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
for (i = 0; i < 32; i++)
OUT_BATCH(ctx->PolygonStipple[31 - i]); /* invert */
}
@@ -550,15 +552,13 @@ static void upload_polygon_stipple_offset(struct brw_context *brw)
/* _NEW_BUFFERS
*
- * If we're drawing to a system window (ctx->DrawBuffer->Name == 0),
- * we have to invert the Y axis in order to match the OpenGL
- * pixel coordinate system, and our offset must be matched
- * to the window position. If we're drawing to a FBO
- * (ctx->DrawBuffer->Name != 0), then our native pixel coordinate
- * system works just fine, and there's no window system to
- * worry about.
+ * If we're drawing to a system window we have to invert the Y axis
+ * in order to match the OpenGL pixel coordinate system, and our
+ * offset must be matched to the window position. If we're drawing
+ * to a user-created FBO then our native pixel coordinate system
+ * works just fine, and there's no window system to worry about.
*/
- if (brw->intel.ctx.DrawBuffer->Name == 0)
+ if (_mesa_is_winsys_fbo(brw->intel.ctx.DrawBuffer))
OUT_BATCH((32 - (ctx->DrawBuffer->Height & 31)) & 31);
else
OUT_BATCH(0);
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index 37d1ee502d8..23a874aa8ec 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -32,7 +32,9 @@
#include "main/glheader.h"
#include "main/macros.h"
+#include "main/mtypes.h"
#include "main/enums.h"
+#include "main/fbobject.h"
#include "intel_batchbuffer.h"
@@ -136,7 +138,7 @@ brw_upload_sf_prog(struct brw_context *brw)
struct gl_context *ctx = &brw->intel.ctx;
struct brw_sf_prog_key key;
/* _NEW_BUFFERS */
- bool render_to_fbo = ctx->DrawBuffer->Name != 0;
+ bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
memset(&key, 0, sizeof(key));
diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c
index d7e7aa11f63..7c29ba27d1a 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_state.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_state.c
@@ -31,10 +31,12 @@
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/fbobject.h"
#include "brw_context.h"
#include "brw_state.h"
#include "brw_defines.h"
-#include "main/macros.h"
#include "brw_sf.h"
static void upload_sf_vp(struct brw_context *brw)
@@ -44,7 +46,7 @@ static void upload_sf_vp(struct brw_context *brw)
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
struct brw_sf_viewport *sfv;
GLfloat y_scale, y_bias;
- const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
+ const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
const GLfloat *v = ctx->Viewport._WindowMap.m;
sfv = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
@@ -142,7 +144,7 @@ static void upload_sf_unit( struct brw_context *brw )
struct brw_sf_unit_state *sf;
drm_intel_bo *bo = intel->batch.bo;
int chipset_max_threads;
- bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
+ bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
sf = brw_state_batch(brw, AUB_TRACE_SF_STATE,
sizeof(*sf), 64, &brw->sf.state_offset);
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index b358306a928..63c74ad8f7b 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -33,6 +33,7 @@
#include "brw_wm.h"
#include "brw_state.h"
#include "main/formats.h"
+#include "main/fbobject.h"
#include "main/samplerobj.h"
#include "program/prog_parameter.h"
@@ -516,7 +517,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
*/
if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) {
key->drawable_height = ctx->DrawBuffer->Height;
- key->render_to_fbo = ctx->DrawBuffer->Name != 0;
+ key->render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
}
/* _NEW_BUFFERS */
diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c
index feeca28d459..4c7f81c1dd3 100644
--- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c
@@ -29,13 +29,14 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"
+#include "main/fbobject.h"
static void
gen6_upload_scissor_state(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
- const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
+ const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
struct gen6_scissor_rect *scissor;
uint32_t scissor_state_offset;
diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index 95ed1f74ce4..5c4293ca91e 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -30,6 +30,7 @@
#include "brw_defines.h"
#include "brw_util.h"
#include "main/macros.h"
+#include "main/fbobject.h"
#include "intel_batchbuffer.h"
/**
@@ -120,7 +121,7 @@ upload_sf_state(struct brw_context *brw)
uint32_t dw1, dw2, dw3, dw4, dw16, dw17;
int i;
/* _NEW_BUFFER */
- bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
+ bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
int attr = 0, input_index = 0;
int urb_entry_read_offset = 1;
float point_size;
diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c
index 9ff2bd95680..f787ac71164 100644
--- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c
@@ -29,6 +29,7 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"
+#include "main/fbobject.h"
/* The clip VP defines the guardband region where expensive clipping is skipped
* and fragments are allowed to be generated and clipped out cheaply by the SF.
@@ -70,7 +71,7 @@ gen6_upload_sf_vp(struct brw_context *brw)
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
struct brw_sf_viewport *sfv;
GLfloat y_scale, y_bias;
- const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
+ const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
const GLfloat *v = ctx->Viewport._WindowMap.m;
sfv = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
diff --git a/src/mesa/drivers/dri/i965/gen7_clip_state.c b/src/mesa/drivers/dri/i965/gen7_clip_state.c
index f78b089484d..5fede36a20d 100644
--- a/src/mesa/drivers/dri/i965/gen7_clip_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_clip_state.c
@@ -26,6 +26,7 @@
#include "brw_defines.h"
#include "brw_util.h"
#include "intel_batchbuffer.h"
+#include "main/fbobject.h"
static void
upload_clip_state(struct brw_context *brw)
@@ -38,7 +39,7 @@ upload_clip_state(struct brw_context *brw)
uint32_t nonperspective_barycentric_enable_flag = 0;
/* _NEW_BUFFERS */
- bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
+ bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
/* CACHE_NEW_WM_PROG */
if (brw->wm.prog_data->barycentric_interp_modes &
diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c
index 5c51abc5a0e..5c6fcedcedf 100644
--- a/src/mesa/drivers/dri/i965/gen7_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c
@@ -26,6 +26,7 @@
#include "brw_defines.h"
#include "brw_util.h"
#include "main/macros.h"
+#include "main/fbobject.h"
#include "intel_batchbuffer.h"
static void
@@ -44,7 +45,7 @@ upload_sbe_state(struct brw_context *brw)
int urb_entry_read_offset = 1;
uint16_t attr_overrides[FRAG_ATTRIB_MAX];
/* _NEW_BUFFERS */
- bool render_to_fbo = ctx->DrawBuffer->Name != 0;
+ bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
uint32_t point_sprite_origin;
/* CACHE_NEW_VS_PROG */
@@ -159,7 +160,7 @@ upload_sf_state(struct brw_context *brw)
uint32_t dw1, dw2, dw3;
float point_size;
/* _NEW_BUFFERS */
- bool render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0;
+ bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
dw1 = GEN6_SF_STATISTICS_ENABLE |
GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
diff --git a/src/mesa/drivers/dri/i965/gen7_viewport_state.c b/src/mesa/drivers/dri/i965/gen7_viewport_state.c
index d0b89d5fe57..2bcf338b85d 100644
--- a/src/mesa/drivers/dri/i965/gen7_viewport_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_viewport_state.c
@@ -25,6 +25,7 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "intel_batchbuffer.h"
+#include "main/fbobject.h"
static void
gen7_upload_sf_clip_viewport(struct brw_context *brw)
@@ -33,7 +34,7 @@ gen7_upload_sf_clip_viewport(struct brw_context *brw)
struct gl_context *ctx = &intel->ctx;
const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat y_scale, y_bias;
- const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
+ const bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
const GLfloat *v = ctx->Viewport._WindowMap.m;
struct gen7_sf_clip_viewport *vp;