Skip to content

Commit 8146991

Browse files
Merge pull request #127 from GPUOpen-LibrariesAndSDKs/update_wk47
Week #47 update: Bug-fixes and improvements
2 parents 3c8f12c + a27a8b1 commit 8146991

10 files changed

Lines changed: 414 additions & 244 deletions

File tree

examples/OutOfOrderRasterization/include/app.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class App
8989

9090
uint32_t m_n_indices;
9191
uint32_t m_n_last_semaphore_used;
92-
const uint32_t m_n_swapchain_images;
92+
uint32_t m_n_swapchain_images;
9393
bool m_ooo_enabled;
9494
bool m_should_rotate;
9595
std::unique_ptr<float> m_teapot_props_data_ptr;

examples/OutOfOrderRasterization/src/app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void App::init_command_buffers()
517517
VkClearValue clear_values[2];
518518
const Anvil::DeviceType device_type = m_device_ptr->get_type();
519519
auto gfx_manager_ptr = m_device_ptr->get_graphics_pipeline_manager();
520-
const uint32_t n_swapchain_images = m_swapchain_ptr->get_create_info_ptr()->get_n_images();
520+
const uint32_t n_swapchain_images = m_swapchain_ptr->get_n_images();
521521
const uint32_t universal_queue_family_index = m_device_ptr->get_universal_queue(0)->get_queue_family_index();
522522
Anvil::Buffer* vertex_buffers[] =
523523
{

include/misc/formats.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ namespace Anvil
186186
* via get_format_component_layout(). This is especially important in the context of packed formats.
187187
*
188188
* @param in_format Vulkan format to use for the query.
189+
* @param in_aspect Image aspect to use for the query.
189190
* @param out_channel0_bits_ptr Deref will be set to the number of bits used for channel 0. Must
190191
* not be nullptr.
191192
* @param out_channel1_bits_ptr Deref will be set to the number of bits used for channel 1. Must
@@ -202,6 +203,31 @@ namespace Anvil
202203
uint32_t* out_channel2_bits_ptr,
203204
uint32_t* out_channel3_bits_ptr);
204205

206+
/** Tells the number of bits unused for each component in case of Vulkan format specified
207+
* under @param in_format at subresource @param in_aspect.
208+
*
209+
* NOTE: Only YUV KHR fromats are supported.
210+
* NOTE: Number of bits reported for each component uses ordering as reported for the format
211+
* via get_format_component_layout(). This is especially important in the context of packed formats.
212+
*
213+
* @param in_format Vulkan format to use for the query.
214+
* @param in_aspect Image aspect to use for the query.
215+
* @param out_channel0_unused_bits_ptr Deref will be set to the number of bits unused for channel 0. Must
216+
* not be nullptr.
217+
* @param out_channel1_unused_bits_ptr Deref will be set to the number of bits unused for channel 1. Must
218+
* not be nullptr.
219+
* @param out_channel2_unused_bits_ptr Deref will be set to the number of bits unused for channel 2. Must
220+
* not be nullptr.
221+
* @param out_channel3_unused_bits_ptr Deref will be set to the number of bits unused for channel 3. Must
222+
* not be nullptr.
223+
*/
224+
static void get_format_n_unused_component_bits(Anvil::Format in_format,
225+
Anvil::ImageAspectFlagBits in_aspect,
226+
uint32_t* out_channel0_unused_bits_ptr,
227+
uint32_t* out_channel1_unused_bits_ptr,
228+
uint32_t* out_channel2_unused_bits_ptr,
229+
uint32_t* out_channel3_unused_bits_ptr);
230+
205231
/* Returns a raw C string for specified format, or NULL if the format is unknown. */
206232
static const char* get_format_name(Anvil::Format in_format);
207233

include/misc/types_enums.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,15 +633,23 @@ namespace Anvil
633633
BGRA,
634634
BGRG,
635635
BR,
636+
BX,
637+
BXGXRXGX,
638+
BXRX,
636639
D,
637640
DS,
638641
EBGR,
639642
G,
640643
GBGR,
644+
GX,
645+
GXBXGXRX,
641646
R,
642647
RG,
643648
RGB,
644649
RGBA,
650+
RX,
651+
RXGX,
652+
RXGXBXAX,
645653
S,
646654
XD,
647655

include/wrappers/swapchain.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ namespace Anvil
8989
return m_size.height;
9090
}
9191

92+
/** Return the actual number of swapchain images created. */
93+
uint32_t get_n_images() const
94+
{
95+
return m_n_images;
96+
}
97+
9298
/** Retrieves an Image instance associated with a swapchain image at index
9399
* @param in_n_swapchain_image.
94100
*
@@ -197,6 +203,7 @@ namespace Anvil
197203
/* Private variables */
198204
Anvil::SwapchainCreateInfoUniquePtr m_create_info_ptr;
199205
Anvil::FenceUniquePtr m_image_available_fence_ptr;
206+
uint32_t m_n_images; /* number of images created in the swapchain. */
200207
std::vector<ImageUniquePtr> m_image_ptrs;
201208
std::vector<ImageViewUniquePtr> m_image_view_ptrs;
202209
uint32_t m_last_acquired_image_index;

src/misc/debug_marker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void Anvil::DebugMarkerSupportProviderWorker::set_tag_internal(const uint64_t in
102102
m_object_tag_name = in_tag_name;
103103
m_object_tag_data.resize(in_tag_size);
104104

105-
memcpy(&m_object_tag_data,
105+
memcpy(&m_object_tag_data.at(0),
106106
in_tag_ptr,
107107
in_tag_size);
108108

0 commit comments

Comments
 (0)