From a07cb9a1ef70f67675ede78ee1824dde80204ed2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 29 Nov 2020 03:27:37 -0500 Subject: [PATCH] st/mesa: put pipe_screen * into st_context and use it Reviewed-by: Eric Anholt Part-of: --- src/mesa/state_tracker/st_atom_framebuffer.c | 2 +- src/mesa/state_tracker/st_atom_msaa.c | 6 ++--- src/mesa/state_tracker/st_cb_bitmap.c | 6 ++--- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/state_tracker/st_cb_clear.c | 10 ++++---- src/mesa/state_tracker/st_cb_drawpixels.c | 24 +++++++++--------- src/mesa/state_tracker/st_cb_drawtex.c | 2 +- src/mesa/state_tracker/st_cb_eglimage.c | 6 ++--- src/mesa/state_tracker/st_cb_fbo.c | 4 +-- src/mesa/state_tracker/st_cb_flush.c | 6 ++--- src/mesa/state_tracker/st_cb_memoryobjects.c | 6 ++--- src/mesa/state_tracker/st_cb_msaa.c | 2 +- src/mesa/state_tracker/st_cb_perfmon.c | 4 +-- src/mesa/state_tracker/st_cb_program.c | 4 +-- src/mesa/state_tracker/st_cb_queryobj.c | 2 +- src/mesa/state_tracker/st_cb_readpixels.c | 7 +++--- src/mesa/state_tracker/st_cb_strings.c | 2 +- src/mesa/state_tracker/st_cb_syncobj.c | 6 ++--- src/mesa/state_tracker/st_cb_texture.c | 21 ++++++++-------- src/mesa/state_tracker/st_context.c | 18 ++++++++------ src/mesa/state_tracker/st_context.h | 3 +-- src/mesa/state_tracker/st_format.c | 6 ++--- src/mesa/state_tracker/st_gen_mipmap.c | 4 +-- src/mesa/state_tracker/st_glsl_to_ir.cpp | 2 +- src/mesa/state_tracker/st_glsl_to_nir.cpp | 8 +++--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 10 ++++---- src/mesa/state_tracker/st_manager.c | 10 ++++---- src/mesa/state_tracker/st_mesa_to_tgsi.c | 4 +-- src/mesa/state_tracker/st_nir_builtins.c | 2 +- src/mesa/state_tracker/st_pbo.c | 5 ++-- src/mesa/state_tracker/st_program.c | 26 ++++++++++---------- src/mesa/state_tracker/st_texture.c | 2 +- src/mesa/state_tracker/st_vdpau.c | 6 ++--- 33 files changed, 110 insertions(+), 118 deletions(-) diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index fea537c406d..0bc93d65b34 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -73,7 +73,7 @@ update_framebuffer_size(struct pipe_framebuffer_state *framebuffer, static unsigned framebuffer_quantize_num_samples(struct st_context *st, unsigned num_samples) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; int quantized_samples = 0; unsigned msaa_mode; diff --git a/src/mesa/state_tracker/st_atom_msaa.c b/src/mesa/state_tracker/st_atom_msaa.c index 594e6397242..01f2d0bd613 100644 --- a/src/mesa/state_tracker/st_atom_msaa.c +++ b/src/mesa/state_tracker/st_atom_msaa.c @@ -57,8 +57,8 @@ update_sample_locations(struct st_context *st) PIPE_MAX_SAMPLE_LOCATION_GRID_SIZE * PIPE_MAX_SAMPLE_LOCATION_GRID_SIZE * 32]; - st->pipe->screen->get_sample_pixel_grid( - st->pipe->screen, samples, &grid_width, &grid_height); + st->screen->get_sample_pixel_grid(st->screen, samples, + &grid_width, &grid_height); size = grid_width * grid_height * samples; /** @@ -90,7 +90,7 @@ update_sample_locations(struct st_context *st) } util_sample_locations_flip_y( - st->pipe->screen, st->state.fb_height, samples, locations); + st->screen, st->state.fb_height, samples, locations); if (!st->state.enable_sample_locations || st->state.sample_locations_samples != samples || diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 11976da65b7..ab770669071 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -286,7 +286,6 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, const GLfloat *color) { struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; const float fb_width = (float) st->state.fb_width; const float fb_height = (float) st->state.fb_height; const float x0 = (float) x; @@ -306,7 +305,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, * it up into chunks. */ ASSERTED GLuint maxSize = - pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE); + st->screen->get_param(st->screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE); assert(width <= (GLsizei) maxSize); assert(height <= (GLsizei) maxSize); } @@ -536,8 +535,7 @@ accum_bitmap(struct gl_context *ctx, static void init_bitmap_state(struct st_context *st) { - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; /* This function should only be called once */ assert(!st->bitmap.tex_format); diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index ad4a8381eb4..b6d42a2e62f 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -284,7 +284,7 @@ bufferobj_data(struct gl_context *ctx, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct st_buffer_object *st_obj = st_buffer_object(obj); struct st_memory_object *st_mem_obj = st_memory_object(memObj); bool is_mapped = _mesa_bufferobj_mapped(obj, MAP_USER); diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index e38f44ed78b..9fd62b32543 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -109,7 +109,7 @@ st_destroy_clear(struct st_context *st) static inline void set_fragment_shader(struct st_context *st) { - struct pipe_screen *pscreen = st->pipe->screen; + struct pipe_screen *pscreen = st->screen; bool use_nir = PIPE_SHADER_IR_NIR == pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_PREFERRED_IR); @@ -163,7 +163,7 @@ make_nir_clear_vertex_shader(struct st_context *st, bool layered) static inline void set_vertex_shader(struct st_context *st) { - struct pipe_screen *pscreen = st->pipe->screen; + struct pipe_screen *pscreen = st->screen; bool use_nir = PIPE_SHADER_IR_NIR == pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_PREFERRED_IR); @@ -197,12 +197,12 @@ static void set_vertex_shader_layered(struct st_context *st) { struct pipe_context *pipe = st->pipe; - struct pipe_screen *pscreen = pipe->screen; + struct pipe_screen *pscreen = st->screen; bool use_nir = PIPE_SHADER_IR_NIR == pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_PREFERRED_IR); - if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_INSTANCEID)) { + if (!st->screen->get_param(st->screen, PIPE_CAP_TGSI_INSTANCEID)) { assert(!"Got layered clear, but VS instancing is unsupported"); set_vertex_shader(st); return; @@ -210,7 +210,7 @@ set_vertex_shader_layered(struct st_context *st) if (!st->clear.vs_layered) { bool vs_layer = - pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_VS_LAYER_VIEWPORT); + st->screen->get_param(st->screen, PIPE_CAP_TGSI_VS_LAYER_VIEWPORT); if (vs_layer) { st->clear.vs_layered = use_nir ? make_nir_clear_vertex_shader(st, true) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index f50699353f6..4cc6ebb2686 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -745,7 +745,6 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, GLboolean write_depth, GLboolean write_stencil) { struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; struct cso_context *cso = st->cso_context; const unsigned fb_width = _mesa_geometric_width(ctx->DrawBuffer); const unsigned fb_height = _mesa_geometric_height(ctx->DrawBuffer); @@ -760,8 +759,8 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, /* XXX if DrawPixels image is larger than max texture size, break * it up into chunks. */ - maxSize = pipe->screen->get_param(pipe->screen, - PIPE_CAP_MAX_TEXTURE_2D_SIZE); + maxSize = st->screen->get_param(st->screen, + PIPE_CAP_MAX_TEXTURE_2D_SIZE); assert(width <= maxSize); assert(height <= maxSize); @@ -1185,11 +1184,11 @@ get_color_index_fp_variant(struct st_context *st) * Clamp glDrawPixels width and height to the maximum texture size. */ static void -clamp_size(struct pipe_context *pipe, GLsizei *width, GLsizei *height, +clamp_size(struct st_context *st, GLsizei *width, GLsizei *height, struct gl_pixelstore_attrib *unpack) { - const int maxSize = pipe->screen->get_param(pipe->screen, - PIPE_CAP_MAX_TEXTURE_2D_SIZE); + const int maxSize = st->screen->get_param(st->screen, + PIPE_CAP_MAX_TEXTURE_2D_SIZE); if (*width > maxSize) { if (unpack->RowLength == 0) @@ -1304,7 +1303,6 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, { void *driver_fp; struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; GLboolean write_stencil = GL_FALSE, write_depth = GL_FALSE; struct pipe_sampler_view *sv[2] = { NULL }; int num_sampler_view = 1; @@ -1328,7 +1326,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, */ clippedUnpack = *unpack; unpack = &clippedUnpack; - clamp_size(st->pipe, &width, &height, &clippedUnpack); + clamp_size(st, &width, &height, &clippedUnpack); if (format == GL_DEPTH_STENCIL) write_stencil = write_depth = GL_TRUE; @@ -1338,7 +1336,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, write_depth = GL_TRUE; if (write_stencil && - !pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { + !st->screen->get_param(st->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { /* software fallback */ draw_stencil_pixels(ctx, x, y, width, height, format, type, unpack, pixels); @@ -1546,7 +1544,7 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct gl_pixelstore_attrib pack, unpack; GLint readX, readY, readW, readH, drawX, drawY, drawW, drawH; @@ -1693,7 +1691,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct st_renderbuffer *rbRead; void *driver_fp; struct pipe_resource *pt; @@ -1720,7 +1718,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* fallback if the driver can't do stencil exports */ if (type == GL_DEPTH_STENCIL && - !pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { + !st->screen->get_param(st->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_STENCIL); st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_DEPTH); return; @@ -1728,7 +1726,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* fallback if the driver can't do stencil exports */ if (type == GL_STENCIL && - !pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { + !st->screen->get_param(st->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty); return; } diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 3ea5cffb512..2ecdc4968d0 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -96,7 +96,7 @@ lookup_shader(struct st_context *st, const uint *semantic_indexes) { struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; GLuint i, j; /* look for existing shader with same attributes */ diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index a7b484ba38d..9545575311a 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -141,7 +141,7 @@ st_get_egl_image(struct gl_context *ctx, GLeglImageOES image_handle, bool *native_supported) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; struct st_manager *smapi = (struct st_manager *) st->iface.st_context_private; @@ -332,8 +332,8 @@ st_bind_egl_image(struct gl_context *ctx, pipe_resource_reference(&stObj->pt, stimg->texture); st_texture_release_all_sampler_views(st, stObj); pipe_resource_reference(&stImage->pt, stObj->pt); - if (st->pipe->screen->resource_changed) - st->pipe->screen->resource_changed(st->pipe->screen, stImage->pt); + if (st->screen->resource_changed) + st->screen->resource_changed(st->screen, stImage->pt); stObj->surface_format = stimg->format; stObj->level_override = stimg->level; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index cdfb7e87618..1337bc47a74 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -114,7 +114,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, GLuint width, GLuint height) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; struct st_renderbuffer *strb = st_renderbuffer(rb); enum pipe_format format = PIPE_FORMAT_NONE; struct pipe_resource templ; @@ -702,7 +702,7 @@ static void st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; const struct gl_renderbuffer_attachment *depth = &fb->Attachment[BUFFER_DEPTH]; const struct gl_renderbuffer_attachment *stencil = diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c index 08b645433ac..bec1c2f177b 100644 --- a/src/mesa/state_tracker/st_cb_flush.c +++ b/src/mesa/state_tracker/st_cb_flush.c @@ -73,9 +73,9 @@ st_finish(struct st_context *st) st_flush(st, &fence, PIPE_FLUSH_ASYNC | PIPE_FLUSH_HINT_FINISH); if (fence) { - st->pipe->screen->fence_finish(st->pipe->screen, NULL, fence, - PIPE_TIMEOUT_INFINITE); - st->pipe->screen->fence_reference(st->pipe->screen, &fence, NULL); + st->screen->fence_finish(st->screen, NULL, fence, + PIPE_TIMEOUT_INFINITE); + st->screen->fence_reference(st->screen, &fence, NULL); } st_manager_flush_swapbuffers(); diff --git a/src/mesa/state_tracker/st_cb_memoryobjects.c b/src/mesa/state_tracker/st_cb_memoryobjects.c index 917e39a91dc..b3089c030f2 100644 --- a/src/mesa/state_tracker/st_cb_memoryobjects.c +++ b/src/mesa/state_tracker/st_cb_memoryobjects.c @@ -56,8 +56,7 @@ st_memoryobj_free(struct gl_context *ctx, { struct st_memory_object *st_obj = st_memory_object(obj); struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; if (st_obj->memory) screen->memobj_destroy(screen, st_obj->memory); @@ -73,8 +72,7 @@ st_import_memoryobj_fd(struct gl_context *ctx, { struct st_memory_object *st_obj = st_memory_object(obj); struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct winsys_handle whandle = { .type = WINSYS_HANDLE_TYPE_FD, .handle = fd, diff --git a/src/mesa/state_tracker/st_cb_msaa.c b/src/mesa/state_tracker/st_cb_msaa.c index ff4de881410..fef3b7d2e4b 100644 --- a/src/mesa/state_tracker/st_cb_msaa.c +++ b/src/mesa/state_tracker/st_cb_msaa.c @@ -61,7 +61,7 @@ st_GetProgrammableSampleCaps(struct gl_context *ctx, const struct gl_framebuffer GLuint *outBits, GLuint *outWidth, GLuint *outHeight) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; st_validate_state(st, ST_PIPELINE_UPDATE_FRAMEBUFFER); diff --git a/src/mesa/state_tracker/st_cb_perfmon.c b/src/mesa/state_tracker/st_cb_perfmon.c index 0f5aa371d6a..72cb5cd3408 100644 --- a/src/mesa/state_tracker/st_cb_perfmon.c +++ b/src/mesa/state_tracker/st_cb_perfmon.c @@ -331,7 +331,7 @@ st_GetPerfMonitorResult(struct gl_context *ctx, bool st_have_perfmon(struct st_context *st) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; if (!screen->get_driver_query_info || !screen->get_driver_query_group_info) return false; @@ -344,7 +344,7 @@ st_InitPerfMonitorGroups(struct gl_context *ctx) { struct st_context *st = st_context(ctx); struct gl_perf_monitor_state *perfmon = &ctx->PerfMonitor; - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; struct gl_perf_monitor_group *groups = NULL; struct st_perf_monitor_group *stgroups = NULL; int num_counters, num_groups; diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index f01e1374ebf..771f0f72e1c 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -151,7 +151,7 @@ st_new_ati_fs(struct gl_context *ctx, struct ati_fragment_shader *curProg) static void st_max_shader_compiler_threads(struct gl_context *ctx, unsigned count) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; if (screen->set_max_shader_compiler_threads) screen->set_max_shader_compiler_threads(screen, count); @@ -161,7 +161,7 @@ static bool st_get_shader_program_completion_status(struct gl_context *ctx, struct gl_shader_program *shprog) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; if (!screen->is_parallel_shader_compilation_finished) return true; diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index 50a776df745..2caca55fe7a 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -373,7 +373,7 @@ static uint64_t st_GetTimestamp(struct gl_context *ctx) { struct pipe_context *pipe = st_context(ctx)->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; /* Prefer the per-screen function */ if (screen->get_timestamp) { diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 5a3be69a4fe..69e74f5d57e 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -102,7 +102,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb, const struct gl_pixelstore_attrib *pack, void *pixels) { struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct cso_context *cso = st->cso_context; struct pipe_surface *surface = strb->surface; struct pipe_resource *texture = strb->texture; @@ -271,8 +271,7 @@ blit_to_staging(struct st_context *st, struct st_renderbuffer *strb, GLenum format, enum pipe_format src_format, enum pipe_format dst_format) { - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct pipe_resource dst_templ; struct pipe_resource *dst; struct pipe_blit_info blit; @@ -413,7 +412,7 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y, _mesa_get_read_renderbuffer_for_format(ctx, format); struct st_renderbuffer *strb = st_renderbuffer(rb); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct pipe_resource *src; struct pipe_resource *dst = NULL; enum pipe_format dst_format, src_format; diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c index 85fe5a7ef61..5c21f493284 100644 --- a/src/mesa/state_tracker/st_cb_strings.c +++ b/src/mesa/state_tracker/st_cb_strings.c @@ -43,7 +43,7 @@ static const GLubyte * st_get_string(struct gl_context * ctx, GLenum name) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; switch (name) { case GL_VENDOR: { diff --git a/src/mesa/state_tracker/st_cb_syncobj.c b/src/mesa/state_tracker/st_cb_syncobj.c index a625f9f73f8..ccad4b626a5 100644 --- a/src/mesa/state_tracker/st_cb_syncobj.c +++ b/src/mesa/state_tracker/st_cb_syncobj.c @@ -57,7 +57,7 @@ static struct gl_sync_object *st_new_sync_object(struct gl_context *ctx) static void st_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *obj) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; struct st_sync_object *so = (struct st_sync_object*)obj; screen->fence_reference(screen, &so->fence, NULL); @@ -84,7 +84,7 @@ static void st_client_wait_sync(struct gl_context *ctx, GLbitfield flags, GLuint64 timeout) { struct pipe_context *pipe = st_context(ctx)->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; struct st_sync_object *so = (struct st_sync_object*)obj; struct pipe_fence_handle *fence = NULL; @@ -133,7 +133,7 @@ static void st_server_wait_sync(struct gl_context *ctx, GLbitfield flags, GLuint64 timeout) { struct pipe_context *pipe = st_context(ctx)->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; struct st_sync_object *so = (struct st_sync_object*)obj; struct pipe_fence_handle *fence = NULL; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 2b379c14cfa..dba638ecdc5 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -422,7 +422,7 @@ st_UnmapTextureImage(struct gl_context *ctx, static GLuint default_bindings(struct st_context *st, enum pipe_format format) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; const unsigned target = PIPE_TEXTURE_2D; unsigned bindings; @@ -1372,7 +1372,7 @@ try_pbo_upload(struct gl_context *ctx, GLuint dims, struct st_texture_object *stObj = st_texture_object(texImage->TexObject); struct pipe_resource *texture = stImage->pt; struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct pipe_surface *surface = NULL; struct st_pbo_addresses addr; enum pipe_format src_format; @@ -1485,7 +1485,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims, struct st_texture_image *stImage = st_texture_image(texImage); struct st_texture_object *stObj = st_texture_object(texImage->TexObject); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct pipe_resource *dst = stImage->pt; struct pipe_resource *src = NULL; struct pipe_resource src_templ; @@ -1790,7 +1790,7 @@ st_CompressedTexSubImage(struct gl_context *ctx, GLuint dims, struct st_texture_object *stObj = st_texture_object(texImage->TexObject); struct pipe_resource *texture = stImage->pt; struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct pipe_resource *dst = stImage->pt; struct pipe_surface *surface = NULL; struct compressed_pixelstore store; @@ -1968,7 +1968,7 @@ st_GetTexSubImage(struct gl_context * ctx, { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct st_texture_image *stImage = st_texture_image(texImage); struct st_texture_object *stObj = st_texture_object(texImage->TexObject); struct pipe_resource *src = stObj->pt; @@ -2506,7 +2506,7 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, struct st_renderbuffer *strb = st_renderbuffer(rb); struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; struct pipe_blit_info blit; enum pipe_format dst_format; GLboolean do_flip = (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP); @@ -2879,7 +2879,7 @@ st_texture_create_from_memory(struct st_context *st, GLuint bind) { struct pipe_resource pt, *newtex; - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; assert(target < PIPE_MAX_TEXTURE_TYPES); assert(width0 > 0); @@ -2939,7 +2939,7 @@ st_texture_storage(struct gl_context *ctx, struct st_context *st = st_context(ctx); struct st_texture_object *stObj = st_texture_object(texObj); struct st_memory_object *smObj = st_memory_object(memObj); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; unsigned ptWidth, bindings; uint16_t ptHeight, ptDepth, ptLayers; enum pipe_format fmt; @@ -3063,14 +3063,13 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target, GLint width, GLint height, GLint depth) { struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; if (width == 0 || height == 0 || depth == 0) { /* zero-sized images are legal, and always fit! */ return GL_TRUE; } - if (pipe->screen->can_create_resource) { + if (st->screen->can_create_resource) { /* Ask the gallium driver if the texture is too large */ struct gl_texture_object *texObj = _mesa_get_current_tex_object(ctx, target); @@ -3104,7 +3103,7 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target, pt.last_level = util_logbase2(MAX3(width, height, depth)); } - return pipe->screen->can_create_resource(pipe->screen, &pt); + return st->screen->can_create_resource(st->screen, &pt); } else { /* Use core Mesa fallback */ diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index bd5581a19aa..afd70ab1749 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -122,7 +122,7 @@ st_Enable(struct gl_context *ctx, GLenum cap, UNUSED GLboolean state) static void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; struct pipe_memory_info info; assert(screen->query_memory_info); @@ -464,7 +464,7 @@ st_destroy_context_priv(struct st_context *st, bool destroy_pipe) /* free glReadPixels cache data */ st_invalidate_readpix_cache(st); - util_throttle_deinit(st->pipe->screen, &st->throttle); + util_throttle_deinit(st->screen, &st->throttle); cso_destroy_context(st->cso_context); @@ -580,8 +580,10 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, ctx->st = st; st->ctx = ctx; + st->screen = pipe->screen; st->pipe = pipe; st->dirty = ST_ALL_STATES_MASK; + st->screen = screen; st->can_bind_const_buffer_as_vertex = screen->get_param(screen, PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX); @@ -613,7 +615,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, st_init_pbo_helpers(st); /* Choose texture target for glDrawPixels, glBitmap, renderbuffers */ - if (pipe->screen->get_param(pipe->screen, PIPE_CAP_NPOT_TEXTURES)) + if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) st->internal_target = PIPE_TEXTURE_2D; else st->internal_target = PIPE_TEXTURE_RECT; @@ -714,8 +716,8 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET)); /* GL limits and extensions */ - st_init_limits(pipe->screen, &ctx->Const, &ctx->Extensions); - st_init_extensions(pipe->screen, &ctx->Const, + st_init_limits(screen, &ctx->Const, &ctx->Extensions); + st_init_extensions(screen, &ctx->Const, &ctx->Extensions, &st->options, ctx->API); /* FIXME: add support for geometry and tessellation shaders for @@ -891,7 +893,7 @@ st_set_background_context(struct gl_context *ctx, static void st_get_device_uuid(struct gl_context *ctx, char *uuid) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; assert(GL_UUID_SIZE_EXT >= PIPE_UUID_SIZE); memset(uuid, 0, GL_UUID_SIZE_EXT); @@ -902,7 +904,7 @@ st_get_device_uuid(struct gl_context *ctx, char *uuid) static void st_get_driver_uuid(struct gl_context *ctx, char *uuid) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; assert(GL_UUID_SIZE_EXT >= PIPE_UUID_SIZE); memset(uuid, 0, GL_UUID_SIZE_EXT); @@ -1172,7 +1174,7 @@ st_get_nir_compiler_options(struct st_context *st, gl_shader_stage stage) if (options) { return options; } else { - return nir_to_tgsi_get_compiler_options(st->pipe->screen, + return nir_to_tgsi_get_compiler_options(st->screen, PIPE_SHADER_IR_NIR, pipe_shader_type_from_mesa(stage)); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index ac359096a7c..dc84079e7cd 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -123,7 +123,7 @@ struct st_context struct st_context_iface iface; struct gl_context *ctx; - + struct pipe_screen *screen; struct pipe_context *pipe; struct draw_context *draw; /**< For selection/feedback/rastpos only */ @@ -374,7 +374,6 @@ struct st_context struct st_zombie_shader_node list; simple_mtx_t mutex; } zombie_shaders; - }; diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index e2053362197..1c927316e47 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -62,7 +62,7 @@ enum pipe_format st_mesa_format_to_pipe_format(const struct st_context *st, mesa_format mesaFormat) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; /* The destination RGBA format mustn't be changed, because it's also * a destination format of the unpack/decompression function. @@ -1101,7 +1101,7 @@ st_choose_format(struct st_context *st, GLenum internalFormat, unsigned storage_sample_count, unsigned bindings, bool swap_bytes, bool allow_dxt) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; unsigned i; int j; enum pipe_format pf; @@ -1215,7 +1215,7 @@ enum pipe_format st_choose_matching_format(struct st_context *st, unsigned bind, GLenum format, GLenum type, GLboolean swapBytes) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; if (swapBytes && !_mesa_swap_bytes_in_type_enum(&type)) return PIPE_FORMAT_NONE; diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index eb7d255d232..70a56c4431e 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -138,8 +138,8 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, * if not then generate the mipmap by rendering/texturing. * If that fails, use the software fallback. */ - if (!st->pipe->screen->get_param(st->pipe->screen, - PIPE_CAP_GENERATE_MIPMAP) || + if (!st->screen->get_param(st->screen, + PIPE_CAP_GENERATE_MIPMAP) || !st->pipe->generate_mipmap(st->pipe, pt, format, baseLevel, lastLevel, first_layer, last_layer)) { diff --git a/src/mesa/state_tracker/st_glsl_to_ir.cpp b/src/mesa/state_tracker/st_glsl_to_ir.cpp index 5025eaa7a7b..a13bb573aa4 100644 --- a/src/mesa/state_tracker/st_glsl_to_ir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_ir.cpp @@ -45,7 +45,7 @@ extern "C" { GLboolean st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) { - struct pipe_screen *pscreen = ctx->st->pipe->screen; + struct pipe_screen *pscreen = st_context(ctx)->screen; enum pipe_shader_ir preferred_ir = (enum pipe_shader_ir) pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 790993c02d3..e1b364c1440 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -348,7 +348,7 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog, struct gl_shader_program *shader_program, gl_shader_stage stage) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; const nir_shader_compiler_options *options = st->ctx->Const.ShaderCompilerOptions[prog->info.stage].NirOptions; assert(options); @@ -430,7 +430,7 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog, struct gl_shader_program *shader_program) { nir_shader *nir = prog->nir; - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; /* Make a pass over the IR to add state references for any built-in * uniforms that are used. This has to be done now (during linking). @@ -769,7 +769,7 @@ st_link_nir(struct gl_context *ctx, nir_remap_dual_slot_attributes(nir, &shader->Program->DualSlotInputs); NIR_PASS_V(nir, st_nir_lower_wpos_ytransform, shader->Program, - st->pipe->screen); + st->screen); NIR_PASS_V(nir, nir_lower_system_values); NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); @@ -957,7 +957,7 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, struct gl_shader_program *shader_program, nir_shader *nir, bool finalize_by_driver) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; NIR_PASS_V(nir, nir_split_var_copies); NIR_PASS_V(nir, nir_lower_var_copies); diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index e11d4cfb516..542dc3cd2ec 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6399,7 +6399,7 @@ emit_wpos(struct st_context *st, struct ureg_program *ureg, int wpos_transform_const) { - struct pipe_screen *pscreen = st->pipe->screen; + struct pipe_screen *pscreen = st->screen; GLfloat adjX = 0.0f; GLfloat adjY[2] = { 0.0f, 0.0f }; boolean invert = FALSE; @@ -6580,7 +6580,7 @@ st_translate_program( const ubyte outputSemanticName[], const ubyte outputSemanticIndex[]) { - struct pipe_screen *screen = st_context(ctx)->pipe->screen; + struct pipe_screen *screen = st_context(ctx)->screen; struct st_translate *t; unsigned i; struct gl_program_constants *frag_const = @@ -6826,7 +6826,7 @@ st_translate_program( * inconsistency, we insert a U2F. */ struct st_context *st = st_context(ctx); - struct pipe_screen *pscreen = st->pipe->screen; + struct pipe_screen *pscreen = st->screen; assert(procType == PIPE_SHADER_VERTEX); assert(pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_INTEGERS)); (void) pscreen; @@ -7015,7 +7015,7 @@ get_mesa_program_tgsi(struct gl_context *ctx, struct gl_program *prog; struct gl_shader_compiler_options *options = &ctx->Const.ShaderCompilerOptions[shader->Stage]; - struct pipe_screen *pscreen = ctx->st->pipe->screen; + struct pipe_screen *pscreen = st_context(ctx)->screen; enum pipe_shader_type ptarget = pipe_shader_type_from_mesa(shader->Stage); unsigned skip_merge_registers; @@ -7245,7 +7245,7 @@ has_unsupported_control_flow(exec_list *ir, GLboolean st_link_tgsi(struct gl_context *ctx, struct gl_shader_program *prog) { - struct pipe_screen *pscreen = ctx->st->pipe->screen; + struct pipe_screen *pscreen = st_context(ctx)->screen; for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_linked_shader *shader = prog->_LinkedShaders[i]; diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 9883425f2dd..ea3d5207ffd 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -471,7 +471,7 @@ st_framebuffer_create(struct st_context *st, * is also expressed by using the same extension flag */ if (_mesa_has_EXT_framebuffer_sRGB(st->ctx)) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; const enum pipe_format srgb_format = util_format_srgb(stfbi->visual->color_format); @@ -674,9 +674,9 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, st_flush(st, fence, pipe_flags); if ((flags & ST_FLUSH_WAIT) && fence && *fence) { - st->pipe->screen->fence_finish(st->pipe->screen, NULL, *fence, + st->screen->fence_finish(st->screen, NULL, *fence, PIPE_TIMEOUT_INFINITE); - st->pipe->screen->fence_reference(st->pipe->screen, fence, NULL); + st->screen->fence_reference(st->screen, fence, NULL); } if (flags & ST_FLUSH_FRONT) @@ -973,7 +973,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, } } - st->can_scissor_clear = !!st->pipe->screen->get_param(st->pipe->screen, PIPE_CAP_CLEAR_SCISSORED); + st->can_scissor_clear = !!st->screen->get_param(st->screen, PIPE_CAP_CLEAR_SCISSORED); st->invalidate_on_gl_viewport = smapi->get_param(smapi, ST_MANAGER_BROKEN_INVALIDATE); @@ -991,7 +991,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, st->iface.state_manager = smapi; if (st->ctx->IntelBlackholeRender && - st->pipe->screen->get_param(st->pipe->screen, PIPE_CAP_FRONTEND_NOOP)) + st->screen->get_param(st->screen, PIPE_CAP_FRONTEND_NOOP)) st->pipe->set_frontend_noop(st->pipe, st->ctx->IntelBlackholeRender); *error = ST_CONTEXT_SUCCESS; diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 21e5637d5cd..4b36e38f05d 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -714,7 +714,7 @@ emit_wpos(struct st_context *st, const struct gl_program *program, struct ureg_program *ureg) { - struct pipe_screen *pscreen = st->pipe->screen; + struct pipe_screen *pscreen = st->screen; GLfloat adjX = 0.0f; GLfloat adjY[2] = { 0.0f, 0.0f }; boolean invert = FALSE; @@ -980,7 +980,7 @@ st_translate_mesa_program(struct gl_context *ctx, * inconsistency, we insert a U2F. */ struct st_context *st = st_context(ctx); - struct pipe_screen *pscreen = st->pipe->screen; + struct pipe_screen *pscreen = st->screen; assert(procType == PIPE_SHADER_VERTEX); assert(pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_INTEGERS)); diff --git a/src/mesa/state_tracker/st_nir_builtins.c b/src/mesa/state_tracker/st_nir_builtins.c index fba4e9a3665..2f7520b9dce 100644 --- a/src/mesa/state_tracker/st_nir_builtins.c +++ b/src/mesa/state_tracker/st_nir_builtins.c @@ -32,7 +32,7 @@ st_nir_finish_builtin_shader(struct st_context *st, nir_shader *nir) { struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; gl_shader_stage stage = nir->info.stage; enum pipe_shader_type sh = pipe_shader_type_from_mesa(stage); diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c index 985892f5ed2..fbc6b4ef8a2 100644 --- a/src/mesa/state_tracker/st_pbo.c +++ b/src/mesa/state_tracker/st_pbo.c @@ -405,7 +405,7 @@ create_fs(struct st_context *st, bool download, enum pipe_texture_target target, enum st_pbo_conversion conversion) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; const nir_shader_compiler_options *options = st_get_nir_compiler_options(st, MESA_SHADER_FRAGMENT); bool pos_is_sysval = @@ -594,8 +594,7 @@ st_pbo_get_download_fs(struct st_context *st, enum pipe_texture_target target, void st_init_pbo_helpers(struct st_context *st) { - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; st->pbo.upload_enabled = screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS) && diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 46c39431d21..1d21e1267bc 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -378,7 +378,7 @@ static nir_shader * st_translate_prog_to_nir(struct st_context *st, struct gl_program *prog, gl_shader_stage stage) { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; const struct gl_shader_compiler_options *options = &st->ctx->Const.ShaderCompilerOptions[stage]; @@ -513,9 +513,9 @@ st_translate_vertex_program(struct st_context *st, /* Translate to NIR if preferred. */ if (PIPE_SHADER_IR_NIR == - st->pipe->screen->get_shader_param(st->pipe->screen, - PIPE_SHADER_VERTEX, - PIPE_SHADER_CAP_PREFERRED_IR)) { + st->screen->get_shader_param(st->screen, + PIPE_SHADER_VERTEX, + PIPE_SHADER_CAP_PREFERRED_IR)) { assert(!stp->glsl_to_tgsi); if (stp->Base.nir) @@ -558,7 +558,7 @@ st_translate_vertex_program(struct st_context *st, output_semantic_name[num_outputs] = TGSI_SEMANTIC_EDGEFLAG; output_semantic_index[num_outputs] = 0; - ureg = ureg_create_with_screen(PIPE_SHADER_VERTEX, st->pipe->screen); + ureg = ureg_create_with_screen(PIPE_SHADER_VERTEX, st->screen); if (ureg == NULL) return false; @@ -661,7 +661,7 @@ lower_ucp(struct st_context *st, if (nir->info.outputs_written & VARYING_BIT_CLIP_DIST0) NIR_PASS_V(nir, nir_lower_clip_disable, ucp_enables); else { - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; bool can_compact = screen->get_param(screen, PIPE_CAP_NIR_COMPACT_ARRAYS); bool use_eye = st->ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] != NULL; @@ -887,9 +887,9 @@ st_translate_fragment_program(struct st_context *st, /* Translate to NIR. */ if (!stfp->ati_fs && PIPE_SHADER_IR_NIR == - st->pipe->screen->get_shader_param(st->pipe->screen, - PIPE_SHADER_FRAGMENT, - PIPE_SHADER_CAP_PREFERRED_IR)) { + st->screen->get_shader_param(st->screen, + PIPE_SHADER_FRAGMENT, + PIPE_SHADER_CAP_PREFERRED_IR)) { nir_shader *nir = st_translate_prog_to_nir(st, &stfp->Base, MESA_SHADER_FRAGMENT); @@ -1134,7 +1134,7 @@ st_translate_fragment_program(struct st_context *st, } } - ureg = ureg_create_with_screen(PIPE_SHADER_FRAGMENT, st->pipe->screen); + ureg = ureg_create_with_screen(PIPE_SHADER_FRAGMENT, st->screen); if (ureg == NULL) return false; @@ -1321,7 +1321,7 @@ st_create_fp_variant(struct st_context *st, key->external.lower_ayuv || key->external.lower_xyuv || key->external.lower_yuv)) { - st_nir_lower_samplers(pipe->screen, state.ir.nir, + st_nir_lower_samplers(st->screen, state.ir.nir, stfp->shader_program, &stfp->Base); nir_lower_tex_options options = {0}; @@ -1359,7 +1359,7 @@ st_create_fp_variant(struct st_context *st, nir_shader_gather_info(state.ir.nir, nir_shader_get_entrypoint(state.ir.nir)); - struct pipe_screen *screen = pipe->screen; + struct pipe_screen *screen = st->screen; if (screen->finalize_nir) screen->finalize_nir(screen, state.ir.nir, false); } @@ -1567,7 +1567,7 @@ st_translate_common_program(struct st_context *st, struct gl_program *prog = &stp->Base; enum pipe_shader_type stage = pipe_shader_type_from_mesa(stp->Base.info.stage); - struct ureg_program *ureg = ureg_create_with_screen(stage, st->pipe->screen); + struct ureg_program *ureg = ureg_create_with_screen(stage, st->screen); if (ureg == NULL) return false; diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 24f6019029c..bb63eefdffe 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -66,7 +66,7 @@ st_texture_create(struct st_context *st, GLuint bind) { struct pipe_resource pt, *newtex; - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; assert(target < PIPE_MAX_TEXTURE_TYPES); assert(width0 > 0); diff --git a/src/mesa/state_tracker/st_vdpau.c b/src/mesa/state_tracker/st_vdpau.c index 641f553e92b..fe3e321af23 100644 --- a/src/mesa/state_tracker/st_vdpau.c +++ b/src/mesa/state_tracker/st_vdpau.c @@ -135,8 +135,8 @@ st_vdpau_resource_from_description(struct gl_context *ctx, whandle.offset = desc->offset; whandle.stride = desc->stride; - res = st->pipe->screen->resource_from_handle(st->pipe->screen, &templ, &whandle, - PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE); + res = st->screen->resource_from_handle(st->screen, &templ, &whandle, + PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE); close(desc->handle); return res; @@ -188,7 +188,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access, const void *vdpSurface, GLuint index) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; + struct pipe_screen *screen = st->screen; struct st_texture_object *stObj = st_texture_object(texObj); struct st_texture_image *stImage = st_texture_image(texImage); -- 2.34.1