<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>
</ul>
<h2>Bug fixes</h2>
#define NVC0_NEW_3D_TESSFACTOR (1 << 25)
#define NVC0_NEW_3D_BUFFERS (1 << 26)
#define NVC0_NEW_3D_DRIVERCONST (1 << 27)
+#define NVC0_NEW_3D_WINDOW_RECTS (1 << 28)
#define NVC0_NEW_CP_PROGRAM (1 << 0)
#define NVC0_NEW_CP_SURFACES (1 << 1)
struct pipe_viewport_state viewports[NVC0_MAX_VIEWPORTS];
unsigned viewports_dirty;
struct pipe_clip_state clip;
+ struct nvc0_window_rect_stateobj window_rect;
unsigned sample_mask;
unsigned min_samples;
return PIPE_ENDIAN_LITTLE;
case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
return 30;
+ case PIPE_CAP_MAX_WINDOW_RECTANGLES:
+ return NVC0_MAX_WINDOW_RECTANGLES;
/* supported caps */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_PCI_BUS:
case PIPE_CAP_PCI_DEVICE:
case PIPE_CAP_PCI_FUNCTION:
- case PIPE_CAP_MAX_WINDOW_RECTANGLES:
return 0;
case PIPE_CAP_VENDOR_ID:
#define NVC0_MAX_IMAGES 8
+#define NVC0_MAX_WINDOW_RECTANGLES 8
+
struct nvc0_context;
struct nvc0_blitter;
}
+static void
+nvc0_set_window_rectangles(struct pipe_context *pipe,
+ boolean include,
+ unsigned num_rectangles,
+ const struct pipe_scissor_state *rectangles)
+{
+ struct nvc0_context *nvc0 = nvc0_context(pipe);
+
+ nvc0->window_rect.inclusive = include;
+ nvc0->window_rect.rects = MIN2(num_rectangles, NVC0_MAX_WINDOW_RECTANGLES);
+ memcpy(nvc0->window_rect.rect, rectangles,
+ sizeof(struct pipe_scissor_state) * nvc0->window_rect.rects);
+
+ nvc0->dirty_3d |= NVC0_NEW_3D_WINDOW_RECTS;
+}
+
static void
nvc0_set_tess_state(struct pipe_context *pipe,
const float default_tess_outer[4],
pipe->set_polygon_stipple = nvc0_set_polygon_stipple;
pipe->set_scissor_states = nvc0_set_scissor_states;
pipe->set_viewport_states = nvc0_set_viewport_states;
+ pipe->set_window_rectangles = nvc0_set_window_rectangles;
pipe->set_tess_state = nvc0_set_tess_state;
pipe->create_vertex_elements_state = nvc0_vertex_state_create;
nvc0->viewports_dirty = 0;
}
+static void
+nvc0_validate_window_rects(struct nvc0_context *nvc0)
+{
+ struct nouveau_pushbuf *push = nvc0->base.pushbuf;
+ bool enable = nvc0->window_rect.rects > 0 || nvc0->window_rect.inclusive;
+ int i;
+
+ IMMED_NVC0(push, NVC0_3D(CLIP_RECTS_EN), enable);
+ if (!enable)
+ return;
+
+ IMMED_NVC0(push, NVC0_3D(CLIP_RECTS_MODE), !nvc0->window_rect.inclusive);
+ BEGIN_NVC0(push, NVC0_3D(CLIP_RECT_HORIZ(0)), NVC0_MAX_WINDOW_RECTANGLES * 2);
+ for (i = 0; i < nvc0->window_rect.rects; i++) {
+ struct pipe_scissor_state *s = &nvc0->window_rect.rect[i];
+ PUSH_DATA(push, (s->maxx << 16) | s->minx);
+ PUSH_DATA(push, (s->maxy << 16) | s->miny);
+ }
+ for (; i < NVC0_MAX_WINDOW_RECTANGLES; i++) {
+ PUSH_DATA(push, 0);
+ PUSH_DATA(push, 0);
+ }
+}
+
static inline void
nvc0_upload_uclip_planes(struct nvc0_context *nvc0, unsigned s)
{
{ nvc0_validate_stipple, NVC0_NEW_3D_STIPPLE },
{ nvc0_validate_scissor, NVC0_NEW_3D_SCISSOR | NVC0_NEW_3D_RASTERIZER },
{ nvc0_validate_viewport, NVC0_NEW_3D_VIEWPORT },
+ { nvc0_validate_window_rects, NVC0_NEW_3D_WINDOW_RECTS },
{ nvc0_vertprog_validate, NVC0_NEW_3D_VERTPROG },
{ nvc0_tctlprog_validate, NVC0_NEW_3D_TCTLPROG },
{ nvc0_tevlprog_validate, NVC0_NEW_3D_TEVLPROG },
struct nvc0_vertex_element element[0];
};
+struct nvc0_window_rect_stateobj {
+ bool inclusive;
+ unsigned rects;
+ struct pipe_scissor_state rect[PIPE_MAX_WINDOW_RECTANGLES];
+};
+
struct nvc0_so_target {
struct pipe_stream_output_target pipe;
struct pipe_query *pq;
enum pipe_texture_target target;
struct {
struct pipe_framebuffer_state fb;
+ struct nvc0_window_rect_stateobj window_rect;
struct nvc0_rasterizer_stateobj *rast;
struct nvc0_program *vp;
struct nvc0_program *tcp;
}
static void
-nvc0_blitctx_pre_blit(struct nvc0_blitctx *ctx)
+nvc0_blitctx_pre_blit(struct nvc0_blitctx *ctx,
+ const struct pipe_blit_info *info)
{
struct nvc0_context *nvc0 = ctx->nvc0;
struct nvc0_blitter *blitter = nvc0->screen->blitter;
ctx->saved.fp = nvc0->fragprog;
ctx->saved.min_samples = nvc0->min_samples;
+ ctx->saved.window_rect = nvc0->window_rect;
nvc0->rast = &ctx->rast;
nvc0->gmtyprog = NULL;
nvc0->fragprog = ctx->fp;
+ nvc0->window_rect.rects =
+ MIN2(info->num_window_rectangles, NVC0_MAX_WINDOW_RECTANGLES);
+ nvc0->window_rect.inclusive = info->window_rectangle_include;
+ if (nvc0->window_rect.rects)
+ memcpy(nvc0->window_rect.rect, info->window_rectangles,
+ sizeof(struct pipe_scissor_state) * nvc0->window_rect.rects);
+
for (s = 0; s <= 4; ++s) {
ctx->saved.num_textures[s] = nvc0->num_textures[s];
ctx->saved.num_samplers[s] = nvc0->num_samplers[s];
nvc0->dirty_3d = NVC0_NEW_3D_FRAMEBUFFER | NVC0_NEW_3D_MIN_SAMPLES |
NVC0_NEW_3D_VERTPROG | NVC0_NEW_3D_FRAGPROG |
NVC0_NEW_3D_TCTLPROG | NVC0_NEW_3D_TEVLPROG | NVC0_NEW_3D_GMTYPROG |
- NVC0_NEW_3D_TEXTURES | NVC0_NEW_3D_SAMPLERS;
+ NVC0_NEW_3D_TEXTURES | NVC0_NEW_3D_SAMPLERS | NVC0_NEW_3D_WINDOW_RECTS;
}
static void
nvc0->fragprog = blit->saved.fp;
nvc0->min_samples = blit->saved.min_samples;
+ nvc0->window_rect = blit->saved.window_rect;
pipe_sampler_view_reference(&nvc0->textures[4][0], NULL);
pipe_sampler_view_reference(&nvc0->textures[4][1], NULL);
nvc0->dirty_3d = blit->saved.dirty_3d |
(NVC0_NEW_3D_FRAMEBUFFER | NVC0_NEW_3D_SCISSOR | NVC0_NEW_3D_SAMPLE_MASK |
NVC0_NEW_3D_RASTERIZER | NVC0_NEW_3D_ZSA | NVC0_NEW_3D_BLEND |
- NVC0_NEW_3D_VIEWPORT |
+ NVC0_NEW_3D_VIEWPORT | NVC0_NEW_3D_WINDOW_RECTS |
NVC0_NEW_3D_TEXTURES | NVC0_NEW_3D_SAMPLERS |
NVC0_NEW_3D_VERTPROG | NVC0_NEW_3D_FRAGPROG |
NVC0_NEW_3D_TCTLPROG | NVC0_NEW_3D_TEVLPROG | NVC0_NEW_3D_GMTYPROG |
blit->render_condition_enable = info->render_condition_enable;
nvc0_blit_select_fp(blit, info);
- nvc0_blitctx_pre_blit(blit);
+ nvc0_blitctx_pre_blit(blit, info);
nvc0_blit_set_dst(blit, dst, info->dst.level, -1, info->dst.format);
nvc0_blit_set_src(blit, src, info->src.level, -1, info->src.format,
info->src.box.height != -info->dst.box.height))
eng3d = true;
+ if (info->num_window_rectangles > 0 || info->window_rectangle_include)
+ eng3d = true;
+
if (nvc0->screen->num_occlusion_queries_active)
IMMED_NVC0(push, NVC0_3D(SAMPLECNT_ENABLE), 0);