<ul>
<li>GL_ARB_shader_group_vote on nvc0</li>
<li>GL_ARB_ES3_1_compatibility on i965</li>
-<li>GL_EXT_window_rectangles on nvc0</li>
+<li>GL_EXT_window_rectangles on nv50, nvc0</li>
</ul>
<h2>Bug fixes</h2>
#define NV50_NEW_3D_SAMPLERS (1 << 20)
#define NV50_NEW_3D_STRMOUT (1 << 21)
#define NV50_NEW_3D_MIN_SAMPLES (1 << 22)
+#define NV50_NEW_3D_WINDOW_RECTS (1 << 23)
#define NV50_NEW_3D_CONTEXT (1 << 31)
#define NV50_NEW_CP_PROGRAM (1 << 0)
struct pipe_viewport_state viewports[NV50_MAX_VIEWPORTS];
unsigned viewports_dirty;
struct pipe_clip_state clip;
+ struct nv50_window_rect_stateobj window_rect;
unsigned sample_mask;
unsigned min_samples;
return PIPE_ENDIAN_LITTLE;
case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
return (class_3d >= NVA3_3D_CLASS) ? 4 : 0;
+ case PIPE_CAP_MAX_WINDOW_RECTANGLES:
+ return NV50_MAX_WINDOW_RECTANGLES;
/* supported caps */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
case PIPE_CAP_TGSI_VOTE:
- case PIPE_CAP_MAX_WINDOW_RECTANGLES:
return 0;
case PIPE_CAP_VENDOR_ID:
#define NV50_MAX_VIEWPORTS 16
+#define NV50_MAX_WINDOW_RECTANGLES 8
+
#define NV50_MAX_GLOBALS 16
#define ONE_TEMP_SIZE (4/*vector*/ * sizeof(float))
}
}
+static void
+nv50_set_window_rectangles(struct pipe_context *pipe,
+ boolean include,
+ unsigned num_rectangles,
+ const struct pipe_scissor_state *rectangles)
+{
+ struct nv50_context *nv50 = nv50_context(pipe);
+
+ nv50->window_rect.inclusive = include;
+ nv50->window_rect.rects = MIN2(num_rectangles, NV50_MAX_WINDOW_RECTANGLES);
+ memcpy(nv50->window_rect.rect, rectangles,
+ sizeof(struct pipe_scissor_state) * nv50->window_rect.rects);
+
+ nv50->dirty_3d |= NV50_NEW_3D_WINDOW_RECTS;
+}
+
static void
nv50_set_vertex_buffers(struct pipe_context *pipe,
unsigned start_slot, unsigned count,
pipe->set_polygon_stipple = nv50_set_polygon_stipple;
pipe->set_scissor_states = nv50_set_scissor_states;
pipe->set_viewport_states = nv50_set_viewport_states;
+ pipe->set_window_rectangles = nv50_set_window_rectangles;
pipe->create_vertex_elements_state = nv50_vertex_state_create;
pipe->delete_vertex_elements_state = nv50_vertex_state_delete;
nv50->viewports_dirty = 0;
}
+static void
+nv50_validate_window_rects(struct nv50_context *nv50)
+{
+ struct nouveau_pushbuf *push = nv50->base.pushbuf;
+ bool enable = nv50->window_rect.rects > 0 || nv50->window_rect.inclusive;
+ int i;
+
+ BEGIN_NV04(push, NV50_3D(CLIP_RECTS_EN), 1);
+ PUSH_DATA (push, enable);
+ if (!enable)
+ return;
+
+ BEGIN_NV04(push, NV50_3D(CLIP_RECTS_MODE), 1);
+ PUSH_DATA (push, !nv50->window_rect.inclusive);
+ BEGIN_NV04(push, NV50_3D(CLIP_RECT_HORIZ(0)), NV50_MAX_WINDOW_RECTANGLES * 2);
+ for (i = 0; i < nv50->window_rect.rects; i++) {
+ struct pipe_scissor_state *s = &nv50->window_rect.rect[i];
+ PUSH_DATA(push, (s->maxx << 16) | s->minx);
+ PUSH_DATA(push, (s->maxy << 16) | s->miny);
+ }
+ for (; i < NV50_MAX_WINDOW_RECTANGLES; i++) {
+ PUSH_DATA(push, 0);
+ PUSH_DATA(push, 0);
+ }
+}
+
static inline void
nv50_check_program_ucps(struct nv50_context *nv50,
struct nv50_program *vp, uint8_t mask)
{ nv50_validate_scissor, NV50_NEW_3D_SCISSOR },
#endif
{ nv50_validate_viewport, NV50_NEW_3D_VIEWPORT },
+ { nv50_validate_window_rects, NV50_NEW_3D_WINDOW_RECTS },
{ nv50_vertprog_validate, NV50_NEW_3D_VERTPROG },
{ nv50_gmtyprog_validate, NV50_NEW_3D_GMTYPROG },
{ nv50_fragprog_validate, NV50_NEW_3D_FRAGPROG | NV50_NEW_3D_RASTERIZER |
struct nv50_vertex_element element[0];
};
+struct nv50_window_rect_stateobj {
+ bool inclusive;
+ unsigned rects;
+ struct pipe_scissor_state rect[PIPE_MAX_WINDOW_RECTANGLES];
+};
+
struct nv50_so_target {
struct pipe_stream_output_target pipe;
struct pipe_query *pq;
enum pipe_texture_target target;
struct {
struct pipe_framebuffer_state fb;
+ struct nv50_window_rect_stateobj window_rect;
struct nv50_rasterizer_stateobj *rast;
struct nv50_program *vp;
struct nv50_program *gp;
}
static void
-nv50_blitctx_pre_blit(struct nv50_blitctx *ctx)
+nv50_blitctx_pre_blit(struct nv50_blitctx *ctx,
+ const struct pipe_blit_info *info)
{
struct nv50_context *nv50 = ctx->nv50;
struct nv50_blitter *blitter = nv50->screen->blitter;
ctx->saved.fp = nv50->fragprog;
ctx->saved.min_samples = nv50->min_samples;
+ ctx->saved.window_rect = nv50->window_rect;
nv50->rast = &ctx->rast;
nv50->gmtyprog = NULL;
nv50->fragprog = ctx->fp;
+ nv50->window_rect.rects =
+ MIN2(info->num_window_rectangles, NV50_MAX_WINDOW_RECTANGLES);
+ nv50->window_rect.inclusive = info->window_rectangle_include;
+ if (nv50->window_rect.rects)
+ memcpy(nv50->window_rect.rect, info->window_rectangles,
+ sizeof(struct pipe_scissor_state) * nv50->window_rect.rects);
+
for (s = 0; s < 3; ++s) {
ctx->saved.num_textures[s] = nv50->num_textures[s];
ctx->saved.num_samplers[s] = nv50->num_samplers[s];
nv50->dirty_3d =
NV50_NEW_3D_FRAMEBUFFER | NV50_NEW_3D_MIN_SAMPLES |
NV50_NEW_3D_VERTPROG | NV50_NEW_3D_FRAGPROG | NV50_NEW_3D_GMTYPROG |
- NV50_NEW_3D_TEXTURES | NV50_NEW_3D_SAMPLERS;
+ NV50_NEW_3D_TEXTURES | NV50_NEW_3D_SAMPLERS | NV50_NEW_3D_WINDOW_RECTS;
}
static void
nv50->fragprog = blit->saved.fp;
nv50->min_samples = blit->saved.min_samples;
+ nv50->window_rect = blit->saved.window_rect;
pipe_sampler_view_reference(&nv50->textures[2][0], NULL);
pipe_sampler_view_reference(&nv50->textures[2][1], NULL);
nv50->dirty_3d = blit->saved.dirty_3d |
(NV50_NEW_3D_FRAMEBUFFER | NV50_NEW_3D_SCISSOR | NV50_NEW_3D_SAMPLE_MASK |
NV50_NEW_3D_RASTERIZER | NV50_NEW_3D_ZSA | NV50_NEW_3D_BLEND |
- NV50_NEW_3D_TEXTURES | NV50_NEW_3D_SAMPLERS |
+ NV50_NEW_3D_TEXTURES | NV50_NEW_3D_SAMPLERS | NV50_NEW_3D_WINDOW_RECTS |
NV50_NEW_3D_VERTPROG | NV50_NEW_3D_GMTYPROG | NV50_NEW_3D_FRAGPROG);
nv50->scissors_dirty |= 1;
blit->render_condition_enable = info->render_condition_enable;
nv50_blit_select_fp(blit, info);
- nv50_blitctx_pre_blit(blit);
+ nv50_blitctx_pre_blit(blit, info);
nv50_blit_set_dst(blit, dst, info->dst.level, -1, info->dst.format);
nv50_blit_set_src(blit, src, info->src.level, -1, info->src.format,
info->dst.resource->nr_samples <= 1)
eng3d = true;
+ if (info->num_window_rectangles > 0 || info->window_rectangle_include)
+ eng3d = true;
+
/* FIXME: can't make this work with eng2d anymore */
if ((info->src.resource->nr_samples | 1) !=
(info->dst.resource->nr_samples | 1))