diff options
author | Kristian Høgsberg Kristensen <[email protected]> | 2015-07-28 16:32:52 -0700 |
---|---|---|
committer | Kristian Høgsberg Kristensen <[email protected]> | 2015-07-29 11:02:33 -0700 |
commit | fcea3e2d23b7a02f9cc4b58870ac59107bcf0050 (patch) | |
tree | 402ffe1b23c110aaa0b966230b9afb5f54740304 /src/vulkan/anv_pipeline.c | |
parent | 65f3d00cd6abb3ac1dec10808fbd1be693a3aaa3 (diff) |
vk/headers: Update to new generated gen headers
This update fixes cases where a 48-bit address field was split into
two parts:
__gen_address_type MemoryAddress;
uint32_t MemoryAddressHigh;
which cases this pack code to be generated:
dw[1] =
__gen_combine_address(data, &dw[1], values->MemoryAddress, dw1);
dw[2] =
__gen_field(values->MemoryAddressHigh, 0, 15) |
0;
which breaks for addresses above 4G.
This update also fixes arrays of structs in commands and structs, for
example, we now have:
struct GEN8_BLEND_STATE_ENTRY Entry[8];
and the pack functions now write all dwords in the packet, making
valgrind happy.
Finally, we would try to pack 64 bits of blend state into a uint32_t -
that's also fixed now.
Diffstat (limited to 'src/vulkan/anv_pipeline.c')
-rw-r--r-- | src/vulkan/anv_pipeline.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 5aeacefddf6..5a36faa29b5 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -370,7 +370,7 @@ emit_cb_state(struct anv_pipeline *pipeline, [VK_BLEND_OP_MAX] = BLENDFUNCTION_MAX, }; - uint32_t num_dwords = 1 + info->attachmentCount * 2; + uint32_t num_dwords = GEN8_BLEND_STATE_length; pipeline->blend_state = anv_state_pool_alloc(&device->dynamic_state_pool, num_dwords * 4, 64); @@ -378,13 +378,10 @@ emit_cb_state(struct anv_pipeline *pipeline, .AlphaToCoverageEnable = info->alphaToCoverageEnable, }; - uint32_t *state = pipeline->blend_state.map; - GEN8_BLEND_STATE_pack(NULL, state, &blend_state); - for (uint32_t i = 0; i < info->attachmentCount; i++) { const VkPipelineColorBlendAttachmentState *a = &info->pAttachments[i]; - struct GEN8_BLEND_STATE_ENTRY entry = { + blend_state.Entry[i] = (struct GEN8_BLEND_STATE_ENTRY) { .LogicOpEnable = info->logicOpEnable, .LogicOpFunction = vk_to_gen_logic_op[info->logicOp], .ColorBufferBlendEnable = a->blendEnable, @@ -402,10 +399,10 @@ emit_cb_state(struct anv_pipeline *pipeline, .WriteDisableGreen = !(a->channelWriteMask & VK_CHANNEL_G_BIT), .WriteDisableBlue = !(a->channelWriteMask & VK_CHANNEL_B_BIT), }; - - GEN8_BLEND_STATE_ENTRY_pack(NULL, state + i * 2 + 1, &entry); } + GEN8_BLEND_STATE_pack(NULL, pipeline->blend_state.map, &blend_state); + anv_batch_emit(&pipeline->batch, GEN8_3DSTATE_BLEND_STATE_POINTERS, .BlendStatePointer = pipeline->blend_state.offset, .BlendStatePointerValid = true); |