소스 검색

st/python: begin conversion to pipe_resources, much more to do

gallium-resources
Keith Whitwell 15 년 전
부모
커밋
437ce98daa
3개의 변경된 파일22개의 추가작업 그리고 26개의 파일을 삭제
  1. 17
    21
      src/gallium/state_trackers/python/st_device.c
  2. 3
    3
      src/gallium/state_trackers/python/st_device.h
  3. 2
    2
      src/gallium/state_trackers/python/st_sample.c

+ 17
- 21
src/gallium/state_trackers/python/st_device.c 파일 보기

@@ -128,7 +128,7 @@ st_context_destroy(struct st_context *st_ctx)
pipe_sampler_view_reference(&st_ctx->fragment_sampler_views[i], NULL);
for(i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
pipe_sampler_view_reference(&st_ctx->vertex_sampler_views[i], NULL);
pipe_texture_reference(&st_ctx->default_texture, NULL);
pipe_resource_reference(&st_ctx->default_texture, NULL);

FREE(st_ctx);
@@ -229,8 +229,7 @@ st_context_create(struct st_device *st_dev)
/* default textures */
{
struct pipe_screen *screen = st_dev->screen;
struct pipe_texture templat;
struct pipe_transfer *transfer;
struct pipe_resource templat;
struct pipe_sampler_view view_templ;
struct pipe_sampler_view *view;
unsigned i;
@@ -243,26 +242,23 @@ st_context_create(struct st_device *st_dev)
templat.depth0 = 1;
templat.last_level = 0;
st_ctx->default_texture = screen->texture_create( screen, &templat );
st_ctx->default_texture = screen->resource_create( screen, &templat );
if(st_ctx->default_texture) {
transfer = screen->get_transfer(screen,
st_ctx->default_texture,
0, 0, 0,
PIPE_TRANSFER_WRITE,
0, 0,
st_ctx->default_texture->width0,
st_ctx->default_texture->height0);
if (transfer) {
uint32_t *map;
map = (uint32_t *) screen->transfer_map(screen, transfer);
if(map) {
*map = 0x00000000;
screen->transfer_unmap(screen, transfer);
}
screen->tex_transfer_destroy(transfer);
}
struct pipe_box box;
uint32_t zero = 0;
u_box_wh( 1, 1, &box );

st_ctx->pipe->transfer_inline_write(st_ctx->pipe,
st_ctx->default_texture,
u_subresource(0,0),
PIPE_TRANSFER_WRITE,
&box,
&zero,
sizeof zero,
0);
}
u_sampler_view_default_template(&view_templ,
st_ctx->default_texture,
st_ctx->default_texture->format);

+ 3
- 3
src/gallium/state_trackers/python/st_device.h 파일 보기

@@ -40,7 +40,7 @@ struct st_winsys;

struct st_surface
{
struct pipe_texture *texture;
struct pipe_resource *texture;
unsigned face;
unsigned level;
unsigned zslice;
@@ -59,7 +59,7 @@ struct st_context
void *fs;
void *gs;

struct pipe_texture *default_texture;
struct pipe_resource *default_texture;
struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
@@ -85,7 +85,7 @@ struct st_device
static INLINE struct pipe_surface *
st_pipe_surface(struct st_surface *surface, unsigned usage)
{
struct pipe_texture *texture = surface->texture;
struct pipe_resource *texture = surface->texture;
struct pipe_screen *screen = texture->screen;
return screen->get_tex_surface(screen, texture, surface->face, surface->level, surface->zslice, usage);
}

+ 2
- 2
src/gallium/state_trackers/python/st_sample.c 파일 보기

@@ -525,7 +525,7 @@ st_sample_pixel_block(enum pipe_format format,
void
st_sample_surface(struct st_surface *surface, float *rgba)
{
struct pipe_texture *texture = surface->texture;
struct pipe_resource *texture = surface->texture;
struct pipe_screen *screen = texture->screen;
unsigned width = u_minify(texture->width0, surface->level);
unsigned height = u_minify(texture->height0, surface->level);
@@ -570,5 +570,5 @@ st_sample_surface(struct st_surface *surface, float *rgba)
screen->transfer_unmap(screen, transfer);
}
screen->tex_transfer_destroy(transfer);
screen->transfer_destroy(transfer);
}

Loading…
취소
저장