diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-12-11 08:36:21 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-12-11 08:36:21 +0000 |
commit | 93080b6dd01e8b59ee279b0fe4eef16f75fd8570 (patch) | |
tree | 3b231219525872437e4fab728f36a6a3fc0710cf /lib | |
parent | c8a83bb2dc816ce1b4b0b54b811adc9b4b4c5eca (diff) |
Import Mesa 13.0.2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mesa/src/amd/vulkan/vk_format_layout.csv | 32 | ||||
-rw-r--r-- | lib/mesa/src/intel/common/gen_sample_positions.h | 73 | ||||
-rw-r--r-- | lib/mesa/src/intel/vulkan/anv_dump.c | 30 |
3 files changed, 27 insertions, 108 deletions
diff --git a/lib/mesa/src/amd/vulkan/vk_format_layout.csv b/lib/mesa/src/amd/vulkan/vk_format_layout.csv index 8a36144b5..ae9ceda08 100644 --- a/lib/mesa/src/amd/vulkan/vk_format_layout.csv +++ b/lib/mesa/src/amd/vulkan/vk_format_layout.csv @@ -132,18 +132,6 @@ VK_FORMAT_S8_UINT , plain, 1, 1, up8 , , , , _x__ VK_FORMAT_D16_UNORM_S8_UINT , plain, 1, 1, un16, up8 , , , xy__, zs VK_FORMAT_D24_UNORM_S8_UINT , plain, 1, 1, un24, up8 , , , xy__, zs VK_FORMAT_D32_SFLOAT_S8_UINT , plain, 1, 1, f32 , up8 , , , xy__, zs -VK_FORMAT_G8B8G8R8_422_UNORM , subsampled, 2, 1, un8, un8, un8, un8, zyx1, rgb -VK_FORMAT_B8G8R8G8_422_UNORM , subsampled, 2, 1, un8, un8, un8, un8, zyx1, rgb -VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM , multiplane, 1, 1, x8, , , , xyz1, rgb, 420, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM -VK_FORMAT_G8_B8R8_2PLANE_420_UNORM , multiplane, 1, 1, x8, , , , xyz1, rgb, 420, VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_UNORM -VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM , multiplane, 1, 1, x8, , , , xyz1, rgb, 422, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM -VK_FORMAT_G8_B8R8_2PLANE_422_UNORM , multiplane, 1, 1, x8, , , , xyz1, rgb, 422, VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_UNORM -VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM , multiplane, 1, 1, x8, , , , xyz1, rgb, 444, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM -VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, multiplane, 1, 1, x16, , , , xyz1, rgb, 420, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM -VK_FORMAT_G16_B16R16_2PLANE_420_UNORM , multiplane, 1, 1, x16, , , , xyz1, rgb, 420, VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_UNORM -VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, multiplane, 1, 1, x16, , , , xyz1, rgb, 422, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM -VK_FORMAT_G16_B16R16_2PLANE_422_UNORM , multiplane, 1, 1, x16, , , , xyz1, rgb, 422, VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_UNORM -VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, multiplane, 1, 1, x16, , , , xyz1, rgb, 444, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM VK_FORMAT_BC1_RGB_UNORM_BLOCK , s3tc, 4, 4, x64 , , , , xyz1, rgb VK_FORMAT_BC1_RGB_SRGB_BLOCK , s3tc, 4, 4, x64 , , , , xyz1, srgb VK_FORMAT_BC1_RGBA_UNORM_BLOCK , s3tc, 4, 4, x64 , , , , xyzw, rgb @@ -160,16 +148,16 @@ VK_FORMAT_BC6H_UFLOAT_BLOCK , bptc, 4, 4, x128, , , , xyz1 VK_FORMAT_BC6H_SFLOAT_BLOCK , bptc, 4, 4, x128, , , , xyz1, rgb VK_FORMAT_BC7_UNORM_BLOCK , bptc, 4, 4, x128, , , , xyzw, rgb VK_FORMAT_BC7_SRGB_BLOCK , bptc, 4, 4, x128, , , , xyzw, srgb -VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK , etc, 4, 4, x64, , , , xyz1, rgb -VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK , etc, 4, 4, x64, , , , xyz1, srgb -VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK , etc, 4, 4, x64, , , , xyzw, rgb -VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK , etc, 4, 4, x64, , , , xyzw, srgb -VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK , etc, 4, 4, x128, , , , xyzw, rgb -VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK , etc, 4, 4, x128, , , , xyzw, srgb -VK_FORMAT_EAC_R11_UNORM_BLOCK , etc, 4, 4, x64, , , , x001, rgb -VK_FORMAT_EAC_R11_SNORM_BLOCK , etc, 4, 4, x64, , , , x001, rgb -VK_FORMAT_EAC_R11G11_UNORM_BLOCK , etc, 4, 4, x128, , , , xy01, rgb -VK_FORMAT_EAC_R11G11_SNORM_BLOCK , etc, 4, 4, x128, , , , xy01, rgb +VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, +VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, +VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, +VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, +VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, +VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, +VK_FORMAT_EAC_R11_UNORM_BLOCK, +VK_FORMAT_EAC_R11_SNORM_BLOCK, +VK_FORMAT_EAC_R11G11_UNORM_BLOCK, +VK_FORMAT_EAC_R11G11_SNORM_BLOCK, VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK, diff --git a/lib/mesa/src/intel/common/gen_sample_positions.h b/lib/mesa/src/intel/common/gen_sample_positions.h index da48dcb5e..b86a7d843 100644 --- a/lib/mesa/src/intel/common/gen_sample_positions.h +++ b/lib/mesa/src/intel/common/gen_sample_positions.h @@ -23,38 +23,16 @@ #ifndef GEN_SAMPLE_POSITIONS_H #define GEN_SAMPLE_POSITIONS_H -/* - * This file defines the standard multisample positions used by both GL and - * Vulkan. These correspond to the Vulkan "standard sample locations". - */ - -/** - * 1x MSAA has a single sample at the center: (0.5, 0.5) -> (0x8, 0x8). - */ #define GEN_SAMPLE_POS_1X(prefix) \ prefix##0XOffset = 0.5; \ prefix##0YOffset = 0.5; -/** - * 2x MSAA sample positions are (0.25, 0.25) and (0.75, 0.75): - * 4 c - * 4 0 - * c 1 - */ #define GEN_SAMPLE_POS_2X(prefix) \ -prefix##0XOffset = 0.75; \ -prefix##0YOffset = 0.75; \ -prefix##1XOffset = 0.25; \ -prefix##1YOffset = 0.25; +prefix##0XOffset = 0.25; \ +prefix##0YOffset = 0.25; \ +prefix##1XOffset = 0.75; \ +prefix##1YOffset = 0.75; -/** - * Sample positions: - * 2 6 a e - * 2 0 - * 6 1 - * a 2 - * e 3 - */ #define GEN_SAMPLE_POS_4X(prefix) \ prefix##0XOffset = 0.375; \ prefix##0YOffset = 0.125; \ @@ -65,28 +43,6 @@ prefix##2YOffset = 0.625; \ prefix##3XOffset = 0.625; \ prefix##3YOffset = 0.875; -/** - * Sample positions: - * - * From the Ivy Bridge PRM, Vol2 Part1 p304 (3DSTATE_MULTISAMPLE: - * Programming Notes): - * "When programming the sample offsets (for NUMSAMPLES_4 or _8 and - * MSRASTMODE_xxx_PATTERN), the order of the samples 0 to 3 (or 7 - * for 8X) must have monotonically increasing distance from the - * pixel center. This is required to get the correct centroid - * computation in the device." - * - * Sample positions: - * 1 3 5 7 9 b d f - * 1 7 - * 3 3 - * 5 0 - * 7 5 - * 9 2 - * b 1 - * d 4 - * f 6 - */ #define GEN_SAMPLE_POS_8X(prefix) \ prefix##0XOffset = 0.5625; \ prefix##0YOffset = 0.3125; \ @@ -105,27 +61,6 @@ prefix##6YOffset = 0.9375; \ prefix##7XOffset = 0.9375; \ prefix##7YOffset = 0.0625; -/** - * Sample positions: - * - * 0 1 2 3 4 5 6 7 8 9 a b c d e f - * 0 15 - * 1 9 - * 2 10 - * 3 7 - * 4 13 - * 5 1 - * 6 4 - * 7 3 - * 8 12 - * 9 0 - * a 2 - * b 6 - * c 11 - * d 5 - * e 8 - * f 14 - */ #define GEN_SAMPLE_POS_16X(prefix) \ prefix##0XOffset = 0.5625; \ prefix##0YOffset = 0.5625; \ diff --git a/lib/mesa/src/intel/vulkan/anv_dump.c b/lib/mesa/src/intel/vulkan/anv_dump.c index f3447f43b..060890421 100644 --- a/lib/mesa/src/intel/vulkan/anv_dump.c +++ b/lib/mesa/src/intel/vulkan/anv_dump.c @@ -62,7 +62,7 @@ dump_image_init(struct anv_device *device, struct dump_image *image, uint32_t width, uint32_t height, const char *filename) { VkDevice vk_device = anv_device_to_handle(device); - ASSERTED VkResult result; + MAYBE_UNUSED VkResult result; image->filename = filename; image->extent = (VkExtent2D) { width, height }; @@ -200,7 +200,7 @@ static void dump_image_write_to_ppm(struct anv_device *device, struct dump_image *image) { VkDevice vk_device = anv_device_to_handle(device); - ASSERTED VkResult result; + MAYBE_UNUSED VkResult result; VkMemoryRequirements reqs; anv_GetImageMemoryRequirements(vk_device, image->image, &reqs); @@ -249,7 +249,7 @@ anv_dump_image_to_ppm(struct anv_device *device, const char *filename) { VkDevice vk_device = anv_device_to_handle(device); - ASSERTED VkResult result; + MAYBE_UNUSED VkResult result; PFN_vkBeginCommandBuffer BeginCommandBuffer = (void *)anv_GetDeviceProcAddr(anv_device_to_handle(device), @@ -410,38 +410,34 @@ dump_add_image(struct anv_cmd_buffer *cmd_buffer, struct anv_image *image, } void -anv_dump_add_attachments(struct anv_cmd_buffer *cmd_buffer) +anv_dump_add_framebuffer(struct anv_cmd_buffer *cmd_buffer, + struct anv_framebuffer *fb) { if (!dump_lock(ANV_DUMP_FRAMEBUFFERS_BIT)) return; unsigned dump_idx = dump_count++; - for (unsigned i = 0; i < cmd_buffer->state.pass->attachment_count; i++) { - struct anv_image_view *iview = cmd_buffer->state.attachments[i].image_view; + for (unsigned i = 0; i < fb->attachment_count; i++) { + struct anv_image_view *iview = fb->attachments[i]; uint32_t b; for_each_bit(b, iview->image->aspects) { VkImageAspectFlagBits aspect = (1 << b); - const char *suffix; + char suffix; switch (aspect) { - case VK_IMAGE_ASPECT_COLOR_BIT: suffix = "c"; break; - case VK_IMAGE_ASPECT_DEPTH_BIT: suffix = "d"; break; - case VK_IMAGE_ASPECT_STENCIL_BIT: suffix = "s"; break; - case VK_IMAGE_ASPECT_PLANE_0_BIT: suffix = "c0"; break; - case VK_IMAGE_ASPECT_PLANE_1_BIT: suffix = "c1"; break; - case VK_IMAGE_ASPECT_PLANE_2_BIT: suffix = "c2"; break; + case VK_IMAGE_ASPECT_COLOR_BIT: suffix = 'c'; break; + case VK_IMAGE_ASPECT_DEPTH_BIT: suffix = 'd'; break; + case VK_IMAGE_ASPECT_STENCIL_BIT: suffix = 's'; break; default: unreachable("Invalid aspect"); } - char *filename = ralloc_asprintf(dump_ctx, "attachment%04d-%d%s.ppm", + char *filename = ralloc_asprintf(dump_ctx, "framebuffer%04d-%d%c.ppm", dump_idx, i, suffix); - unsigned plane = anv_image_aspect_to_plane(iview->image->aspects, aspect); dump_add_image(cmd_buffer, (struct anv_image *)iview->image, aspect, - iview->planes[plane].isl.base_level, - iview->planes[plane].isl.base_array_layer, + iview->isl.base_level, iview->isl.base_array_layer, filename); } } |