Skip to content

Commit

Permalink
Fixed replay of partial command-buffers that contain pushconstants.
Browse files Browse the repository at this point in the history
We were getting the data for the U8s, which was not correct.
Instead read the data out into a []uint8, and then upload
that in the recreated command. This has the desired effect
of pushing the right data into the push constants.

This also fixes the same problem with VkCmdUpdateBuffer.
  • Loading branch information
AWoloszyn committed Oct 13, 2017
1 parent 8afc0bf commit e451f22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions gapis/api/vulkan/command_buffer_rebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ func rebuildVkCmdPushConstants(
s *api.GlobalState,
d *VkCmdPushConstantsArgs) (func(), api.Cmd) {

data := s.AllocDataOrPanic(ctx, d.Data)
dat := d.Data.MustRead(ctx, nil, s, nil)
data := s.AllocDataOrPanic(ctx, dat)

return func() {
data.Free()
Expand Down Expand Up @@ -840,7 +841,9 @@ func rebuildVkCmdUpdateBuffer(
commandBuffer VkCommandBuffer,
s *api.GlobalState,
d *VkCmdUpdateBufferArgs) (func(), api.Cmd) {
data := s.AllocDataOrPanic(ctx, d.Data)

dat := d.Data.MustRead(ctx, nil, s, nil)
data := s.AllocDataOrPanic(ctx, dat)

return func() {
data.Free()
Expand Down
3 changes: 1 addition & 2 deletions gapis/api/vulkan/vulkan.api
Original file line number Diff line number Diff line change
Expand Up @@ -7209,9 +7209,8 @@ cmd void vkCmdPushConstants(
u32 offset,
u32 size,
const void* pValues) {
data := clone(as!u8*(pValues)[0:size])
args := new!vkCmdPushConstantsArgs(
layout, stageFlags, offset, size, data
layout, stageFlags, offset, size, clone(as!u8*(pValues)[0:size])
)

addCmd(commandBuffer, args, dovkCmdPushConstants)
Expand Down

0 comments on commit e451f22

Please sign in to comment.