Mesa: tag mesa-11.2.0-rc1: Mesa 11.2.0-rc1 release candidate
Module: Mesa Branch: refs/tags/mesa-11.2.0-rc1 Tag:05d494c7bd2b20397f42ada776fd4d3ca3df8f80 URL: http://cgit.freedesktop.org/mesa/mesa/tag/?id=05d494c7bd2b20397f42ada776fd4d3ca3df8f80 Tagger: Emil Velikov Date: Mon Feb 22 11:43:07 2016 + Mesa 11.2.0-rc1 release candidate ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa: tag 11.2-branchpoint: Mesa 11.2 branchpoint
Module: Mesa Branch: refs/tags/11.2-branchpoint Tag:4cd94a06081157454dc9769d6e6ab11418fb24b0 URL: http://cgit.freedesktop.org/mesa/mesa/tag/?id=4cd94a06081157454dc9769d6e6ab11418fb24b0 Tagger: Emil Velikov Date: Mon Feb 22 11:42:05 2016 + Mesa 11.2 branchpoint ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (11.2): Update version to 11.2.0-rc1
Module: Mesa Branch: 11.2 Commit: 35b7adb937eeefd4ac8ca3ebb2c7347cc7bcbcf9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=35b7adb937eeefd4ac8ca3ebb2c7347cc7bcbcf9 Author: Emil Velikov Date: Mon Feb 22 10:14:23 2016 + Update version to 11.2.0-rc1 Signed-off-by: Emil Velikov --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 96cb839..94ba9ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.2.0-devel +11.2.0-rc1 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nouveau: update the Makefile.sources list
Module: Mesa Branch: master Commit: 4cd5e5b48e24a8b8ff7255022208d3e5fe6557d8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4cd5e5b48e24a8b8ff7255022208d3e5fe6557d8 Author: Emil Velikov Date: Mon Feb 22 10:22:21 2016 + nouveau: update the Makefile.sources list Reflect the nv50->g80 change and the new gm107_texture header. Signed-off-by: Emil Velikov --- src/gallium/drivers/nouveau/Makefile.sources | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/Makefile.sources b/src/gallium/drivers/nouveau/Makefile.sources index 31a9365..43ffce6 100644 --- a/src/gallium/drivers/nouveau/Makefile.sources +++ b/src/gallium/drivers/nouveau/Makefile.sources @@ -60,6 +60,8 @@ NV30_C_SOURCES := \ nv30/nvfx_vertprog.c NV50_C_SOURCES := \ + nv50/g80_defs.xml.h \ + nv50/g80_texture.xml.h \ nv50/nv50_2d.xml.h \ nv50/nv50_3ddefs.xml.h \ nv50/nv50_3d.xml.h \ @@ -68,7 +70,6 @@ NV50_C_SOURCES := \ nv50/nv50_compute.xml.h \ nv50/nv50_context.c \ nv50/nv50_context.h \ - nv50/nv50_defs.xml.h \ nv50/nv50_formats.c \ nv50/nv50_miptree.c \ nv50/nv50_program.c \ @@ -93,7 +94,6 @@ NV50_C_SOURCES := \ nv50/nv50_state_validate.c \ nv50/nv50_surface.c \ nv50/nv50_tex.c \ - nv50/nv50_texture.xml.h \ nv50/nv50_transfer.c \ nv50/nv50_transfer.h \ nv50/nv50_vbo.c \ @@ -147,6 +147,7 @@ NVC0_CODEGEN_SOURCES := \ codegen/nv50_ir_target_nvc0.h NVC0_C_SOURCES := \ + nvc0/gm107_texture.xml.h \ nvc0/nvc0_3d.xml.h \ nvc0/nvc0_compute.c \ nvc0/nvc0_compute.h \ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: bump version
Module: Mesa Branch: master Commit: af8ad495415e9d71fd6255114d4ea5e0ab6a1e2a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=af8ad495415e9d71fd6255114d4ea5e0ab6a1e2a Author: Ilia Mirkin Date: Mon Feb 22 09:06:59 2016 -0500 mesa: bump version 11.2 has been branched, we're on 11.3 now. Signed-off-by: Ilia Mirkin Reviewed-by: Emil Velikov --- VERSION | 2 +- docs/relnotes/11.3.0.html | 59 +++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 96cb839..677ed99 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.2.0-devel +11.3.0-devel diff --git a/docs/relnotes/11.3.0.html b/docs/relnotes/11.3.0.html new file mode 100644 index 000..56c1542 --- /dev/null +++ b/docs/relnotes/11.3.0.html @@ -0,0 +1,59 @@ +http://www.w3.org/TR/html4/loose.dtd";> + + + + Mesa Release Notes + + + + + + The Mesa 3D Graphics Library + + + + + +Mesa 11.3.0 Release Notes / TBD + + +Mesa 11.3.0 is a new development release. +People who are concerned with stability and reliability should stick +with a previous release or wait for Mesa 11.3.1. + + +Mesa 11.3.0 implements the OpenGL 4.1 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 4.1. OpenGL +4.1 is only available if requested at context creation +because compatibility contexts are not supported. + + + +SHA256 checksums + +TBD. + + + +New features + + +Note: some of the new features are only available with certain drivers. + + + + + +Bug fixes + +TBD. + +Changes + +TBD. + + + + ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: add GL_EXT_texture_border_clamp support
Module: Mesa Branch: master Commit: 571bd9ac4280b0d3c10281e9899afb33bc67d589 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=571bd9ac4280b0d3c10281e9899afb33bc67d589 Author: Ilia Mirkin Date: Wed Feb 17 07:36:58 2016 -0500 mesa: add GL_EXT_texture_border_clamp support This extension is identical to GL_OES_texture_border_clamp. But dEQP has tests that want the EXT variant. Signed-off-by: Ilia Mirkin Reviewed-by: Samuel Iglesias Gonsálvez --- src/mapi/glapi/gen/EXT_texture_integer.xml | 8 src/mapi/glapi/gen/es_EXT.xml | 30 ++ src/mesa/main/extensions_table.h | 1 + 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/mapi/glapi/gen/EXT_texture_integer.xml b/src/mapi/glapi/gen/EXT_texture_integer.xml index 5f9ea29..eb6b220 100644 --- a/src/mapi/glapi/gen/EXT_texture_integer.xml +++ b/src/mapi/glapi/gen/EXT_texture_integer.xml @@ -69,25 +69,25 @@ - + - + - + - + diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index fb0ef05..178f7c0 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -817,6 +817,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: add GL_OES_texture_border_clamp support
Module: Mesa Branch: master Commit: b6654831c36f9780e6bcd23bb211470ec0db7de2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6654831c36f9780e6bcd23bb211470ec0db7de2 Author: Ilia Mirkin Date: Mon Feb 15 19:09:15 2016 -0500 mesa: add GL_OES_texture_border_clamp support Only minor differences to the existing ARB_texture_border_clamp support. Signed-off-by: Ilia Mirkin Reviewed-by: Samuel Iglesias Gonsálvez --- docs/GL3.txt| 2 +- docs/relnotes/11.3.0.html | 1 + src/mapi/glapi/gen/es_EXT.xml | 58 - src/mesa/main/extensions_table.h| 1 + src/mesa/main/samplerobj.c | 6 ++-- src/mesa/main/tests/dispatch_sanity.cpp | 10 ++ src/mesa/main/texparam.c| 11 --- 7 files changed, 81 insertions(+), 8 deletions(-) diff --git a/docs/GL3.txt b/docs/GL3.txt index 73974de..76f40e4 100644 --- a/docs/GL3.txt +++ b/docs/GL3.txt @@ -253,7 +253,7 @@ GLES3.2, GLSL ES 3.2 GL_OES_shader_io_blocks not started (based on parts of GLSL 1.50, which is done) GL_OES_shader_multisample_interpolation not started (based on parts of GL_ARB_gpu_shader5, which is done) GL_OES_tessellation_shader not started (based on GL_ARB_tessellation_shader, which is done for some drivers) - GL_OES_texture_border_clamp not started (based on GL_ARB_texture_border_clamp, which is done) + GL_OES_texture_border_clamp DONE (all drivers) GL_OES_texture_buffernot started (based on GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_range, and GL_ARB_texture_buffer_object_rgb32 that are all done) GL_OES_texture_cube_map_arraynot started (based on GL_ARB_texture_cube_map_array, which is done for all drivers) GL_OES_texture_stencil8 DONE (all drivers that support GL_ARB_texture_stencil8) diff --git a/docs/relnotes/11.3.0.html b/docs/relnotes/11.3.0.html index 56c1542..eee4373 100644 --- a/docs/relnotes/11.3.0.html +++ b/docs/relnotes/11.3.0.html @@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers. +GL_OES_texture_border_clamp and GL_EXT_texture_border_clamp on all drivers that support GL_ARB_texture_border_clamp Bug fixes diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index 86df980..fb0ef05 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -982,5 +982,61 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 0c90f01..2cd9d75 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -333,6 +333,7 @@ EXT(OES_stencil8, dummy_true EXT(OES_stencil_wrap, dummy_true , x , x , ES1, x , 2002) EXT(OES_surfaceless_context , dummy_true , x , x , ES1, ES2, 2012) EXT(OES_texture_3D , dummy_true , x , x , x , ES2, 2005) +EXT(OES_texture_border_clamp, ARB_texture_border_clamp , x , x , x , ES2, 2014) EXT(OES_texture_cube_map, ARB_texture_cube_map , x , x , ES1, x , 2007) EXT(OES_texture_env_crossbar, ARB_texture_env_crossbar , x , x , ES1, x , 2005) EXT(OES_texture_float , OES_texture_float , x , x , x , ES2, 2005) diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index fe15508..ca366d9 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -1518,7 +1518,8 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params) sampObj = _mesa_lookup_samplerobj(ctx, sampler); if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, + _mesa_error(ctx, (_mesa_is_gles(ctx) ? +GL_INVALID_OPERATION : GL_INVALID_VALUE), "glGetSamplerParameterIiv(sampler %u)", sampler); return; @@ -1593,7 +1594,8 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params) sampObj = _mesa_lookup_samplerobj(ctx, sampler); if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, + _mesa_error(ctx, (_mesa_is_gles(ctx) ? +GL_INVALID_OPERATION : GL_IN
Mesa (vulkan): intel/genxml: Add README
Module: Mesa Branch: vulkan Commit: f843aabdd42051abc8b22437d5c9167fc867ac46 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f843aabdd42051abc8b22437d5c9167fc867ac46 Author: Kristian Høgsberg Kristensen Date: Mon Feb 22 09:14:25 2016 -0800 intel/genxml: Add README I've had people ask about the design of the pack functions, for example, why aren't we using bitfields. I wrote up a bit of background on why and how we ended up with the current design and we might as well keep that with the code. --- src/intel/genxml/README | 60 + 1 file changed, 60 insertions(+) diff --git a/src/intel/genxml/README b/src/intel/genxml/README new file mode 100644 index 000..bc518c6 --- /dev/null +++ b/src/intel/genxml/README @@ -0,0 +1,60 @@ +This provides some background the design of the generated headers. We +started out trying to generate bit fields but it evolved into the pack +functions because of a few limitations: + + 1) Bit fields still generate terrible code today. Even with modern + optimizing compilers you get multiple load+mask+store operations + to the same dword in memory as you set individual bits. The + compiler also has to generate code to mask out overflowing values + (for example, if you assign 200 to a 2 bit field). Our driver + never writes overflowing values so that's not needed. On the + other hand, most compiler recognize that the template struct we + use is a temporary variable and copy propagate the individual + fields and do amazing constant folding. You should take a look + at the code that gets generated when you compile in release mode + with optimizations. + + 2) For some types we need to have overlapping bit fields. For + example, some values are 64 byte aligned 32 bit offsets. The + lower 5 bits of the offset are always zero, so the hw packs in a + few misc bits in the lower 5 bits there. Other times a field can + be either a u32 or a float. I tried to do this with overlapping + anonymous unions and it became a big mess. Also, when using + initializers, you can only initialize one union member so this + just doesn't work with out approach. + + The pack functions on the other hand allows us a great deal of + flexibility in how we combine things. In the case of overlapping + fields (the u32 and float case), if we only set one of them in + the pack function, the compiler will recognize that the other is + initialized to 0 and optimize out the code to or it it. + + 3) Bit fields (and certainly overlapping anonymous unions of bit + fields) aren't generally stable across compilers in how they're + laid out and aligned. Our pack functions let us control exactly + how things get packed, using only simple and unambiguous bitwise + shifting and or'ing that works on any compiler. + +Once we have the pack function it allows us to hook in various +transformations and validation as we go from template struct to dwords +in memory: + + 1) Validation: As I said above, our driver isn't supposed to write + overflowing values to the fields, but we've of course had lots of + cases where we make mistakes and write overflowing values. With + the pack function, we can actually assert on that and catch it at + runtime. bitfields would just silently truncate. + + 2) Type conversions: some times it's just a matter of writing a + float to a u32, but we also convert from bool to bits, from + floats to fixed point integers. + + 3) Relocations: whenever we have a pointer from one buffer to + another (for example a pointer from the meta data for a texture + to the raw texture data), we have to tell the kernel about it so + it can adjust the pointer to point to the final location. That + means extra work we have to do extra work to record and annotate + the dword location that holds the pointer. With bit fields, we'd + have to call a function to do this, but with the pack function we + generate code in the pack function to do this for us. That's a + lot less error prone and less work. ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (vulkan): anv/meta_blit: Handle compressed textures in anv_CmdCopyImage
Module: Mesa Branch: vulkan Commit: 7b2c63a53ca0ec685085cbf6b2e1f0da00752d91 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b2c63a53ca0ec685085cbf6b2e1f0da00752d91 Author: Nanley Chery Date: Thu Feb 18 14:05:31 2016 -0800 anv/meta_blit: Handle compressed textures in anv_CmdCopyImage As with anv_CmdCopyBufferToImage, compressed textures require special handling during copies. Reviewed-by: Kristian Høgsberg Kristensen --- src/intel/vulkan/anv_meta_blit.c | 62 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c index 07ebcbc..06f13ec 100644 --- a/src/intel/vulkan/anv_meta_blit.c +++ b/src/intel/vulkan/anv_meta_blit.c @@ -696,31 +696,34 @@ void anv_CmdCopyImage( }, cmd_buffer, 0); - const VkOffset3D dest_offset = { - .x = pRegions[r].dstOffset.x, - .y = pRegions[r].dstOffset.y, - .z = 0, - }; - - unsigned num_slices; - if (src_image->type == VK_IMAGE_TYPE_3D) { - assert(pRegions[r].srcSubresource.layerCount == 1 && -pRegions[r].dstSubresource.layerCount == 1); - num_slices = pRegions[r].extent.depth; - } else { - assert(pRegions[r].srcSubresource.layerCount == -pRegions[r].dstSubresource.layerCount); - assert(pRegions[r].extent.depth == 1); - num_slices = pRegions[r].dstSubresource.layerCount; - } - const uint32_t dest_base_array_slice = anv_meta_get_iview_layer(dest_image, &pRegions[r].dstSubresource, &pRegions[r].dstOffset); - for (unsigned slice = 0; slice < num_slices; slice++) { + + unsigned num_slices_3d = pRegions[r].extent.depth; + unsigned num_slices_array = pRegions[r].dstSubresource.layerCount; + unsigned slice_3d = 0; + unsigned slice_array = 0; + while (slice_3d < num_slices_3d && slice_array < num_slices_array) { VkOffset3D src_offset = pRegions[r].srcOffset; - src_offset.z += slice; + src_offset.z += slice_3d + slice_array; + + uint32_t img_x = 0; + uint32_t img_y = 0; + uint32_t img_o = 0; + if (isl_format_is_compressed(dest_image->format->isl_format)) + isl_surf_get_image_intratile_offset_el(&cmd_buffer->device->isl_dev, + &dest_image->color_surface.isl, + pRegions[r].dstSubresource.mipLevel, + pRegions[r].dstSubresource.baseArrayLayer + slice_array, + pRegions[r].dstOffset.z + slice_3d, + &img_o, &img_x, &img_y); + + VkOffset3D dest_offset_el = meta_region_offset_el(dest_image, &pRegions[r].dstOffset); + dest_offset_el.x += img_x; + dest_offset_el.y += img_y; + dest_offset_el.z = 0; struct anv_image_view dest_iview; anv_image_view_init(&dest_iview, cmd_buffer->device, @@ -733,20 +736,29 @@ void anv_CmdCopyImage( .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .baseMipLevel = pRegions[r].dstSubresource.mipLevel, .levelCount = 1, - .baseArrayLayer = dest_base_array_slice + slice, + .baseArrayLayer = dest_base_array_slice + +slice_array + slice_3d, .layerCount = 1 }, }, -cmd_buffer, 0); +cmd_buffer, img_o); + + const VkExtent3D img_extent_el = meta_region_extent_el(dest_image->vk_format, + &pRegions[r].extent); meta_emit_blit(cmd_buffer, src_image, &src_iview, src_offset, -pRegions[r].extent, +img_extent_el, dest_image, &dest_iview, -dest_offset, -pRegions[r].extent, +dest_offset_el, +img_extent_el, VK_FILTER_NEAREST); + + if (dest_image->type == VK_IMAGE_TYPE_3D) +slice_3d++; + else +slice_array++; } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (vulkan): vulkan: fix out-of-tree builds
Module: Mesa Branch: vulkan Commit: 08b408311cb8fdbeae6d7ff5474107b0868c6ec9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=08b408311cb8fdbeae6d7ff5474107b0868c6ec9 Author: Mark Janes Date: Mon Feb 22 11:31:15 2016 -0800 vulkan: fix out-of-tree builds --- src/intel/vulkan/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am index 6be4f9f..53cfa20 100644 --- a/src/intel/vulkan/Makefile.am +++ b/src/intel/vulkan/Makefile.am @@ -66,6 +66,7 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/compiler \ -I$(top_builddir)/src/compiler/nir \ -I$(top_builddir)/src/intel \ + -I$(top_builddir)/src/intel/genxml \ -I$(top_builddir)/src/vulkan libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): svga: unbind index buffer when drawing non-indexed primitives
Module: Mesa Branch: master Commit: 9de3b0273d4fc01f5fdb5e9c9301a42575694d88 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9de3b0273d4fc01f5fdb5e9c9301a42575694d88 Author: Brian Paul Date: Mon Feb 22 08:53:47 2016 -0700 svga: unbind index buffer when drawing non-indexed primitives Silences a warning reported by the svga3d device. v2: also null-out the index buffer pointer Reviewed-by: Sinclair Yeh Reviewed-by: Charmaine Lee --- src/gallium/drivers/svga/svga_draw.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c index 80526ed..fe6cf71 100644 --- a/src/gallium/drivers/svga/svga_draw.c +++ b/src/gallium/drivers/svga/svga_draw.c @@ -590,6 +590,16 @@ draw_vgpu10(struct svga_hwtnl *hwtnl, } else { /* non-indexed drawing */ + if (svga->state.hw_draw.ib_format != SVGA3D_FORMAT_INVALID) { + /* Unbind previously bound index buffer */ + ret = SVGA3D_vgpu10_SetIndexBuffer(svga->swc, NULL, +SVGA3D_FORMAT_INVALID, 0); + if (ret != PIPE_OK) +return ret; + svga->state.hw_draw.ib_format = SVGA3D_FORMAT_INVALID; + svga->state.hw_draw.ib = NULL; + } + if (instance_count > 1) { ret = SVGA3D_vgpu10_DrawInstanced(svga->swc, vcount, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0: rename nvc0_context::dirty to nvc0_context::dirty_3d
Module: Mesa Branch: master Commit: 5330ed959e8e047495191ebe1a72dd54347cc004 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5330ed959e8e047495191ebe1a72dd54347cc004 Author: Samuel Pitoiset Date: Sun Feb 21 11:06:27 2016 +0100 nvc0: rename nvc0_context::dirty to nvc0_context::dirty_3d Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 16 +++ src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 2 +- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 56 +++--- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 24 +- src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 14 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 8 ++-- 8 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index c07f186..26304ad 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -239,7 +239,7 @@ nvc0_compute_validate_driverconst(struct nvc0_context *nvc0) BEGIN_NVC0(push, NVC0_COMPUTE(CB_BIND), 1); PUSH_DATA (push, (15 << 8) | 1); - nvc0->dirty |= NVC0_NEW_DRIVERCONST; + nvc0->dirty_3d |= NVC0_NEW_DRIVERCONST; } static void @@ -403,7 +403,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) } /* Invalidate all 3D constbufs because they are aliased with COMPUTE. */ - nvc0->dirty |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; for (s = 0; s < 5; s++) { nvc0->constbuf_dirty[s] |= nvc0->constbuf_valid[s]; nvc0->state.uniform_buffer_bound[s] = 0; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 66e7f95..16c0835 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -194,7 +194,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, for (i = 0; i < nvc0->framebuffer.nr_cbufs; ++i) { if (nvc0->framebuffer.cbufs[i] && nvc0->framebuffer.cbufs[i]->texture == res) { -nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; +nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -204,7 +204,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->bind & PIPE_BIND_DEPTH_STENCIL) { if (nvc0->framebuffer.zsbuf && nvc0->framebuffer.zsbuf->texture == res) { - nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; + nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -214,7 +214,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->target == PIPE_BUFFER) { for (i = 0; i < nvc0->num_vtxbufs; ++i) { if (nvc0->vtxbuf[i].buffer == res) { -nvc0->dirty |= NVC0_NEW_ARRAYS; +nvc0->dirty_3d |= NVC0_NEW_ARRAYS; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); if (!--ref) return ref; @@ -222,7 +222,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, } if (nvc0->idxbuf.buffer == res) { - nvc0->dirty |= NVC0_NEW_IDXBUF; + nvc0->dirty_3d |= NVC0_NEW_IDXBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); if (!--ref) return ref; @@ -233,7 +233,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->textures[s][i] && nvc0->textures[s][i]->texture == res) { nvc0->textures_dirty[s] |= 1 << i; -nvc0->dirty |= NVC0_NEW_TEXTURES; +nvc0->dirty_3d |= NVC0_NEW_TEXTURES; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); if (!--ref) return ref; @@ -252,7 +252,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_CB(i)); } else { - nvc0->dirty |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); } if (!--ref) @@ -269,7 +269,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_BUFFERS; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_BUF); } else { - nvc0->dirty |= NVC0_NEW_BUFFERS; + nvc0->dirty_3d |= NVC0_NEW_BUFFE
Mesa (master): nv50/ir: restore OP_SELP to be a regular instruction
Module: Mesa Branch: master Commit: 6526225f888a08b301e8c39ec70b4e739081e490 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6526225f888a08b301e8c39ec70b4e739081e490 Author: Samuel Pitoiset Date: Sun Feb 21 19:40:01 2016 +0100 nv50/ir: restore OP_SELP to be a regular instruction Actually OP_SELP doesn't need to be a compare instruction. Instead we just need to set the NOT modifier when building the instruction. While we are at it, fix the dst register type and use a GPR. Suggested by Ilia Mirkin. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp| 8 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 8 src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h | 4 ++-- src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 8 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp index 8268e08..a78b3f9 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -112,7 +112,7 @@ private: void emitSET(const CmpInstruction *); void emitSLCT(const CmpInstruction *); - void emitSELP(const CmpInstruction *); + void emitSELP(const Instruction *); void emitTEXBAR(const Instruction *); void emitTEX(const TexInstruction *); @@ -1045,11 +1045,11 @@ CodeEmitterGK110::emitSLCT(const CmpInstruction *i) } } -void CodeEmitterGK110::emitSELP(const CmpInstruction *i) +void CodeEmitterGK110::emitSELP(const Instruction *i) { emitForm_21(i, 0x250, 0x050); - if ((i->setCond == CC_NOT_P) ^ (bool)(i->src(2).mod & Modifier(NV50_IR_MOD_NOT))) + if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 13; } @@ -1937,7 +1937,7 @@ CodeEmitterGK110::emitInstruction(Instruction *insn) emitSET(insn->asCmp()); break; case OP_SELP: - emitSELP(insn->asCmp()); + emitSELP(insn); break; case OP_SLCT: emitSLCT(insn->asCmp()); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index d588d7e..65fcd64 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -120,7 +120,7 @@ private: void emitSET(const CmpInstruction *); void emitSLCT(const CmpInstruction *); - void emitSELP(const CmpInstruction *); + void emitSELP(const Instruction *); void emitTEXBAR(const Instruction *); void emitTEX(const TexInstruction *); @@ -1175,11 +1175,11 @@ CodeEmitterNVC0::emitSLCT(const CmpInstruction *i) code[0] |= 1 << 5; } -void CodeEmitterNVC0::emitSELP(const CmpInstruction *i) +void CodeEmitterNVC0::emitSELP(const Instruction *i) { emitForm_A(i, HEX64(2000, 0004)); - if (i->setCond == CC_NOT_P || i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) + if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT)) code[1] |= 1 << 20; } @@ -2438,7 +2438,7 @@ CodeEmitterNVC0::emitInstruction(Instruction *insn) emitSET(insn->asCmp()); break; case OP_SELP: - emitSELP(insn->asCmp()); + emitSELP(insn); break; case OP_SLCT: emitSLCT(insn->asCmp()); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h index 02e6157..e465f24 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_inlines.h @@ -281,14 +281,14 @@ Value *TexInstruction::getIndirectS() const CmpInstruction *Instruction::asCmp() { - if (op >= OP_SET_AND && op <= OP_SLCT) + if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) return static_cast(this); return NULL; } const CmpInstruction *Instruction::asCmp() const { - if (op >= OP_SET_AND && op <= OP_SLCT) + if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP) return static_cast(this); return NULL; } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 21a6f1e..d181f15 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -1067,10 +1067,10 @@ NVC0LoweringPass::handleSharedATOM(Instruction *atom) TYPE_U32, ld->getDef(0), atom->getSrc(1)); set->setPredicate(CC_P, ld->getDef(1)); - CmpInstruction *selp = - bld.mkCmp(OP_SELP, CC_NOT_P, TYPE_U32, bld.getSSA(4, FILE_ADDRESS), - TYPE_U32, ld->getDef(0), atom->getSrc(2), - set->getDef(0)); + Instruction *selp = + bld.mkOp3(OP_SELP, TYPE_U32, bld.getSSA(), ld->getDef(0), +
Mesa (master): nvc0: prefix compute macros with _CP_ instead of _COMPUTE_
Module: Mesa Branch: master Commit: 2c48369f54e5ed68445e4a614fc51aff1e7bb941 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c48369f54e5ed68445e4a614fc51aff1e7bb941 Author: Samuel Pitoiset Date: Sun Feb 21 11:15:43 2016 +0100 nvc0: prefix compute macros with _CP_ instead of _COMPUTE_ Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_macros.h | 2 +- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme index a3f1bde..a9233ad 100644 --- a/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme +++ b/src/gallium/drivers/nouveau/nvc0/mme/com90c0.mme @@ -1,4 +1,4 @@ -/* NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT +/* NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT * * arg = num_groups_x * parm[0] = num_groups_y diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 3f7a7d3..112f1c4 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -376,7 +376,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) if (unlikely(info->indirect)) { struct nv04_resource *res = nv04_resource(info->indirect); uint32_t offset = res->offset + info->indirect_offset; - unsigned macro = NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT; + unsigned macro = NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT; nouveau_pushbuf_space(push, 16, 0, 1); PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h b/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h index 57262fe..eeacc71 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_macros.h @@ -35,6 +35,6 @@ #define NVC0_3D_MACRO_QUERY_BUFFER_WRITE 0x3858 -#define NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT 0x3860 +#define NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT 0x3860 #endif /* __NVC0_MACROS_H__ */ diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index 1730a1b..998e9ea 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -1077,7 +1077,7 @@ nvc0_screen_create(struct nouveau_device *dev) MK_MACRO(NVC0_3D_MACRO_DRAW_ARRAYS_INDIRECT_COUNT, mme9097_draw_arrays_indirect_count); MK_MACRO(NVC0_3D_MACRO_DRAW_ELEMENTS_INDIRECT_COUNT, mme9097_draw_elts_indirect_count); MK_MACRO(NVC0_3D_MACRO_QUERY_BUFFER_WRITE, mme9097_query_buffer_write); - MK_MACRO(NVC0_COMPUTE_MACRO_LAUNCH_GRID_INDIRECT, mme90c0_launch_grid_indirect); + MK_MACRO(NVC0_CP_MACRO_LAUNCH_GRID_INDIRECT, mme90c0_launch_grid_indirect); BEGIN_NVC0(push, NVC0_3D(RASTERIZE_ENABLE), 1); PUSH_DATA (push, 1); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0/ir: add ld lock/st unlock emission on GK104
Module: Mesa Branch: master Commit: 9f0d059d4bab97e334fb3fecc24a1421b562d9e5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f0d059d4bab97e334fb3fecc24a1421b562d9e5 Author: Samuel Pitoiset Date: Sun Feb 21 15:28:16 2016 +0100 nvc0/ir: add ld lock/st unlock emission on GK104 Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 35 +++--- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index 65fcd64..e89b129 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -1779,11 +1779,14 @@ CodeEmitterNVC0::emitSTORE(const Instruction *i) case FILE_MEMORY_GLOBAL: opc = 0x9000; break; case FILE_MEMORY_LOCAL: opc = 0xc800; break; case FILE_MEMORY_SHARED: - opc = 0xc800; - if (i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) - opc |= (1 << 26); - else - opc |= (1 << 24); + if (i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) { + if (targ->getChipset() >= NVISA_GK104_CHIPSET) +opc = 0xb800; + else +opc = 0xcc00; + } else { + opc = 0xc900; + } break; default: assert(!"invalid memory file"); @@ -1793,6 +1796,15 @@ CodeEmitterNVC0::emitSTORE(const Instruction *i) code[0] = 0x0005; code[1] = opc; + if (targ->getChipset() >= NVISA_GK104_CHIPSET) { + // Unlocked store on shared memory can fail. + if (i->src(0).getFile() == FILE_MEMORY_SHARED && + i->subOp == NV50_IR_SUBOP_STORE_UNLOCKED) { + assert(i->defExists(0)); + defId(i->def(0), 8); + } + } + setAddressByFile(i->src(0)); srcId(i->src(1), 14); srcId(i->src(0).getIndirect(0), 20); @@ -1816,11 +1828,14 @@ CodeEmitterNVC0::emitLOAD(const Instruction *i) case FILE_MEMORY_GLOBAL: opc = 0x8000; break; case FILE_MEMORY_LOCAL: opc = 0xc000; break; case FILE_MEMORY_SHARED: - opc = 0xc000; - if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) - opc |= (1 << 26); - else - opc |= (1 << 24); + if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) { + if (targ->getChipset() >= NVISA_GK104_CHIPSET) +opc = 0xa800; + else +opc = 0xc400; + } else { + opc = 0xc100; + } break; case FILE_MEMORY_CONST: if (!i->src(0).isIndirect(0) && typeSizeof(i->dType) == 4) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0/ir: add missing emission of locked load predicate
Module: Mesa Branch: master Commit: 84b9b8f0a395a26984980bb465b06ba08f55a1c6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=84b9b8f0a395a26984980bb465b06ba08f55a1c6 Author: Samuel Pitoiset Date: Mon Feb 22 21:11:33 2016 +0100 nvc0/ir: add missing emission of locked load predicate Like unlocked store on shared memory, locked store can fail and the second dest which is a predicate must be emitted. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin Cc: mesa-sta...@lists.freedesktop.org --- src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index e89b129..0068da5 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -1852,6 +1852,13 @@ CodeEmitterNVC0::emitLOAD(const Instruction *i) } code[1] = opc; + if (i->src(0).getFile() == FILE_MEMORY_SHARED) { + if (i->subOp == NV50_IR_SUBOP_LOAD_LOCKED) { + assert(i->defExists(1)); + defId(i->def(1), 32 + 18); + } + } + defId(i->def(0), 14); setAddressByFile(i->src(0)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): nvc0: rename NVXX_COMPUTE to NVXX_CP
Module: Mesa Branch: master Commit: bbff97ae3918f0dd89d461b1eb51c53829befda1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbff97ae3918f0dd89d461b1eb51c53829befda1 Author: Samuel Pitoiset Date: Sun Feb 21 11:13:01 2016 +0100 nvc0: rename NVXX_COMPUTE to NVXX_CP Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 96 ++--- .../drivers/nouveau/nvc0/nvc0_query_hw_sm.c| 28 +++ src/gallium/drivers/nouveau/nvc0/nvc0_tex.c| 6 +- src/gallium/drivers/nouveau/nvc0/nvc0_winsys.h | 6 +- src/gallium/drivers/nouveau/nvc0/nve4_compute.c| 98 +++--- 5 files changed, 117 insertions(+), 117 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 26304ad..3f7a7d3 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -59,60 +59,60 @@ nvc0_screen_compute_setup(struct nvc0_screen *screen, if (ret) return ret; - BEGIN_NVC0(push, SUBC_COMPUTE(NV01_SUBCHAN_OBJECT), 1); + BEGIN_NVC0(push, SUBC_CP(NV01_SUBCHAN_OBJECT), 1); PUSH_DATA (push, screen->compute->oclass); /* hardware limit */ - BEGIN_NVC0(push, NVC0_COMPUTE(MP_LIMIT), 1); + BEGIN_NVC0(push, NVC0_CP(MP_LIMIT), 1); PUSH_DATA (push, screen->mp_count); - BEGIN_NVC0(push, NVC0_COMPUTE(CALL_LIMIT_LOG), 1); + BEGIN_NVC0(push, NVC0_CP(CALL_LIMIT_LOG), 1); PUSH_DATA (push, 0xf); - BEGIN_NVC0(push, SUBC_COMPUTE(0x02a0), 1); + BEGIN_NVC0(push, SUBC_CP(0x02a0), 1); PUSH_DATA (push, 0x8000); /* global memory setup */ - BEGIN_NVC0(push, SUBC_COMPUTE(0x02c4), 1); + BEGIN_NVC0(push, SUBC_CP(0x02c4), 1); PUSH_DATA (push, 0); - BEGIN_NIC0(push, NVC0_COMPUTE(GLOBAL_BASE), 0x100); + BEGIN_NIC0(push, NVC0_CP(GLOBAL_BASE), 0x100); for (i = 0; i <= 0xff; i++) PUSH_DATA (push, (0xc << 28) | (i << 16) | i); - BEGIN_NVC0(push, SUBC_COMPUTE(0x02c4), 1); + BEGIN_NVC0(push, SUBC_CP(0x02c4), 1); PUSH_DATA (push, 1); /* local memory and cstack setup */ - BEGIN_NVC0(push, NVC0_COMPUTE(TEMP_ADDRESS_HIGH), 2); + BEGIN_NVC0(push, NVC0_CP(TEMP_ADDRESS_HIGH), 2); PUSH_DATAh(push, screen->tls->offset); PUSH_DATA (push, screen->tls->offset); - BEGIN_NVC0(push, NVC0_COMPUTE(TEMP_SIZE_HIGH), 2); + BEGIN_NVC0(push, NVC0_CP(TEMP_SIZE_HIGH), 2); PUSH_DATAh(push, screen->tls->size); PUSH_DATA (push, screen->tls->size); - BEGIN_NVC0(push, NVC0_COMPUTE(WARP_TEMP_ALLOC), 1); + BEGIN_NVC0(push, NVC0_CP(WARP_TEMP_ALLOC), 1); PUSH_DATA (push, 0); - BEGIN_NVC0(push, NVC0_COMPUTE(LOCAL_BASE), 1); + BEGIN_NVC0(push, NVC0_CP(LOCAL_BASE), 1); PUSH_DATA (push, 0xff << 24); /* shared memory setup */ - BEGIN_NVC0(push, NVC0_COMPUTE(CACHE_SPLIT), 1); + BEGIN_NVC0(push, NVC0_CP(CACHE_SPLIT), 1); PUSH_DATA (push, NVC0_COMPUTE_CACHE_SPLIT_48K_SHARED_16K_L1); - BEGIN_NVC0(push, NVC0_COMPUTE(SHARED_BASE), 1); + BEGIN_NVC0(push, NVC0_CP(SHARED_BASE), 1); PUSH_DATA (push, 0xfe << 24); - BEGIN_NVC0(push, NVC0_COMPUTE(SHARED_SIZE), 1); + BEGIN_NVC0(push, NVC0_CP(SHARED_SIZE), 1); PUSH_DATA (push, 0); /* code segment setup */ - BEGIN_NVC0(push, NVC0_COMPUTE(CODE_ADDRESS_HIGH), 2); + BEGIN_NVC0(push, NVC0_CP(CODE_ADDRESS_HIGH), 2); PUSH_DATAh(push, screen->text->offset); PUSH_DATA (push, screen->text->offset); /* textures */ - BEGIN_NVC0(push, NVC0_COMPUTE(TIC_ADDRESS_HIGH), 3); + BEGIN_NVC0(push, NVC0_CP(TIC_ADDRESS_HIGH), 3); PUSH_DATAh(push, screen->txc->offset); PUSH_DATA (push, screen->txc->offset); PUSH_DATA (push, NVC0_TIC_MAX_ENTRIES - 1); /* samplers */ - BEGIN_NVC0(push, NVC0_COMPUTE(TSC_ADDRESS_HIGH), 3); + BEGIN_NVC0(push, NVC0_CP(TSC_ADDRESS_HIGH), 3); PUSH_DATAh(push, screen->txc->offset + 65536); PUSH_DATA (push, screen->txc->offset + 65536); PUSH_DATA (push, NVC0_TSC_MAX_ENTRIES - 1); @@ -140,7 +140,7 @@ nvc0_compute_validate_program(struct nvc0_context *nvc0) if (likely(prog->code_size)) { if (nvc0_program_upload_code(nvc0, prog)) { struct nouveau_pushbuf *push = nvc0->base.pushbuf; - BEGIN_NVC0(push, NVC0_COMPUTE(FLUSH), 1); + BEGIN_NVC0(push, NVC0_CP(FLUSH), 1); PUSH_DATA (push, NVC0_COMPUTE_FLUSH_CODE); return true; } @@ -153,7 +153,7 @@ nvc0_compute_validate_samplers(struct nvc0_context *nvc0) { bool need_flush = nvc0_validate_tsc(nvc0, 5); if (need_flush) { - BEGIN_NVC0(nvc0->base.pushbuf, NVC0_COMPUTE(TSC_FLUSH), 1); + BEGIN_NVC0(nvc0->base.pushbuf, NVC0_CP(TSC_FLUSH), 1); PUSH_DATA (nvc0->base.pushbuf, 0); } } @@ -163,7 +163,7 @@ nvc0_compute_validate_textures(struct nvc0_context *nvc0) { bool need_flush = nvc0_validate_tic(nvc0, 5); if (need_flush) { - BEGIN_NVC0(nvc0->base.pushbuf, NVC0_COMPUTE(TIC_FLUS
Mesa (master): nvc0: rename 3d binding points to NVC0_BIND_3D_XXX
Module: Mesa Branch: master Commit: 2999257e0fe703f73d32620fed88040d29ac5bac URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2999257e0fe703f73d32620fed88040d29ac5bac Author: Samuel Pitoiset Date: Sun Feb 21 11:58:35 2016 +0100 nvc0: rename 3d binding points to NVC0_BIND_3D_XXX Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 26 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 24 ++-- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 8 +++ src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 18 +++ .../drivers/nouveau/nvc0/nvc0_state_validate.c | 10 - src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 17 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_tex.c| 4 ++-- src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 14 ++-- .../drivers/nouveau/nvc0/nvc0_vbo_translate.c | 6 ++--- 9 files changed, 64 insertions(+), 63 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 9860e2d..007cccf 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -195,7 +195,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->framebuffer.cbufs[i] && nvc0->framebuffer.cbufs[i]->texture == res) { nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; -nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); +nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_FB); if (!--ref) return ref; } @@ -205,7 +205,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->framebuffer.zsbuf && nvc0->framebuffer.zsbuf->texture == res) { nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_FB); if (!--ref) return ref; } @@ -215,7 +215,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, for (i = 0; i < nvc0->num_vtxbufs; ++i) { if (nvc0->vtxbuf[i].buffer == res) { nvc0->dirty_3d |= NVC0_NEW_3D_ARRAYS; -nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); +nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_VTX); if (!--ref) return ref; } @@ -223,7 +223,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->idxbuf.buffer == res) { nvc0->dirty_3d |= NVC0_NEW_3D_IDXBUF; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_IDX); if (!--ref) return ref; } @@ -234,7 +234,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->textures[s][i]->texture == res) { nvc0->textures_dirty[s] |= 1 << i; nvc0->dirty_3d |= NVC0_NEW_3D_TEXTURES; -nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); +nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEX(s, i)); if (!--ref) return ref; } @@ -253,7 +253,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_CB(i)); } else { nvc0->dirty_3d |= NVC0_NEW_3D_CONSTBUF; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_CB(s, i)); } if (!--ref) return ref; @@ -270,7 +270,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_BUF); } else { nvc0->dirty_3d |= NVC0_NEW_3D_BUFFERS; - nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_BUF); + nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_BUF); } if (!--ref) return ref; @@ -357,7 +357,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) /* Do not bind the COMPUTE driver constbuf at screen initialization because * CBs are aliased between 3D and COMPUTE, but make sure it will be bound if * a grid is launched later. */ - nvc0->dirty_cp |= NVC0_NEW_3D_DRIVERCONST; + nvc0->dirty_cp |= NVC0_NEW_CP_DRIVERCONST; /* now that there are no more opportunities for errors, set the current * context if there isn't already one. @@ -373,9 +373,9 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) flags = NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_RD; - BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, fla
Mesa (master): nvc0: rename 3d dirty flags to NVC0_NEW_3D_XXX
Module: Mesa Branch: master Commit: 9c6a7bfb4060264f02830d6ca5e56511546e7078 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c6a7bfb4060264f02830d6ca5e56511546e7078 Author: Samuel Pitoiset Date: Sun Feb 21 11:49:25 2016 +0100 nvc0: rename 3d dirty flags to NVC0_NEW_3D_XXX Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c| 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_context.c| 18 ++--- src/gallium/drivers/nouveau/nvc0/nvc0_context.h| 58 +++--- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 4 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 56 +++--- .../drivers/nouveau/nvc0/nvc0_state_validate.c | 88 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_surface.c| 30 src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c| 8 +- 8 files changed, 133 insertions(+), 133 deletions(-) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index 112f1c4..0f1265f 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -239,7 +239,7 @@ nvc0_compute_validate_driverconst(struct nvc0_context *nvc0) BEGIN_NVC0(push, NVC0_CP(CB_BIND), 1); PUSH_DATA (push, (15 << 8) | 1); - nvc0->dirty_3d |= NVC0_NEW_DRIVERCONST; + nvc0->dirty_3d |= NVC0_NEW_3D_DRIVERCONST; } static void @@ -403,7 +403,7 @@ nvc0_launch_grid(struct pipe_context *pipe, const struct pipe_grid_info *info) } /* Invalidate all 3D constbufs because they are aliased with COMPUTE. */ - nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_3D_CONSTBUF; for (s = 0; s < 5; s++) { nvc0->constbuf_dirty[s] |= nvc0->constbuf_valid[s]; nvc0->state.uniform_buffer_bound[s] = 0; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index 16c0835..9860e2d 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -194,7 +194,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, for (i = 0; i < nvc0->framebuffer.nr_cbufs; ++i) { if (nvc0->framebuffer.cbufs[i] && nvc0->framebuffer.cbufs[i]->texture == res) { -nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; +nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -204,7 +204,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->bind & PIPE_BIND_DEPTH_STENCIL) { if (nvc0->framebuffer.zsbuf && nvc0->framebuffer.zsbuf->texture == res) { - nvc0->dirty_3d |= NVC0_NEW_FRAMEBUFFER; + nvc0->dirty_3d |= NVC0_NEW_3D_FRAMEBUFFER; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); if (!--ref) return ref; @@ -214,7 +214,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (res->target == PIPE_BUFFER) { for (i = 0; i < nvc0->num_vtxbufs; ++i) { if (nvc0->vtxbuf[i].buffer == res) { -nvc0->dirty_3d |= NVC0_NEW_ARRAYS; +nvc0->dirty_3d |= NVC0_NEW_3D_ARRAYS; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); if (!--ref) return ref; @@ -222,7 +222,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, } if (nvc0->idxbuf.buffer == res) { - nvc0->dirty_3d |= NVC0_NEW_IDXBUF; + nvc0->dirty_3d |= NVC0_NEW_3D_IDXBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); if (!--ref) return ref; @@ -233,7 +233,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, if (nvc0->textures[s][i] && nvc0->textures[s][i]->texture == res) { nvc0->textures_dirty[s] |= 1 << i; -nvc0->dirty_3d |= NVC0_NEW_TEXTURES; +nvc0->dirty_3d |= NVC0_NEW_3D_TEXTURES; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); if (!--ref) return ref; @@ -252,7 +252,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_CB(i)); } else { - nvc0->dirty_3d |= NVC0_NEW_CONSTBUF; + nvc0->dirty_3d |= NVC0_NEW_3D_CONSTBUF; nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); } if (!--ref) @@ -269,7 +269,7 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx, nvc0->dirty_cp |= NVC0_NEW_CP_BUFFERS; nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_BUF); } else { - nvc0->dirty_3d |= NVC0_NEW_BUFFERS
Mesa (vulkan): anv/x11: Free swapchain images and memory on destroy
Module: Mesa Branch: vulkan Commit: 353d5bf286e1509af9ec2f1b8152d1f64790b52c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=353d5bf286e1509af9ec2f1b8152d1f64790b52c Author: Kristian Høgsberg Kristensen Date: Mon Feb 22 10:19:43 2016 -0800 anv/x11: Free swapchain images and memory on destroy --- src/intel/vulkan/anv_wsi_x11.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c index 843a6b6..a63cb6e 100644 --- a/src/intel/vulkan/anv_wsi_x11.c +++ b/src/intel/vulkan/anv_wsi_x11.c @@ -535,7 +535,11 @@ x11_swapchain_destroy(struct anv_swapchain *anv_chain, cookie = xcb_free_pixmap(chain->conn, image->pixmap); xcb_discard_reply(chain->conn, cookie.sequence); - /* TODO: Delete images and free memory */ + anv_DestroyImage(anv_device_to_handle(chain->base.device), + anv_image_to_handle(image->image), pAllocator); + + anv_FreeMemory(anv_device_to_handle(chain->base.device), + anv_device_memory_to_handle(image->memory), pAllocator); } anv_free2(&chain->base.device->alloc, pAllocator, chain); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (vulkan): anv: Implement descriptor pools
Module: Mesa Branch: vulkan Commit: 2570a58bcdf30d699b89323fef60692093dee7ea URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2570a58bcdf30d699b89323fef60692093dee7ea Author: Kristian Høgsberg Kristensen Date: Thu Feb 11 22:46:28 2016 -0800 anv: Implement descriptor pools Descriptor pools are an optimization that lets applications allocate descriptor sets through an externally synchronized object (that is, unlocked). In our case it's also plugging a memory leak, since we didn't track all allocated sets and failed to free them in vkResetDescriptorPool() and vkDestroyDescriptorPool(). --- src/intel/vulkan/anv_descriptor_set.c | 189 +++--- src/intel/vulkan/anv_meta.c | 25 + src/intel/vulkan/anv_meta_blit.c | 6 +- src/intel/vulkan/anv_meta_resolve.c | 8 +- src/intel/vulkan/anv_private.h| 17 +++ 5 files changed, 200 insertions(+), 45 deletions(-) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 7a77336..718bc21 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -244,17 +244,67 @@ void anv_DestroyPipelineLayout( } /* - * Descriptor pools. These are a no-op for now. + * Descriptor pools. + * + * These are implemented using a big pool of memory and a free-list for the + * host memory allocations and a state_stream and a free list for the buffer + * view surface state. The spec allows us to fail to allocate due to + * fragmentation in all cases but two: 1) after pool reset, allocating up + * until the pool size with no freeing must succeed and 2) allocating and + * freeing only descriptor sets with the same layout. Case 1) is easy enogh, + * and the free lists lets us recycle blocks for case 2). */ +#define EMPTY 1 + VkResult anv_CreateDescriptorPool( -VkDevicedevice, +VkDevice_device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks*pAllocator, VkDescriptorPool* pDescriptorPool) { - anv_finishme("VkDescriptorPool is a stub"); - *pDescriptorPool = (VkDescriptorPool)1; + ANV_FROM_HANDLE(anv_device, device, _device); + struct anv_descriptor_pool *pool; + + uint32_t descriptor_count = 0; + uint32_t buffer_count = 0; + for (uint32_t i = 0; i < pCreateInfo->poolSizeCount; i++) { + switch (pCreateInfo->pPoolSizes[i].type) { + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + buffer_count += pCreateInfo->pPoolSizes[i].descriptorCount; + default: + descriptor_count += pCreateInfo->pPoolSizes[i].descriptorCount; + break; + } + } + + const size_t set_size = + sizeof(struct anv_descriptor_set) + + descriptor_count * sizeof(struct anv_descriptor) + + buffer_count * sizeof(struct anv_buffer_view); + + const size_t size = + sizeof(*pool) + + pCreateInfo->maxSets * set_size; + + pool = anv_alloc2(&device->alloc, pAllocator, size, 8, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + if (!pool) + return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); + + pool->size = size; + pool->next = 0; + pool->free_list = EMPTY; + + anv_state_stream_init(&pool->surface_state_stream, + &device->surface_state_block_pool); + pool->surface_state_free_list = NULL; + + *pDescriptorPool = anv_descriptor_pool_to_handle(pool); + return VK_SUCCESS; } @@ -263,37 +313,85 @@ void anv_DestroyDescriptorPool( VkDescriptorPool_pool, const VkAllocationCallbacks*pAllocator) { - anv_finishme("VkDescriptorPool is a stub: free the pool's descriptor sets"); + ANV_FROM_HANDLE(anv_device, device, _device); + ANV_FROM_HANDLE(anv_descriptor_pool, pool, _pool); + + anv_state_stream_finish(&pool->surface_state_stream); + anv_free2(&device->alloc, pAllocator, pool); } VkResult anv_ResetDescriptorPool( -VkDevicedevice, +VkDevice_device, VkDescriptorPooldescriptorPool, VkDescriptorPoolResetFlags flags) { - anv_finishme("VkDescriptorPool is a stub: free the pool's descriptor sets"); + ANV_FROM_HANDLE(anv_device, device, _device); + ANV_FROM_HANDLE(anv_descriptor_pool, pool, descriptorPool); + + pool->next = 0; + pool->free_list = EMPTY; + anv_state_stream_finish(&pool->surface_state_stream); + anv_state_stream_init(&pool->surface_state_stream, + &device->surface_state_block_pool); + pool->surface_state_free_list = NULL; + return VK_SUCCESS; } +struct pool_free_list_entry { + uint3
Mesa (vulkan): anv/descriptor_set: Stop marking everything as having dynamic offsets
Module: Mesa Branch: vulkan Commit: 442dff8cf4c99d67e7258e376d38ec32b92a2fbf URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=442dff8cf4c99d67e7258e376d38ec32b92a2fbf Author: Jason Ekstrand Date: Mon Feb 22 17:13:46 2016 -0800 anv/descriptor_set: Stop marking everything as having dynamic offsets --- src/intel/vulkan/anv_descriptor_set.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 718bc21..b439f2a 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -218,8 +218,10 @@ VkResult anv_CreatePipelineLayout( layout->set[set].dynamic_offset_start = dynamic_offset_count; for (uint32_t b = 0; b < set_layout->binding_count; b++) { - if (set_layout->binding[b].dynamic_offset_index >= 0) -dynamic_offset_count += set_layout->binding[b].array_size; + if (set_layout->binding[b].dynamic_offset_index < 0) +continue; + + dynamic_offset_count += set_layout->binding[b].array_size; for (gl_shader_stage s = 0; s < MESA_SHADER_STAGES; s++) { if (set_layout->binding[b].stage[s].surface_index >= 0) layout->stage[s].has_dynamic_offsets = true; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (vulkan): anv/state: Replace a bunch of ANV_GEN with GEN_GEN
Module: Mesa Branch: vulkan Commit: ae619a035573a2d13fb49537ef8769c97688e77f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae619a035573a2d13fb49537ef8769c97688e77f Author: Jason Ekstrand Date: Mon Feb 22 19:19:00 2016 -0800 anv/state: Replace a bunch of ANV_GEN with GEN_GEN --- src/intel/vulkan/gen8_state.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/gen8_state.c b/src/intel/vulkan/gen8_state.c index fdde705..2686bfa 100644 --- a/src/intel/vulkan/gen8_state.c +++ b/src/intel/vulkan/gen8_state.c @@ -44,7 +44,7 @@ genX(init_device_state)(struct anv_device *device) batch.end = (void *) cmds + sizeof(cmds); anv_batch_emit(&batch, GENX(PIPELINE_SELECT), -#if ANV_GEN >= 9 +#if GEN_GEN >= 9 .MaskBits = 3, #endif .PipelineSelection = _3D); @@ -93,7 +93,7 @@ genX(init_device_state)(struct anv_device *device) ._8xSample6YOffset = 0.9375, ._8xSample7XOffset = 0.9375, ._8xSample7YOffset = 0.0625, -#if ANV_GEN >= 9 +#if GEN_GEN >= 9 ._16xSample0XOffset = 0.5625, ._16xSample0YOffset = 0.5625, ._16xSample1XOffset = 0.4375, @@ -194,7 +194,7 @@ static const uint8_t anv_valign[] = { static void get_halign_valign(const struct isl_surf *surf, uint32_t *halign, uint32_t *valign) { - #if ANV_GENx10 >= 90 + #if GEN_GEN >= 9 if (isl_tiling_is_std_y(surf->tiling) || surf->dim_layout == ISL_DIM_LAYOUT_GEN9_1D) { /* The hardware ignores the alignment values. Anyway, the surface's @@ -239,7 +239,7 @@ get_qpitch(const struct isl_surf *surf) default: unreachable(!"bad isl_surf_dim"); case ISL_SURF_DIM_1D: - #if ANV_GENx10 >= 90 + #if GEN_GEN >= 9 /* QPitch is usually expressed as rows of surface elements (where * a surface element is an compression block or a single surface * sample). Skylake 1D is an outlier. @@ -256,7 +256,7 @@ get_qpitch(const struct isl_surf *surf) #endif case ISL_SURF_DIM_2D: case ISL_SURF_DIM_3D: - #if ANV_GEN >= 9 + #if GEN_GEN >= 9 return isl_surf_get_array_pitch_el_rows(surf); #else /* From the Broadwell PRM for RENDER_SURFACE_STATE.QPitch @@ -452,7 +452,7 @@ VkResult genX(CreateSampler)( .SamplerDisable = false, .TextureBorderColorMode = DX10OGL, .LODPreClampMode = CLAMP_MODE_OGL, -#if ANV_GEN == 8 +#if GEN_GEN == 8 .BaseMipLevel = 0.0, #endif .MipModeFilter = vk_to_gen_mipmap_mode[pCreateInfo->mipmapMode], ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl: Add usual extension boilerplate for OES_shader_image_atomic.
Module: Mesa Branch: master Commit: be125af95ece0f24ca09fefeda6b5ab84478212b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=be125af95ece0f24ca09fefeda6b5ab84478212b Author: Francisco Jerez Date: Mon Feb 22 15:06:45 2016 -0800 glsl: Add usual extension boilerplate for OES_shader_image_atomic. v2: No need for extension enable bits (Ilia). Reviewed-by: Ilia Mirkin --- src/compiler/glsl/glcpp/glcpp-parse.y| 3 +++ src/compiler/glsl/glsl_parser_extras.cpp | 1 + src/compiler/glsl/glsl_parser_extras.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y index 70951a0..b03e191 100644 --- a/src/compiler/glsl/glcpp/glcpp-parse.y +++ b/src/compiler/glsl/glcpp/glcpp-parse.y @@ -2391,6 +2391,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio add_builtin_define(parser, "GL_EXT_blend_func_extended", 1); if (version >= 310) { + if (extensions->ARB_shader_image_load_store) +add_builtin_define(parser, "GL_OES_shader_image_atomic", 1); + if (extensions->OES_geometry_shader) { add_builtin_define(parser, "GL_OES_geometry_point_size", 1); add_builtin_define(parser, "GL_OES_geometry_shader", 1); diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index fbac836..ec180c0 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -606,6 +606,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(OES_EGL_image_external, false, true, OES_EGL_image_external), EXT(OES_geometry_point_size,false, true, OES_geometry_shader), EXT(OES_geometry_shader,false, true, OES_geometry_shader), + EXT(OES_shader_image_atomic,false, true, ARB_shader_image_load_store), EXT(OES_standard_derivatives, false, true, OES_standard_derivatives), EXT(OES_texture_3D, false, true, dummy_true), EXT(OES_texture_storage_multisample_2d_array, false, true, ARB_texture_multisample), diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index 5f6ca6a..86ec057 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -593,6 +593,8 @@ struct _mesa_glsl_parse_state { bool OES_geometry_point_size_warn; bool OES_geometry_shader_enable; bool OES_geometry_shader_warn; + bool OES_shader_image_atomic_enable; + bool OES_shader_image_atomic_warn; bool OES_standard_derivatives_enable; bool OES_standard_derivatives_warn; bool OES_texture_3D_enable; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965/fs: Return result of image atomic in a register of the expected type.
Module: Mesa Branch: master Commit: 058ed980c6564428c257b4e0c09a41cff9cfe8c3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=058ed980c6564428c257b4e0c09a41cff9cfe8c3 Author: Francisco Jerez Date: Mon Aug 17 01:52:19 2015 +0300 i965/fs: Return result of image atomic in a register of the expected type. So the result is of float type if we're implementing the float overload of imageAtomicExchange. This is the only back-end change required to support OES_shader_image_atomic AFAICT. Reviewed-by: Ilia Mirkin --- src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp b/src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp index 081dbad..75734d2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp @@ -1125,7 +1125,7 @@ namespace brw { if (rsize && pred) set_predicate(pred, bld.SEL(tmp, tmp, brw_imm_d(0))); - return tmp; + return retype(tmp, src0.type); } } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glsl: Implement the required built-in functions when OES_shader_image_atomic is enabled.
Module: Mesa Branch: master Commit: 81c16a2dabf9903ca85b8a27002a354e223fa7cc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=81c16a2dabf9903ca85b8a27002a354e223fa7cc Author: Francisco Jerez Date: Fri Aug 21 14:12:22 2015 +0300 glsl: Implement the required built-in functions when OES_shader_image_atomic is enabled. This is basically just the same atomic functions exposed by ARB_shader_image_load_store, with one exception: "highp float imageAtomicExchange( coherent IMAGE_PARAMS, float data);" There's no float atomic exchange overload in the original ARB_shader_image_load_store or GL 4.2, so this seems like new functionality that requires specific back-end support and a separate availability condition in the built-in function generator. v2: Move image availability predicate logic into a separate static function for clarity. Had to pull out the image_function_flags enum from the builtin_builder class for that to be possible. Reviewed-by: Ilia Mirkin --- src/compiler/glsl/builtin_functions.cpp | 61 +++-- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index f488434..bbb237a 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -448,8 +448,16 @@ shader_image_load_store(const _mesa_glsl_parse_state *state) static bool shader_image_atomic(const _mesa_glsl_parse_state *state) { - return (state->is_version(420, 0) || - state->ARB_shader_image_load_store_enable); + return (state->is_version(420, 320) || + state->ARB_shader_image_load_store_enable || + state->OES_shader_image_atomic_enable); +} + +static bool +shader_image_atomic_exchange_float(const _mesa_glsl_parse_state *state) +{ + return (state->is_version(450, 320) || + state->OES_shader_image_atomic_enable); } static bool @@ -577,17 +585,6 @@ private: unsigned num_arguments, unsigned flags); - enum image_function_flags { - IMAGE_FUNCTION_EMIT_STUB = (1 << 0), - IMAGE_FUNCTION_RETURNS_VOID = (1 << 1), - IMAGE_FUNCTION_HAS_VECTOR_DATA_TYPE = (1 << 2), - IMAGE_FUNCTION_SUPPORTS_FLOAT_DATA_TYPE = (1 << 3), - IMAGE_FUNCTION_READ_ONLY = (1 << 4), - IMAGE_FUNCTION_WRITE_ONLY = (1 << 5), - IMAGE_FUNCTION_AVAIL_ATOMIC = (1 << 6), - IMAGE_FUNCTION_MS_ONLY = (1 << 7), - }; - /** * Create a new image built-in function for all known image types. * \p flags is a bitfield of \c image_function_flags flags. @@ -836,6 +833,18 @@ private: /** @} */ }; +enum image_function_flags { + IMAGE_FUNCTION_EMIT_STUB = (1 << 0), + IMAGE_FUNCTION_RETURNS_VOID = (1 << 1), + IMAGE_FUNCTION_HAS_VECTOR_DATA_TYPE = (1 << 2), + IMAGE_FUNCTION_SUPPORTS_FLOAT_DATA_TYPE = (1 << 3), + IMAGE_FUNCTION_READ_ONLY = (1 << 4), + IMAGE_FUNCTION_WRITE_ONLY = (1 << 5), + IMAGE_FUNCTION_AVAIL_ATOMIC = (1 << 6), + IMAGE_FUNCTION_MS_ONLY = (1 << 7), + IMAGE_FUNCTION_AVAIL_ATOMIC_EXCHANGE = (1 << 8) +}; + } /* anonymous namespace */ /** @@ -2981,7 +2990,9 @@ builtin_builder::add_image_functions(bool glsl) add_image_function((glsl ? "imageAtomicExchange" : "__intrinsic_image_atomic_exchange"), "__intrinsic_image_atomic_exchange", - &builtin_builder::_image_prototype, 1, atom_flags); + &builtin_builder::_image_prototype, 1, + (flags | IMAGE_FUNCTION_AVAIL_ATOMIC_EXCHANGE | + IMAGE_FUNCTION_SUPPORTS_FLOAT_DATA_TYPE)); add_image_function((glsl ? "imageAtomicCompSwap" : "__intrinsic_image_atomic_comp_swap"), @@ -5232,6 +5243,21 @@ builtin_builder::_mid3(const glsl_type *type) return sig; } +static builtin_available_predicate +get_image_available_predicate(const glsl_type *type, unsigned flags) +{ + if ((flags & IMAGE_FUNCTION_AVAIL_ATOMIC_EXCHANGE) && + type->sampled_type == GLSL_TYPE_FLOAT) + return shader_image_atomic_exchange_float; + + else if (flags & (IMAGE_FUNCTION_AVAIL_ATOMIC_EXCHANGE | + IMAGE_FUNCTION_AVAIL_ATOMIC)) + return shader_image_atomic; + + else + return shader_image_load_store; +} + ir_function_signature * builtin_builder::_image_prototype(const glsl_type *image_type, unsigned num_arguments, @@ -5249,10 +5275,9 @@ builtin_builder::_image_prototype(const glsl_type *image_type, ir_variable *coord = in_var( glsl_type::ivec(image_type->coordinate_components()), "coord"); - const builtin_available_predicate avail = - (flags & IMAGE_FUNCTION_AVAIL_ATOMIC ? shader_image_atomic : - shader_image_load_store); -
Mesa (master): mesa: Add extension table entry for OES_shader_image_atomic.
Module: Mesa Branch: master Commit: 009bbecf6dff95c46dae4b74e2cd29c96ed4ff17 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=009bbecf6dff95c46dae4b74e2cd29c96ed4ff17 Author: Francisco Jerez Date: Mon Feb 22 15:04:37 2016 -0800 mesa: Add extension table entry for OES_shader_image_atomic. v2: No need for extension enable bits (Ilia). Reviewed-by: Ilia Mirkin --- src/mesa/main/extensions_table.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index dcbde2d..68f3617 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -326,6 +326,7 @@ EXT(OES_point_sprite, ARB_point_sprite EXT(OES_query_matrix, dummy_true , x , x , ES1, x , 2003) EXT(OES_read_format , dummy_true , GLL, GLC, ES1, x , 2003) EXT(OES_rgb8_rgba8 , dummy_true , x , x , ES1, ES2, 2005) +EXT(OES_shader_image_atomic , ARB_shader_image_load_store , x , x , x , 31, 2015) EXT(OES_single_precision, dummy_true , x , x , ES1, x , 2003) EXT(OES_standard_derivatives, OES_standard_derivatives , x , x , x , ES2, 2005) EXT(OES_stencil1, dummy_false , x , x , x , x , 2005) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): docs: Mark off GL_OES_shader_image_atomic as done.
Module: Mesa Branch: master Commit: 31a0affa280ef06261a2ed0135f72a7accc1bac6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=31a0affa280ef06261a2ed0135f72a7accc1bac6 Author: Francisco Jerez Date: Mon Feb 22 15:48:17 2016 -0800 docs: Mark off GL_OES_shader_image_atomic as done. Reviewed-by: Ilia Mirkin --- docs/GL3.txt | 2 +- docs/relnotes/11.3.0.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/GL3.txt b/docs/GL3.txt index 76f40e4..8c043e9 100644 --- a/docs/GL3.txt +++ b/docs/GL3.txt @@ -249,7 +249,7 @@ GLES3.2, GLSL ES 3.2 GL_OES_primitive_bounding boxnot started GL_OES_sample_shadingnot started (based on parts of GL_ARB_sample_shading, which is done for some drivers) GL_OES_sample_variables not started (based on parts of GL_ARB_sample_shading, which is done for some drivers) - GL_OES_shader_image_atomic not started (based on parts of GL_ARB_shader_image_load_store, which is done for some drivers) + GL_OES_shader_image_atomic DONE (all drivers that support GL_ARB_shader_image_load_store) GL_OES_shader_io_blocks not started (based on parts of GLSL 1.50, which is done) GL_OES_shader_multisample_interpolation not started (based on parts of GL_ARB_gpu_shader5, which is done) GL_OES_tessellation_shader not started (based on GL_ARB_tessellation_shader, which is done for some drivers) diff --git a/docs/relnotes/11.3.0.html b/docs/relnotes/11.3.0.html index eee4373..fa65083 100644 --- a/docs/relnotes/11.3.0.html +++ b/docs/relnotes/11.3.0.html @@ -45,6 +45,7 @@ Note: some of the new features are only available with certain drivers. GL_OES_texture_border_clamp and GL_EXT_texture_border_clamp on all drivers that support GL_ARB_texture_border_clamp +GL_OES_shader_image_atomic on all drivers that support GL_ARB_shader_image_load_store Bug fixes ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (vulkan): intel/genxml: Update macro documentation
Module: Mesa Branch: vulkan Commit: 64e1c8405920a160c0fdac47ebe4f1e1c0468d7a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=64e1c8405920a160c0fdac47ebe4f1e1c0468d7a Author: Jason Ekstrand Date: Mon Feb 22 21:20:04 2016 -0800 intel/genxml: Update macro documentation --- src/intel/genxml/gen_macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/genxml/gen_macros.h b/src/intel/genxml/gen_macros.h index 2658d03..052c57f 100644 --- a/src/intel/genxml/gen_macros.h +++ b/src/intel/genxml/gen_macros.h @@ -44,7 +44,7 @@ * * You can do pseudo-runtime checks in your function such as * - * if (ANV_GEN > 8 || ANV_IS_HASWELL) { + * if (GEN_GEN > 8 || GEN_IS_HASWELL) { *// Do something * } * @@ -54,7 +54,7 @@ * For places where you really do have a compile-time conflict, you can * use preprocessor logic: * - * #if (ANV_GEN > 8 || ANV_IS_HASWELL) + * #if (GEN_GEN > 8 || GEN_IS_HASWELL) *// Do something * #endif * ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (vulkan): anv/descriptor_set: Set descriptor type for immuatable samplers
Module: Mesa Branch: vulkan Commit: bfbb238dea91b1c2bde4f2f3eb20d39c95da3850 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bfbb238dea91b1c2bde4f2f3eb20d39c95da3850 Author: Jason Ekstrand Date: Mon Feb 22 21:39:14 2016 -0800 anv/descriptor_set: Set descriptor type for immuatable samplers --- src/intel/vulkan/anv_descriptor_set.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index b439f2a..fe105b2 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -399,8 +399,17 @@ anv_descriptor_set_create(struct anv_device *device, struct anv_descriptor *desc = set->descriptors; for (uint32_t b = 0; b < layout->binding_count; b++) { if (layout->binding[b].immutable_samplers) { - for (uint32_t i = 0; i < layout->binding[b].array_size; i++) -desc[i].sampler = layout->binding[b].immutable_samplers[i]; + for (uint32_t i = 0; i < layout->binding[b].array_size; i++) { +/* The type will get changed to COMBINED_IMAGE_SAMPLER in + * UpdateDescriptorSets if needed. However, if the descriptor + * set has an immutable sampler, UpdateDescriptorSets may never + * touch it, so we need to make sure it's 100% valid now. + */ +desc[i] = (struct anv_descriptor) { + .type = VK_DESCRIPTOR_TYPE_SAMPLER, + .sampler = layout->binding[b].immutable_samplers[i], +}; + } } desc += layout->binding[b].array_size; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit