radv: add support for dynamic and scissor count
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>
This commit is contained in:
parent
d6c1e5051e
commit
e8a69b782d
|
@ -113,7 +113,11 @@ radv_bind_dynamic_state(struct radv_cmd_buffer *cmd_buffer,
|
||||||
dest->sample_location.count = src->sample_location.count;
|
dest->sample_location.count = src->sample_location.count;
|
||||||
|
|
||||||
if (copy_mask & RADV_DYNAMIC_VIEWPORT) {
|
if (copy_mask & RADV_DYNAMIC_VIEWPORT) {
|
||||||
dest->viewport.count = src->viewport.count;
|
if (dest->viewport.count != src->viewport.count) {
|
||||||
|
dest->viewport.count = src->viewport.count;
|
||||||
|
dest_mask |= RADV_DYNAMIC_VIEWPORT;
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(&dest->viewport.viewports, &src->viewport.viewports,
|
if (memcmp(&dest->viewport.viewports, &src->viewport.viewports,
|
||||||
src->viewport.count * sizeof(VkViewport))) {
|
src->viewport.count * sizeof(VkViewport))) {
|
||||||
typed_memcpy(dest->viewport.viewports,
|
typed_memcpy(dest->viewport.viewports,
|
||||||
|
@ -124,7 +128,11 @@ radv_bind_dynamic_state(struct radv_cmd_buffer *cmd_buffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy_mask & RADV_DYNAMIC_SCISSOR) {
|
if (copy_mask & RADV_DYNAMIC_SCISSOR) {
|
||||||
dest->scissor.count = src->scissor.count;
|
if (dest->scissor.count != src->scissor.count) {
|
||||||
|
dest->scissor.count = src->scissor.count;
|
||||||
|
dest_mask |= RADV_DYNAMIC_SCISSOR;
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(&dest->scissor.scissors, &src->scissor.scissors,
|
if (memcmp(&dest->scissor.scissors, &src->scissor.scissors,
|
||||||
src->scissor.count * sizeof(VkRect2D))) {
|
src->scissor.count * sizeof(VkRect2D))) {
|
||||||
typed_memcpy(dest->scissor.scissors,
|
typed_memcpy(dest->scissor.scissors,
|
||||||
|
@ -4318,6 +4326,22 @@ void radv_CmdSetPrimitiveTopologyEXT(
|
||||||
state->dirty |= RADV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY;
|
state->dirty |= RADV_CMD_DIRTY_DYNAMIC_PRIMITIVE_TOPOLOGY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void radv_CmdSetViewportWithCountEXT(
|
||||||
|
VkCommandBuffer commandBuffer,
|
||||||
|
uint32_t viewportCount,
|
||||||
|
const VkViewport* pViewports)
|
||||||
|
{
|
||||||
|
radv_CmdSetViewport(commandBuffer, 0, viewportCount, pViewports);
|
||||||
|
}
|
||||||
|
|
||||||
|
void radv_CmdSetScissorWithCountEXT(
|
||||||
|
VkCommandBuffer commandBuffer,
|
||||||
|
uint32_t scissorCount,
|
||||||
|
const VkRect2D* pScissors)
|
||||||
|
{
|
||||||
|
radv_CmdSetScissor(commandBuffer, 0, scissorCount, pScissors);
|
||||||
|
}
|
||||||
|
|
||||||
void radv_CmdExecuteCommands(
|
void radv_CmdExecuteCommands(
|
||||||
VkCommandBuffer commandBuffer,
|
VkCommandBuffer commandBuffer,
|
||||||
uint32_t commandBufferCount,
|
uint32_t commandBufferCount,
|
||||||
|
|
|
@ -1243,8 +1243,10 @@ static unsigned radv_dynamic_state_mask(VkDynamicState state)
|
||||||
{
|
{
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case VK_DYNAMIC_STATE_VIEWPORT:
|
case VK_DYNAMIC_STATE_VIEWPORT:
|
||||||
|
case VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT:
|
||||||
return RADV_DYNAMIC_VIEWPORT;
|
return RADV_DYNAMIC_VIEWPORT;
|
||||||
case VK_DYNAMIC_STATE_SCISSOR:
|
case VK_DYNAMIC_STATE_SCISSOR:
|
||||||
|
case VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT:
|
||||||
return RADV_DYNAMIC_SCISSOR;
|
return RADV_DYNAMIC_SCISSOR;
|
||||||
case VK_DYNAMIC_STATE_LINE_WIDTH:
|
case VK_DYNAMIC_STATE_LINE_WIDTH:
|
||||||
return RADV_DYNAMIC_LINE_WIDTH;
|
return RADV_DYNAMIC_LINE_WIDTH;
|
||||||
|
|
Loading…
Reference in New Issue