summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i915
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-05-21 20:02:22 +0200
committerRoland Scheidegger <sroland@vmware.com>2010-05-21 20:02:22 +0200
commit3293bcdc80cdfa20a2381aae2b94505bdf95d857 (patch)
tree16ab1ae66010f6d8b1325dbfa9006126a8e95771 /src/gallium/drivers/i915
parent8504c5d931e47765a15fdaec2df2cb6502a1bd5c (diff)
parentce65caba846b03b5ef4144e311b85cfd48ab9bbb (diff)
Merge branch 'gallium-msaa'
Conflicts: src/mesa/state_tracker/st_gen_mipmap.c src/mesa/state_tracker/st_texture.c
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r--src/gallium/drivers/i915/i915_blit.c1
-rw-r--r--src/gallium/drivers/i915/i915_blit.h1
-rw-r--r--src/gallium/drivers/i915/i915_screen.c19
-rw-r--r--src/gallium/drivers/i915/i915_state.c7
-rw-r--r--src/gallium/drivers/i915/i915_surface.c70
5 files changed, 74 insertions, 24 deletions
diff --git a/src/gallium/drivers/i915/i915_blit.c b/src/gallium/drivers/i915/i915_blit.c
index 533fa81219..6717e46e1b 100644
--- a/src/gallium/drivers/i915/i915_blit.c
+++ b/src/gallium/drivers/i915/i915_blit.c
@@ -84,7 +84,6 @@ i915_fill_blit(struct i915_context *i915,
void
i915_copy_blit(struct i915_context *i915,
- unsigned do_flip,
unsigned cpp,
unsigned short src_pitch,
struct i915_winsys_buffer *src_buffer,
diff --git a/src/gallium/drivers/i915/i915_blit.h b/src/gallium/drivers/i915/i915_blit.h
index db576ed4c9..43f8e7c9aa 100644
--- a/src/gallium/drivers/i915/i915_blit.h
+++ b/src/gallium/drivers/i915/i915_blit.h
@@ -31,7 +31,6 @@
#include "i915_context.h"
extern void i915_copy_blit(struct i915_context *i915,
- unsigned do_flip,
unsigned cpp,
unsigned short src_pitch,
struct i915_winsys_buffer *src_buffer,
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 7cf627d975..0897a863db 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -161,9 +161,10 @@ i915_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
static boolean
i915_is_format_supported(struct pipe_screen *screen,
- enum pipe_format format,
+ enum pipe_format format,
enum pipe_texture_target target,
- unsigned tex_usage,
+ unsigned sample_count,
+ unsigned tex_usage,
unsigned geom_flags)
{
static const enum pipe_format tex_supported[] = {
@@ -183,17 +184,25 @@ i915_is_format_supported(struct pipe_screen *screen,
PIPE_FORMAT_Z24_UNORM_S8_USCALED,
PIPE_FORMAT_NONE /* list terminator */
};
- static const enum pipe_format surface_supported[] = {
+ static const enum pipe_format render_supported[] = {
PIPE_FORMAT_B8G8R8A8_UNORM,
PIPE_FORMAT_B5G6R5_UNORM,
+ PIPE_FORMAT_NONE /* list terminator */
+ };
+ static const enum pipe_format depth_supported[] = {
PIPE_FORMAT_Z24_UNORM_S8_USCALED,
PIPE_FORMAT_NONE /* list terminator */
};
const enum pipe_format *list;
uint i;
- if(tex_usage & PIPE_BIND_RENDER_TARGET)
- list = surface_supported;
+ if (sample_count > 1)
+ return FALSE;
+
+ if(tex_usage & PIPE_BIND_DEPTH_STENCIL)
+ list = depth_supported;
+ else if (tex_usage & PIPE_BIND_RENDER_TARGET)
+ list = render_supported;
else
list = tex_supported;
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index cd963e4df7..e767aa9f8f 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -812,6 +812,12 @@ i915_delete_vertex_elements_state(struct pipe_context *pipe, void *velems)
FREE( velems );
}
+static void
+i915_set_sample_mask(struct pipe_context *pipe,
+ unsigned sample_mask)
+{
+}
+
void
i915_init_state_functions( struct i915_context *i915 )
{
@@ -843,6 +849,7 @@ i915_init_state_functions( struct i915_context *i915 )
i915->base.set_blend_color = i915_set_blend_color;
i915->base.set_stencil_ref = i915_set_stencil_ref;
i915->base.set_clip_state = i915_set_clip_state;
+ i915->base.set_sample_mask = i915_set_sample_mask;
i915->base.set_constant_buffer = i915_set_constant_buffer;
i915->base.set_framebuffer_state = i915_set_framebuffer_state;
diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c
index 453437b809..41b1fed36d 100644
--- a/src/gallium/drivers/i915/i915_surface.c
+++ b/src/gallium/drivers/i915/i915_surface.c
@@ -41,15 +41,41 @@
*/
static void
i915_surface_copy(struct pipe_context *pipe,
- struct pipe_surface *dst,
- unsigned dstx, unsigned dsty,
- struct pipe_surface *src,
- unsigned srcx, unsigned srcy, unsigned width, unsigned height)
+ struct pipe_resource *dst, struct pipe_subresource subdst,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src, struct pipe_subresource subsrc,
+ unsigned srcx, unsigned srcy, unsigned srcz,
+ unsigned width, unsigned height)
{
- struct i915_texture *dst_tex = i915_texture(dst->texture);
- struct i915_texture *src_tex = i915_texture(src->texture);
+ struct i915_texture *dst_tex = i915_texture(dst);
+ struct i915_texture *src_tex = i915_texture(src);
struct pipe_resource *dpt = &dst_tex->b.b;
struct pipe_resource *spt = &src_tex->b.b;
+ unsigned dst_offset, src_offset; /* in bytes */
+
+ if (dst->target == PIPE_TEXTURE_CUBE) {
+ dst_offset = dst_tex->image_offset[subdst.level][subdst.face];
+ }
+ else if (dst->target == PIPE_TEXTURE_3D) {
+ dst_offset = dst_tex->image_offset[subdst.level][dstz];
+ }
+ else {
+ dst_offset = dst_tex->image_offset[subdst.level][0];
+ assert(subdst.face == 0);
+ assert(dstz == 0);
+ }
+ if (src->target == PIPE_TEXTURE_CUBE) {
+ src_offset = src_tex->image_offset[subsrc.level][subsrc.face];
+ }
+ else if (src->target == PIPE_TEXTURE_3D) {
+ src_offset = src_tex->image_offset[subsrc.level][srcz];
+ }
+ else {
+ src_offset = src_tex->image_offset[subsrc.level][0];
+ assert(subsrc.face == 0);
+ assert(srcz == 0);
+ }
+
assert( dst != src );
assert( util_format_get_blocksize(dpt->format) == util_format_get_blocksize(spt->format) );
@@ -59,22 +85,34 @@ i915_surface_copy(struct pipe_context *pipe,
assert( util_format_get_blockheight(dpt->format) == 1 );
i915_copy_blit( i915_context(pipe),
- FALSE,
util_format_get_blocksize(dpt->format),
- (unsigned short) src_tex->stride, src_tex->buffer, src->offset,
- (unsigned short) dst_tex->stride, dst_tex->buffer, dst->offset,
+ (unsigned short) src_tex->stride, src_tex->buffer, src_offset,
+ (unsigned short) dst_tex->stride, dst_tex->buffer, dst_offset,
(short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height );
}
static void
i915_surface_fill(struct pipe_context *pipe,
- struct pipe_surface *dst,
- unsigned dstx, unsigned dsty,
+ struct pipe_resource *dst, struct pipe_subresource subdst,
+ unsigned dstx, unsigned dsty, unsigned dstz,
unsigned width, unsigned height, unsigned value)
{
- struct i915_texture *tex = i915_texture(dst->texture);
+ struct i915_texture *tex = i915_texture(dst);
struct pipe_resource *pt = &tex->b.b;
+ unsigned dst_offset; /* in bytes */
+
+ if (dst->target == PIPE_TEXTURE_CUBE) {
+ dst_offset = tex->image_offset[subdst.level][subdst.face];
+ }
+ else if (dst->target == PIPE_TEXTURE_3D) {
+ dst_offset = tex->image_offset[subdst.level][dstz];
+ }
+ else {
+ dst_offset = tex->image_offset[subdst.level][0];
+ assert(subdst.face == 0);
+ assert(dstz == 0);
+ }
assert(util_format_get_blockwidth(pt->format) == 1);
assert(util_format_get_blockheight(pt->format) == 1);
@@ -82,7 +120,7 @@ i915_surface_fill(struct pipe_context *pipe,
i915_fill_blit( i915_context(pipe),
util_format_get_blocksize(pt->format),
(unsigned short) tex->stride,
- tex->buffer, dst->offset,
+ tex->buffer, dst_offset,
(short) dstx, (short) dsty,
(short) width, (short) height,
value );
@@ -137,13 +175,11 @@ i915_tex_surface_destroy(struct pipe_surface *surf)
}
-/* Probably going to make blits work on textures rather than surfaces.
- */
void
i915_init_surface_functions(struct i915_context *i915)
{
- i915->base.surface_copy = i915_surface_copy;
- i915->base.surface_fill = i915_surface_fill;
+ i915->base.resource_copy_region = i915_surface_copy;
+ i915->base.resource_fill_region = i915_surface_fill;
}
/* No good reason for these to be in the screen.