#include "main/context.h"
#include "main/macros.h"
#include "main/enums.h"
+#include "main/fbobject.h"
#include "main/dd.h"
#include "main/state.h"
DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
- if (ctx->DrawBuffer->Name == 0) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
x1 = x;
y1 = ctx->DrawBuffer->Height - (y + h);
x2 = x + w - 1;
#include "main/context.h"
#include "main/macros.h"
#include "main/enums.h"
+#include "main/fbobject.h"
#include "main/dd.h"
#include "main/state.h"
#include "tnl/tnl.h"
{
struct intel_context *intel = intel_context(ctx);
- if (ctx->DrawBuffer->Name == 0) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
_math_matrix_viewport(&intel->ViewportMatrix,
ctx->Viewport.X,
ctx->DrawBuffer->Height - ctx->Viewport.Y,
DBG("%s %d,%d %dx%d\n", __FUNCTION__, x, y, w, h);
- if (ctx->DrawBuffer->Name == 0) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
x1 = x;
y1 = ctx->DrawBuffer->Height - (y + h);
x2 = x + w - 1;
else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
mode = S4_CULLMODE_CW;
- if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0)
+ if (ctx->DrawBuffer && _mesa_is_user_fbo(ctx->DrawBuffer))
mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
if (ctx->Polygon.CullFaceMode == GL_FRONT)
mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
#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"
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;
#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)
{
* 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 */
}
/* _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);
#include "main/glheader.h"
#include "main/macros.h"
+#include "main/mtypes.h"
#include "main/enums.h"
+#include "main/fbobject.h"
#include "intel_batchbuffer.h"
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));
+#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)
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,
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);
#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"
*/
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 */
#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;
#include "brw_defines.h"
#include "brw_util.h"
#include "main/macros.h"
+#include "main/fbobject.h"
#include "intel_batchbuffer.h"
/**
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;
#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.
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,
#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)
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 &
#include "brw_defines.h"
#include "brw_util.h"
#include "main/macros.h"
+#include "main/fbobject.h"
#include "intel_batchbuffer.h"
static void
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 */
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;
#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)
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;
#include "intel_fbo.h"
#include "intel_mipmap_tree.h"
+#include "main/fbobject.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
static void
intelDrawBuffer(struct gl_context * ctx, GLenum mode)
{
- if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_rendering =
intel->is_front_buffer_rendering;
static void
intelReadBuffer(struct gl_context * ctx, GLenum mode)
{
- if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_reading =
intel->is_front_buffer_reading;
__DRIcontext *driContext = intel->driContext;
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
- if ((ctx->DrawBuffer->Name == 0) && intel->front_buffer_dirty) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) {
if (screen->dri2.loader &&
(screen->dri2.loader->base.version >= 2)
&& (screen->dri2.loader->flushFrontBuffer != NULL) &&
if (intel->saved_viewport)
intel->saved_viewport(ctx, x, y, w, h);
- if (ctx->DrawBuffer->Name == 0) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
dri2InvalidateDrawable(driContext->driDrawablePriv);
dri2InvalidateDrawable(driContext->driReadablePriv);
}
#include "main/enums.h"
#include "main/mtypes.h"
#include "main/macros.h"
+#include "main/fbobject.h"
#include "main/image.h"
#include "main/bufferobj.h"
#include "main/readpix.h"
return false;
}
else {
- if (ctx->ReadBuffer->Name == 0)
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
rowLength = -rowLength;
}
all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART);
- if (ctx->ReadBuffer->Name == 0)
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
y = ctx->ReadBuffer->Height - (y + height);
if (!intelEmitCopyBlit(intel,