@@ -1535,79 +1535,7 @@ static void record_buffer_memory_barrier(VkCommandBuffer cb, VkBuffer buffer, Vk
15351535
15361536
15371537/* vk_occlusion_* / vk_reset_occlusion_visibility: vk_occlusion.c */
1538-
1539- void vk_clear_color ( const vec4_t color ) {
1540-
1541- VkClearAttachment attachment ;
1542- VkClearRect clear_rect ;
1543-
1544- if ( !vk .active )
1545- return ;
1546- if ( !vk .cmd || vk .cmd -> command_buffer == VK_NULL_HANDLE || !vk .inRenderPass )
1547- return ;
1548-
1549- attachment .colorAttachment = 0 ;
1550- attachment .clearValue .color .float32 [0 ] = color [0 ];
1551- attachment .clearValue .color .float32 [1 ] = color [1 ];
1552- attachment .clearValue .color .float32 [2 ] = color [2 ];
1553- attachment .clearValue .color .float32 [3 ] = color [3 ];
1554- attachment .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT ;
1555-
1556- vk_get_scissor_rect ( & clear_rect .rect );
1557- clear_rect .baseArrayLayer = 0 ;
1558- clear_rect .layerCount = 1 ;
1559-
1560- qvkCmdClearAttachments ( vk .cmd -> command_buffer , 1 , & attachment , 1 , & clear_rect );
1561- }
1562-
1563- void vk_set_color_write_mask ( qboolean r , qboolean g , qboolean b , qboolean a )
1564- {
1565- VkColorComponentFlags mask ;
1566-
1567- if ( !vk .active || !vk .colorWriteMaskDynamic || !qvkCmdSetColorWriteMaskEXT )
1568- return ;
1569-
1570- mask = 0 ;
1571- if ( r ) mask |= VK_COLOR_COMPONENT_R_BIT ;
1572- if ( g ) mask |= VK_COLOR_COMPONENT_G_BIT ;
1573- if ( b ) mask |= VK_COLOR_COMPONENT_B_BIT ;
1574- if ( a ) mask |= VK_COLOR_COMPONENT_A_BIT ;
1575-
1576- qvkCmdSetColorWriteMaskEXT ( vk .cmd -> command_buffer , 0 , 1 , & mask );
1577- }
1578-
1579- void vk_clear_depth ( qboolean clear_stencil ) {
1580-
1581- VkClearAttachment attachment ;
1582- VkClearRect clear_rect [1 ];
1583-
1584- if ( !vk .active )
1585- return ;
1586- if ( !vk .cmd || vk .cmd -> command_buffer == VK_NULL_HANDLE || !vk .inRenderPass )
1587- return ;
1588-
1589- if ( vk_world .dirty_depth_attachment == 0 )
1590- return ;
1591-
1592- attachment .colorAttachment = 0 ;
1593- #ifdef USE_REVERSED_DEPTH
1594- attachment .clearValue .depthStencil .depth = 0.0f ;
1595- #else
1596- attachment .clearValue .depthStencil .depth = 1.0f ;
1597- #endif
1598- attachment .clearValue .depthStencil .stencil = 0 ;
1599- if ( clear_stencil && glConfig .stencilBits > 0 ) {
1600- attachment .aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT ;
1601- } else {
1602- attachment .aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT ;
1603- }
1604-
1605- vk_get_scissor_rect ( & clear_rect [0 ].rect );
1606- clear_rect [0 ].baseArrayLayer = 0 ;
1607- clear_rect [0 ].layerCount = 1 ;
1608-
1609- qvkCmdClearAttachments ( vk .cmd -> command_buffer , 1 , & attachment , 1 , clear_rect );
1610- }
1538+ /* vk_clear_color, vk_clear_depth, vk_set_color_write_mask: vk_clear_attachments.c */
16111539
16121540/* vk_bind_*, vk_alloc_storage, vk_tess_index, vk_*descriptor*, vk_draw_*: vk_draw_state.c */
16131541
0 commit comments