diff options
Diffstat (limited to 'lib/mesa')
4 files changed, 37 insertions, 30 deletions
diff --git a/lib/mesa/src/gallium/drivers/zink/nir_lower_dynamic_bo_access.c b/lib/mesa/src/gallium/drivers/zink/nir_lower_dynamic_bo_access.c index f0bc8f9d1..864030ad8 100644 --- a/lib/mesa/src/gallium/drivers/zink/nir_lower_dynamic_bo_access.c +++ b/lib/mesa/src/gallium/drivers/zink/nir_lower_dynamic_bo_access.c @@ -49,9 +49,13 @@ recursive_generate_bo_ssa_def(nir_builder *b, nir_intrinsic_instr *instr, nir_ss new_instr->src[0] = nir_src_for_ssa(nir_imm_int(b, start)); for (unsigned i = 0; i < nir_intrinsic_infos[instr->intrinsic].num_srcs; i++) { if (i) - nir_src_copy(&new_instr->src[i], &instr->src[i]); + nir_src_copy(&new_instr->src[i], &instr->src[i], &new_instr->instr); + } + if (instr->intrinsic != nir_intrinsic_load_ubo_vec4) { + nir_intrinsic_set_align(new_instr, nir_intrinsic_align_mul(instr), nir_intrinsic_align_offset(instr)); + if (instr->intrinsic != nir_intrinsic_load_ssbo) + nir_intrinsic_set_range(new_instr, nir_intrinsic_range(instr)); } - nir_intrinsic_copy_const_indices(new_instr, instr); new_instr->num_components = instr->num_components; nir_ssa_dest_init(&new_instr->instr, &new_instr->dest, nir_dest_num_components(instr->dest), @@ -87,15 +91,8 @@ generate_store_ssbo_ssa_def(nir_builder *b, nir_intrinsic_instr *instr, nir_ssa_ } static bool -lower_dynamic_bo_access_instr(nir_builder *b, - nir_instr *instr_, - UNUSED void *cb_data) +lower_dynamic_bo_access_instr(nir_intrinsic_instr *instr, nir_builder *b) { - if (instr_->type != nir_instr_type_intrinsic) - return false; - - nir_intrinsic_instr *instr = nir_instr_as_intrinsic(instr_); - if (instr->intrinsic != nir_intrinsic_load_ubo && instr->intrinsic != nir_intrinsic_load_ubo_vec4 && instr->intrinsic != nir_intrinsic_get_ssbo_size && @@ -140,8 +137,24 @@ lower_dynamic_bo_access_instr(nir_builder *b, bool nir_lower_dynamic_bo_access(nir_shader *shader) { - return nir_shader_instructions_pass(shader, - lower_dynamic_bo_access_instr, - nir_metadata_dominance, - NULL); + bool progress = false; + + nir_foreach_function(function, shader) { + if (function->impl) { + nir_builder builder; + nir_builder_init(&builder, function->impl); + nir_foreach_block(block, function->impl) { + nir_foreach_instr_safe(instr, block) { + if (instr->type == nir_instr_type_intrinsic) + progress |= lower_dynamic_bo_access_instr( + nir_instr_as_intrinsic(instr), + &builder); + } + } + + nir_metadata_preserve(function->impl, nir_metadata_dominance); + } + } + + return progress; } diff --git a/lib/mesa/src/gallium/frontends/xvmc/subpicture.c b/lib/mesa/src/gallium/frontends/xvmc/subpicture.c index a9ceff219..aa6253bed 100644 --- a/lib/mesa/src/gallium/frontends/xvmc/subpicture.c +++ b/lib/mesa/src/gallium/frontends/xvmc/subpicture.c @@ -210,7 +210,7 @@ upload_sampler(struct pipe_context *pipe, struct pipe_sampler_view *dst, struct pipe_transfer *transfer; void *map; - map = pipe->texture_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, + map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, dst_box, &transfer); if (!map) return; @@ -219,7 +219,7 @@ upload_sampler(struct pipe_context *pipe, struct pipe_sampler_view *dst, dst_box->width, dst_box->height, src, src_stride, src_x, src_y); - pipe->texture_unmap(pipe, transfer); + pipe->transfer_unmap(pipe, transfer); } static void @@ -231,7 +231,7 @@ upload_sampler_convert(struct pipe_context *pipe, struct pipe_sampler_view *dst, int i, j; char *map, *src; - map = pipe->texture_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, + map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, dst_box, &transfer); if (!map) return; @@ -254,7 +254,7 @@ upload_sampler_convert(struct pipe_context *pipe, struct pipe_sampler_view *dst, map[j * 2 + 0] = map[j * 2 + 1] = (src[j] >> 4) | (src[j] << 4); } - pipe->texture_unmap(pipe, transfer); + pipe->transfer_unmap(pipe, transfer); } PUBLIC @@ -393,7 +393,7 @@ Status XvMCClearSubpicture(Display *dpy, XvMCSubpicture *subpicture, short x, sh dst = subpicture_priv->sampler; /* TODO: Assert clear rect is within bounds? Or clip? */ - map = pipe->texture_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, + map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, &dst_box, &transfer); if (!map) return XvMCBadSubpicture; @@ -401,7 +401,7 @@ Status XvMCClearSubpicture(Display *dpy, XvMCSubpicture *subpicture, short x, sh util_fill_rect(map, dst->texture->format, transfer->stride, 0, 0, dst_box.width, dst_box.height, &uc); - pipe->texture_unmap(pipe, transfer); + pipe->transfer_unmap(pipe, transfer); return Success; } diff --git a/lib/mesa/src/gallium/targets/libgl-d3d12/libgl_d3d12.c b/lib/mesa/src/gallium/targets/libgl-d3d12/libgl_d3d12.c index 4bd5a2d47..981f1fca3 100644 --- a/lib/mesa/src/gallium/targets/libgl-d3d12/libgl_d3d12.c +++ b/lib/mesa/src/gallium/targets/libgl-d3d12/libgl_d3d12.c @@ -94,17 +94,12 @@ gdi_get_pfd_flags(struct pipe_screen *screen) static struct stw_winsys_framebuffer * gdi_create_framebuffer(struct pipe_screen *screen, - HWND hWnd, + HDC hDC, int iPixelFormat) { - return d3d12_wgl_create_framebuffer(screen, hWnd, iPixelFormat); + return d3d12_wgl_create_framebuffer(screen, hDC, iPixelFormat); } -static const char * -get_name(void) -{ - return "d3d12"; -} static const struct stw_winsys stw_winsys = { &gdi_screen_create, @@ -114,8 +109,7 @@ static const struct stw_winsys stw_winsys = { NULL, /* shared_surface_close */ NULL, /* compose */ &gdi_get_pfd_flags, - &gdi_create_framebuffer, - &get_name, + &gdi_create_framebuffer }; diff --git a/lib/mesa/src/gallium/targets/libgl-d3d12/meson.build b/lib/mesa/src/gallium/targets/libgl-d3d12/meson.build index 46e2edbfa..0f09d9647 100644 --- a/lib/mesa/src/gallium/targets/libgl-d3d12/meson.build +++ b/lib/mesa/src/gallium/targets/libgl-d3d12/meson.build @@ -28,7 +28,7 @@ libopenglon12 = shared_library( ], link_whole : [libwgl], link_with : [ - libgallium, libglsl, libmesa, libwsgdi, libd3d12winsys, libglapi_static, libglapi + libgallium, libglsl, libmesa_gallium, libwsgdi, libd3d12winsys, libglapi_static, libglapi ], dependencies : [ dep_ws2_32, idep_nir, idep_mesautil, driver_d3d12 |