Compare commits
25 Commits
mesa-19.0.
...
mesa-18.3.
Author | SHA1 | Date | |
---|---|---|---|
|
f55265776f | ||
|
4c995fcae7 | ||
|
09c5e548c4 | ||
|
15442cac5c | ||
|
61c64f64d7 | ||
|
5b35600422 | ||
|
ede46c67ea | ||
|
ecb1bef871 | ||
|
a93d19f542 | ||
|
7053fe50c3 | ||
|
327330e77c | ||
|
422c905f4b | ||
|
1348e6e255 | ||
|
97a3ef3d1c | ||
|
6463af186c | ||
|
45fe51a0ee | ||
|
5adc1920ee | ||
|
6adbf17ce9 | ||
|
d5e33d2aa6 | ||
|
959a9d42d7 | ||
|
52e01585c4 | ||
|
12c5eb2fd3 | ||
|
949b1048f7 | ||
|
22201d2048 | ||
|
60fe2f6ecc |
@@ -21,6 +21,7 @@
|
||||
<li><a href="#overview">Overview</a>
|
||||
<li><a href="#schedule">Release schedule</a>
|
||||
<li><a href="#pickntest">Cherry-pick and test</a>
|
||||
<li><a href="#stagingbranch">Staging branch</a>
|
||||
<li><a href="#branch">Making a branchpoint</a>
|
||||
<li><a href="#prerelease">Pre-release announcement</a>
|
||||
<li><a href="#release">Making a new release</a>
|
||||
@@ -209,6 +210,25 @@ system and making some every day's use until the release may be a good
|
||||
idea too.
|
||||
</p>
|
||||
|
||||
<h1 id="stagingbranch">Staging branch</h1>
|
||||
|
||||
<p>
|
||||
A live branch, which contains the currently merge/rejected patches is available
|
||||
in the main repository under <code>staging/X.Y</code>. For example:
|
||||
</p>
|
||||
<pre>
|
||||
staging/18.1 - WIP branch for the 18.1 series
|
||||
staging/18.2 - WIP branch for the 18.2 series
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Notes:
|
||||
</p>
|
||||
<ul>
|
||||
<li>People are encouraged to test the branch and report regressions.</li>
|
||||
<li>The branch history is not stable and it <strong>will</strong> be rebased,</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1 id="branch">Making a branchpoint</h1>
|
||||
|
||||
|
@@ -251,6 +251,9 @@ If you are not the author of the original patch, please Cc: them in your
|
||||
nomination request.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The current patch status can be observed in the <a href="releasing.html#stagingbranch">staging branch</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="thetag">The stable tag</h3>
|
||||
|
||||
|
@@ -311,9 +311,18 @@ static LLVMValueRef emit_uint_carry(struct ac_llvm_context *ctx,
|
||||
}
|
||||
|
||||
static LLVMValueRef emit_b2f(struct ac_llvm_context *ctx,
|
||||
LLVMValueRef src0)
|
||||
LLVMValueRef src0,
|
||||
unsigned bitsize)
|
||||
{
|
||||
return LLVMBuildAnd(ctx->builder, src0, LLVMBuildBitCast(ctx->builder, LLVMConstReal(ctx->f32, 1.0), ctx->i32, ""), "");
|
||||
LLVMValueRef result = LLVMBuildAnd(ctx->builder, src0,
|
||||
LLVMBuildBitCast(ctx->builder, LLVMConstReal(ctx->f32, 1.0), ctx->i32, ""),
|
||||
"");
|
||||
result = LLVMBuildBitCast(ctx->builder, result, ctx->f32, "");
|
||||
|
||||
if (bitsize == 32)
|
||||
return result;
|
||||
|
||||
return LLVMBuildFPExt(ctx->builder, result, ctx->f64, "");
|
||||
}
|
||||
|
||||
static LLVMValueRef emit_f2b(struct ac_llvm_context *ctx,
|
||||
@@ -932,7 +941,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
|
||||
result = emit_uint_carry(&ctx->ac, "llvm.usub.with.overflow.i32", src[0], src[1]);
|
||||
break;
|
||||
case nir_op_b2f:
|
||||
result = emit_b2f(&ctx->ac, src[0]);
|
||||
result = emit_b2f(&ctx->ac, src[0], instr->dest.dest.ssa.bit_size);
|
||||
break;
|
||||
case nir_op_f2b:
|
||||
result = emit_f2b(&ctx->ac, src[0]);
|
||||
|
@@ -74,7 +74,8 @@ LOCAL_C_INCLUDES := \
|
||||
$(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_vulkan_util,,)/util
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
libmesa_vulkan_util
|
||||
libmesa_vulkan_util \
|
||||
libmesa_git_sha1
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.c
|
||||
LOCAL_GENERATED_SOURCES += $(intermediates)/radv_entrypoints.h
|
||||
|
@@ -1950,6 +1950,8 @@ radv_flush_streamout_descriptors(struct radv_cmd_buffer *cmd_buffer)
|
||||
|
||||
va = radv_buffer_get_va(buffer->bo) + buffer->offset;
|
||||
|
||||
va += sb[i].offset;
|
||||
|
||||
/* Set the descriptor.
|
||||
*
|
||||
* On VI, the format must be non-INVALID, otherwise
|
||||
@@ -4741,28 +4743,30 @@ void radv_CmdBeginTransformFeedbackEXT(
|
||||
struct radv_streamout_binding *sb = cmd_buffer->streamout_bindings;
|
||||
struct radv_streamout_state *so = &cmd_buffer->state.streamout;
|
||||
struct radeon_cmdbuf *cs = cmd_buffer->cs;
|
||||
uint32_t i;
|
||||
|
||||
radv_flush_vgt_streamout(cmd_buffer);
|
||||
|
||||
assert(firstCounterBuffer + counterBufferCount <= MAX_SO_BUFFERS);
|
||||
for (uint32_t i = firstCounterBuffer; i < counterBufferCount; i++) {
|
||||
if (!(so->enabled_mask & (1 << i)))
|
||||
continue;
|
||||
for_each_bit(i, so->enabled_mask) {
|
||||
int32_t counter_buffer_idx = i - firstCounterBuffer;
|
||||
if (counter_buffer_idx >= 0 && counter_buffer_idx > counterBufferCount)
|
||||
counter_buffer_idx = -1;
|
||||
|
||||
/* SI binds streamout buffers as shader resources.
|
||||
* VGT only counts primitives and tells the shader through
|
||||
* SGPRs what to do.
|
||||
*/
|
||||
radeon_set_context_reg_seq(cs, R_028AD0_VGT_STRMOUT_BUFFER_SIZE_0 + 16*i, 2);
|
||||
radeon_emit(cs, (sb[i].offset + sb[i].size) >> 2); /* BUFFER_SIZE (in DW) */
|
||||
radeon_emit(cs, sb[i].size >> 2); /* BUFFER_SIZE (in DW) */
|
||||
radeon_emit(cs, so->stride_in_dw[i]); /* VTX_STRIDE (in DW) */
|
||||
|
||||
if (pCounterBuffers && pCounterBuffers[i]) {
|
||||
if (counter_buffer_idx >= 0 && pCounterBuffers && pCounterBuffers[counter_buffer_idx]) {
|
||||
/* The array of counter buffers is optional. */
|
||||
RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[i]);
|
||||
RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[counter_buffer_idx]);
|
||||
uint64_t va = radv_buffer_get_va(buffer->bo);
|
||||
|
||||
va += buffer->offset + pCounterBufferOffsets[i];
|
||||
va += buffer->offset + pCounterBufferOffsets[counter_buffer_idx];
|
||||
|
||||
/* Append */
|
||||
radeon_emit(cs, PKT3(PKT3_STRMOUT_BUFFER_UPDATE, 4, 0));
|
||||
@@ -4783,7 +4787,7 @@ void radv_CmdBeginTransformFeedbackEXT(
|
||||
STRMOUT_OFFSET_SOURCE(STRMOUT_OFFSET_FROM_PACKET)); /* control */
|
||||
radeon_emit(cs, 0); /* unused */
|
||||
radeon_emit(cs, 0); /* unused */
|
||||
radeon_emit(cs, sb[i].offset >> 2); /* buffer offset in DW */
|
||||
radeon_emit(cs, 0); /* unused */
|
||||
radeon_emit(cs, 0); /* unused */
|
||||
}
|
||||
}
|
||||
@@ -4801,20 +4805,22 @@ void radv_CmdEndTransformFeedbackEXT(
|
||||
RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct radv_streamout_state *so = &cmd_buffer->state.streamout;
|
||||
struct radeon_cmdbuf *cs = cmd_buffer->cs;
|
||||
uint32_t i;
|
||||
|
||||
radv_flush_vgt_streamout(cmd_buffer);
|
||||
|
||||
assert(firstCounterBuffer + counterBufferCount <= MAX_SO_BUFFERS);
|
||||
for (uint32_t i = firstCounterBuffer; i < counterBufferCount; i++) {
|
||||
if (!(so->enabled_mask & (1 << i)))
|
||||
continue;
|
||||
for_each_bit(i, so->enabled_mask) {
|
||||
int32_t counter_buffer_idx = i - firstCounterBuffer;
|
||||
if (counter_buffer_idx >= 0 && counter_buffer_idx > counterBufferCount)
|
||||
counter_buffer_idx = -1;
|
||||
|
||||
if (pCounterBuffers && pCounterBuffers[i]) {
|
||||
if (counter_buffer_idx >= 0 && pCounterBuffers && pCounterBuffers[counter_buffer_idx]) {
|
||||
/* The array of counters buffer is optional. */
|
||||
RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[i]);
|
||||
RADV_FROM_HANDLE(radv_buffer, buffer, pCounterBuffers[counter_buffer_idx]);
|
||||
uint64_t va = radv_buffer_get_va(buffer->bo);
|
||||
|
||||
va += buffer->offset + pCounterBufferOffsets[i];
|
||||
va += buffer->offset + pCounterBufferOffsets[counter_buffer_idx];
|
||||
|
||||
radeon_emit(cs, PKT3(PKT3_STRMOUT_BUFFER_UPDATE, 4, 0));
|
||||
radeon_emit(cs, STRMOUT_SELECT_BUFFER(i) |
|
||||
|
@@ -595,6 +595,7 @@ struct radv_meta_state {
|
||||
VkPipelineLayout p_layout;
|
||||
VkPipeline occlusion_query_pipeline;
|
||||
VkPipeline pipeline_statistics_query_pipeline;
|
||||
VkPipeline tfb_query_pipeline;
|
||||
} query;
|
||||
};
|
||||
|
||||
|
@@ -512,11 +512,233 @@ build_pipeline_statistics_query_shader(struct radv_device *device) {
|
||||
return b.shader;
|
||||
}
|
||||
|
||||
static nir_shader *
|
||||
build_tfb_query_shader(struct radv_device *device)
|
||||
{
|
||||
/* the shader this builds is roughly
|
||||
*
|
||||
* uint32_t src_stride = 32;
|
||||
*
|
||||
* location(binding = 0) buffer dst_buf;
|
||||
* location(binding = 1) buffer src_buf;
|
||||
*
|
||||
* void main() {
|
||||
* uint64_t result[2] = {};
|
||||
* bool available = false;
|
||||
* uint64_t src_offset = src_stride * global_id.x;
|
||||
* uint64_t dst_offset = dst_stride * global_id.x;
|
||||
* uint64_t *src_data = src_buf[src_offset];
|
||||
* uint32_t avail = (src_data[0] >> 32) &
|
||||
* (src_data[1] >> 32) &
|
||||
* (src_data[2] >> 32) &
|
||||
* (src_data[3] >> 32);
|
||||
* if (avail & 0x80000000) {
|
||||
* result[0] = src_data[3] - src_data[1];
|
||||
* result[1] = src_data[2] - src_data[0];
|
||||
* available = true;
|
||||
* }
|
||||
* uint32_t result_size = flags & VK_QUERY_RESULT_64_BIT ? 16 : 8;
|
||||
* if ((flags & VK_QUERY_RESULT_PARTIAL_BIT) || available) {
|
||||
* if (flags & VK_QUERY_RESULT_64_BIT) {
|
||||
* dst_buf[dst_offset] = result;
|
||||
* } else {
|
||||
* dst_buf[dst_offset] = (uint32_t)result;
|
||||
* }
|
||||
* }
|
||||
* if (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) {
|
||||
* dst_buf[dst_offset + result_size] = available;
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
nir_builder b;
|
||||
nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_COMPUTE, NULL);
|
||||
b.shader->info.name = ralloc_strdup(b.shader, "tfb_query");
|
||||
b.shader->info.cs.local_size[0] = 64;
|
||||
b.shader->info.cs.local_size[1] = 1;
|
||||
b.shader->info.cs.local_size[2] = 1;
|
||||
|
||||
/* Create and initialize local variables. */
|
||||
nir_variable *result =
|
||||
nir_local_variable_create(b.impl,
|
||||
glsl_vector_type(GLSL_TYPE_UINT64, 2),
|
||||
"result");
|
||||
nir_variable *available =
|
||||
nir_local_variable_create(b.impl, glsl_int_type(), "available");
|
||||
|
||||
nir_store_var(&b, result,
|
||||
nir_vec2(&b, nir_imm_int64(&b, 0),
|
||||
nir_imm_int64(&b, 0)), 0x3);
|
||||
nir_store_var(&b, available, nir_imm_int(&b, 0), 0x1);
|
||||
|
||||
nir_ssa_def *flags = radv_load_push_int(&b, 0, "flags");
|
||||
|
||||
/* Load resources. */
|
||||
nir_intrinsic_instr *dst_buf = nir_intrinsic_instr_create(b.shader,
|
||||
nir_intrinsic_vulkan_resource_index);
|
||||
dst_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
|
||||
nir_intrinsic_set_desc_set(dst_buf, 0);
|
||||
nir_intrinsic_set_binding(dst_buf, 0);
|
||||
nir_ssa_dest_init(&dst_buf->instr, &dst_buf->dest, 1, 32, NULL);
|
||||
nir_builder_instr_insert(&b, &dst_buf->instr);
|
||||
|
||||
nir_intrinsic_instr *src_buf = nir_intrinsic_instr_create(b.shader,
|
||||
nir_intrinsic_vulkan_resource_index);
|
||||
src_buf->src[0] = nir_src_for_ssa(nir_imm_int(&b, 0));
|
||||
nir_intrinsic_set_desc_set(src_buf, 0);
|
||||
nir_intrinsic_set_binding(src_buf, 1);
|
||||
nir_ssa_dest_init(&src_buf->instr, &src_buf->dest, 1, 32, NULL);
|
||||
nir_builder_instr_insert(&b, &src_buf->instr);
|
||||
|
||||
/* Compute global ID. */
|
||||
nir_ssa_def *invoc_id = nir_load_system_value(&b, nir_intrinsic_load_local_invocation_id, 0);
|
||||
nir_ssa_def *wg_id = nir_load_system_value(&b, nir_intrinsic_load_work_group_id, 0);
|
||||
nir_ssa_def *block_size = nir_imm_ivec4(&b,
|
||||
b.shader->info.cs.local_size[0],
|
||||
b.shader->info.cs.local_size[1],
|
||||
b.shader->info.cs.local_size[2], 0);
|
||||
nir_ssa_def *global_id = nir_iadd(&b, nir_imul(&b, wg_id, block_size), invoc_id);
|
||||
global_id = nir_channel(&b, global_id, 0); // We only care about x here.
|
||||
|
||||
/* Compute src/dst strides. */
|
||||
nir_ssa_def *input_stride = nir_imm_int(&b, 32);
|
||||
nir_ssa_def *input_base = nir_imul(&b, input_stride, global_id);
|
||||
nir_ssa_def *output_stride = radv_load_push_int(&b, 4, "output_stride");
|
||||
nir_ssa_def *output_base = nir_imul(&b, output_stride, global_id);
|
||||
|
||||
/* Load data from the query pool. */
|
||||
nir_intrinsic_instr *load1 = nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_ssbo);
|
||||
load1->src[0] = nir_src_for_ssa(&src_buf->dest.ssa);
|
||||
load1->src[1] = nir_src_for_ssa(input_base);
|
||||
nir_ssa_dest_init(&load1->instr, &load1->dest, 4, 32, NULL);
|
||||
load1->num_components = 4;
|
||||
nir_builder_instr_insert(&b, &load1->instr);
|
||||
|
||||
nir_intrinsic_instr *load2 = nir_intrinsic_instr_create(b.shader, nir_intrinsic_load_ssbo);
|
||||
load2->src[0] = nir_src_for_ssa(&src_buf->dest.ssa);
|
||||
load2->src[1] = nir_src_for_ssa(nir_iadd(&b, input_base, nir_imm_int(&b, 16)));
|
||||
nir_ssa_dest_init(&load2->instr, &load2->dest, 4, 32, NULL);
|
||||
load2->num_components = 4;
|
||||
nir_builder_instr_insert(&b, &load2->instr);
|
||||
|
||||
/* Check if result is available. */
|
||||
nir_ssa_def *avails[2];
|
||||
avails[0] = nir_iand(&b, nir_channel(&b, &load1->dest.ssa, 1),
|
||||
nir_channel(&b, &load1->dest.ssa, 3));
|
||||
avails[1] = nir_iand(&b, nir_channel(&b, &load2->dest.ssa, 1),
|
||||
nir_channel(&b, &load2->dest.ssa, 3));
|
||||
nir_ssa_def *result_is_available =
|
||||
nir_iand(&b, nir_iand(&b, avails[0], avails[1]),
|
||||
nir_imm_int(&b, 0x80000000));
|
||||
|
||||
/* Only compute result if available. */
|
||||
nir_if *available_if = nir_if_create(b.shader);
|
||||
available_if->condition = nir_src_for_ssa(result_is_available);
|
||||
nir_cf_node_insert(b.cursor, &available_if->cf_node);
|
||||
|
||||
b.cursor = nir_after_cf_list(&available_if->then_list);
|
||||
|
||||
/* Pack values. */
|
||||
nir_ssa_def *packed64[4];
|
||||
packed64[0] = nir_pack_64_2x32(&b, nir_vec2(&b,
|
||||
nir_channel(&b, &load1->dest.ssa, 0),
|
||||
nir_channel(&b, &load1->dest.ssa, 1)));
|
||||
packed64[1] = nir_pack_64_2x32(&b, nir_vec2(&b,
|
||||
nir_channel(&b, &load1->dest.ssa, 2),
|
||||
nir_channel(&b, &load1->dest.ssa, 3)));
|
||||
packed64[2] = nir_pack_64_2x32(&b, nir_vec2(&b,
|
||||
nir_channel(&b, &load2->dest.ssa, 0),
|
||||
nir_channel(&b, &load2->dest.ssa, 1)));
|
||||
packed64[3] = nir_pack_64_2x32(&b, nir_vec2(&b,
|
||||
nir_channel(&b, &load2->dest.ssa, 2),
|
||||
nir_channel(&b, &load2->dest.ssa, 3)));
|
||||
|
||||
/* Compute result. */
|
||||
nir_ssa_def *num_primitive_written =
|
||||
nir_isub(&b, packed64[3], packed64[1]);
|
||||
nir_ssa_def *primitive_storage_needed =
|
||||
nir_isub(&b, packed64[2], packed64[0]);
|
||||
|
||||
nir_store_var(&b, result,
|
||||
nir_vec2(&b, num_primitive_written,
|
||||
primitive_storage_needed), 0x3);
|
||||
nir_store_var(&b, available, nir_imm_int(&b, 1), 0x1);
|
||||
|
||||
b.cursor = nir_after_cf_node(&available_if->cf_node);
|
||||
|
||||
/* Determine if result is 64 or 32 bit. */
|
||||
nir_ssa_def *result_is_64bit =
|
||||
nir_iand(&b, flags, nir_imm_int(&b, VK_QUERY_RESULT_64_BIT));
|
||||
nir_ssa_def *result_size =
|
||||
nir_bcsel(&b, result_is_64bit, nir_imm_int(&b, 16),
|
||||
nir_imm_int(&b, 8));
|
||||
|
||||
/* Store the result if complete or partial results have been requested. */
|
||||
nir_if *store_if = nir_if_create(b.shader);
|
||||
store_if->condition =
|
||||
nir_src_for_ssa(nir_ior(&b, nir_iand(&b, flags,
|
||||
nir_imm_int(&b, VK_QUERY_RESULT_PARTIAL_BIT)),
|
||||
nir_load_var(&b, available)));
|
||||
nir_cf_node_insert(b.cursor, &store_if->cf_node);
|
||||
|
||||
b.cursor = nir_after_cf_list(&store_if->then_list);
|
||||
|
||||
/* Store result. */
|
||||
nir_if *store_64bit_if = nir_if_create(b.shader);
|
||||
store_64bit_if->condition = nir_src_for_ssa(result_is_64bit);
|
||||
nir_cf_node_insert(b.cursor, &store_64bit_if->cf_node);
|
||||
|
||||
b.cursor = nir_after_cf_list(&store_64bit_if->then_list);
|
||||
|
||||
nir_intrinsic_instr *store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_store_ssbo);
|
||||
store->src[0] = nir_src_for_ssa(nir_load_var(&b, result));
|
||||
store->src[1] = nir_src_for_ssa(&dst_buf->dest.ssa);
|
||||
store->src[2] = nir_src_for_ssa(output_base);
|
||||
nir_intrinsic_set_write_mask(store, 0x3);
|
||||
store->num_components = 2;
|
||||
nir_builder_instr_insert(&b, &store->instr);
|
||||
|
||||
b.cursor = nir_after_cf_list(&store_64bit_if->else_list);
|
||||
|
||||
store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_store_ssbo);
|
||||
store->src[0] = nir_src_for_ssa(nir_u2u32(&b, nir_load_var(&b, result)));
|
||||
store->src[1] = nir_src_for_ssa(&dst_buf->dest.ssa);
|
||||
store->src[2] = nir_src_for_ssa(output_base);
|
||||
nir_intrinsic_set_write_mask(store, 0x3);
|
||||
store->num_components = 2;
|
||||
nir_builder_instr_insert(&b, &store->instr);
|
||||
|
||||
b.cursor = nir_after_cf_node(&store_64bit_if->cf_node);
|
||||
|
||||
b.cursor = nir_after_cf_node(&store_if->cf_node);
|
||||
|
||||
/* Store the availability bit if requested. */
|
||||
nir_if *availability_if = nir_if_create(b.shader);
|
||||
availability_if->condition =
|
||||
nir_src_for_ssa(nir_iand(&b, flags,
|
||||
nir_imm_int(&b, VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)));
|
||||
nir_cf_node_insert(b.cursor, &availability_if->cf_node);
|
||||
|
||||
b.cursor = nir_after_cf_list(&availability_if->then_list);
|
||||
|
||||
store = nir_intrinsic_instr_create(b.shader, nir_intrinsic_store_ssbo);
|
||||
store->src[0] = nir_src_for_ssa(nir_load_var(&b, available));
|
||||
store->src[1] = nir_src_for_ssa(&dst_buf->dest.ssa);
|
||||
store->src[2] = nir_src_for_ssa(nir_iadd(&b, result_size, output_base));
|
||||
nir_intrinsic_set_write_mask(store, 0x1);
|
||||
store->num_components = 1;
|
||||
nir_builder_instr_insert(&b, &store->instr);
|
||||
|
||||
b.cursor = nir_after_cf_node(&availability_if->cf_node);
|
||||
|
||||
return b.shader;
|
||||
}
|
||||
|
||||
static VkResult radv_device_init_meta_query_state_internal(struct radv_device *device)
|
||||
{
|
||||
VkResult result;
|
||||
struct radv_shader_module occlusion_cs = { .nir = NULL };
|
||||
struct radv_shader_module pipeline_statistics_cs = { .nir = NULL };
|
||||
struct radv_shader_module tfb_cs = { .nir = NULL };
|
||||
|
||||
mtx_lock(&device->meta_state.mtx);
|
||||
if (device->meta_state.query.pipeline_statistics_query_pipeline) {
|
||||
@@ -525,6 +747,7 @@ static VkResult radv_device_init_meta_query_state_internal(struct radv_device *d
|
||||
}
|
||||
occlusion_cs.nir = build_occlusion_query_shader(device);
|
||||
pipeline_statistics_cs.nir = build_pipeline_statistics_query_shader(device);
|
||||
tfb_cs.nir = build_tfb_query_shader(device);
|
||||
|
||||
VkDescriptorSetLayoutCreateInfo occlusion_ds_create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
|
||||
@@ -611,12 +834,34 @@ static VkResult radv_device_init_meta_query_state_internal(struct radv_device *d
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
1, &pipeline_statistics_vk_pipeline_info, NULL,
|
||||
&device->meta_state.query.pipeline_statistics_query_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
VkPipelineShaderStageCreateInfo tfb_pipeline_shader_stage = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
|
||||
.stage = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
.module = radv_shader_module_to_handle(&tfb_cs),
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = NULL,
|
||||
};
|
||||
|
||||
VkComputePipelineCreateInfo tfb_pipeline_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
|
||||
.stage = tfb_pipeline_shader_stage,
|
||||
.flags = 0,
|
||||
.layout = device->meta_state.query.p_layout,
|
||||
};
|
||||
|
||||
result = radv_CreateComputePipelines(radv_device_to_handle(device),
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
1, &tfb_pipeline_info, NULL,
|
||||
&device->meta_state.query.tfb_query_pipeline);
|
||||
fail:
|
||||
if (result != VK_SUCCESS)
|
||||
radv_device_finish_meta_query_state(device);
|
||||
ralloc_free(occlusion_cs.nir);
|
||||
ralloc_free(pipeline_statistics_cs.nir);
|
||||
ralloc_free(tfb_cs.nir);
|
||||
mtx_unlock(&device->meta_state.mtx);
|
||||
return result;
|
||||
}
|
||||
@@ -631,6 +876,11 @@ VkResult radv_device_init_meta_query_state(struct radv_device *device, bool on_d
|
||||
|
||||
void radv_device_finish_meta_query_state(struct radv_device *device)
|
||||
{
|
||||
if (device->meta_state.query.tfb_query_pipeline)
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
device->meta_state.query.tfb_query_pipeline,
|
||||
&device->meta_state.alloc);
|
||||
|
||||
if (device->meta_state.query.pipeline_statistics_query_pipeline)
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
device->meta_state.query.pipeline_statistics_query_pipeline,
|
||||
@@ -663,6 +913,7 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
|
||||
{
|
||||
struct radv_device *device = cmd_buffer->device;
|
||||
struct radv_meta_saved_state saved_state;
|
||||
bool old_predicating;
|
||||
|
||||
if (!*pipeline) {
|
||||
VkResult ret = radv_device_init_meta_query_state_internal(device);
|
||||
@@ -677,6 +928,12 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
|
||||
RADV_META_SAVE_CONSTANTS |
|
||||
RADV_META_SAVE_DESCRIPTORS);
|
||||
|
||||
/* VK_EXT_conditional_rendering says that copy commands should not be
|
||||
* affected by conditional rendering.
|
||||
*/
|
||||
old_predicating = cmd_buffer->state.predicating;
|
||||
cmd_buffer->state.predicating = false;
|
||||
|
||||
struct radv_buffer dst_buffer = {
|
||||
.bo = dst_bo,
|
||||
.offset = dst_offset,
|
||||
@@ -758,6 +1015,8 @@ static void radv_query_shader(struct radv_cmd_buffer *cmd_buffer,
|
||||
cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_INV_GLOBAL_L2 |
|
||||
RADV_CMD_FLAG_INV_VMEM_L1 |
|
||||
RADV_CMD_FLAG_CS_PARTIAL_FLUSH;
|
||||
/* Restore conditional rendering. */
|
||||
cmd_buffer->state.predicating = old_predicating;
|
||||
|
||||
radv_meta_restore(&saved_state, cmd_buffer);
|
||||
}
|
||||
@@ -1115,6 +1374,33 @@ void radv_CmdCopyQueryPoolResults(
|
||||
assert(cs->cdw <= cdw_max);
|
||||
}
|
||||
break;
|
||||
case VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT:
|
||||
if (flags & VK_QUERY_RESULT_WAIT_BIT) {
|
||||
for(unsigned i = 0; i < queryCount; i++) {
|
||||
unsigned query = firstQuery + i;
|
||||
uint64_t src_va = va + query * pool->stride;
|
||||
|
||||
/* Wait on the upper word of all results. */
|
||||
for (unsigned j = 0; j < 4; j++, src_va += 8) {
|
||||
radeon_emit(cs, PKT3(PKT3_WAIT_REG_MEM, 5, 0));
|
||||
radeon_emit(cs, WAIT_REG_MEM_GREATER_OR_EQUAL |
|
||||
WAIT_REG_MEM_MEM_SPACE(1));
|
||||
radeon_emit(cs, (src_va + 4));
|
||||
radeon_emit(cs, (src_va + 4) >> 32);
|
||||
radeon_emit(cs, 0x80000000); /* reference value */
|
||||
radeon_emit(cs, 0xffffffff); /* mask */
|
||||
radeon_emit(cs, 4); /* poll interval */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
radv_query_shader(cmd_buffer, &cmd_buffer->device->meta_state.query.tfb_query_pipeline,
|
||||
pool->bo, dst_buffer->bo,
|
||||
firstQuery * pool->stride,
|
||||
dst_buffer->offset + dstOffset,
|
||||
pool->stride, stride,
|
||||
queryCount, flags, 0, 0);
|
||||
break;
|
||||
default:
|
||||
unreachable("trying to get results of unhandled query type");
|
||||
}
|
||||
|
@@ -892,7 +892,8 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
|
||||
}
|
||||
if (unsized_array) {
|
||||
if (is_initializer) {
|
||||
return rhs;
|
||||
if (rhs->type->get_scalar_type() == lhs->type->get_scalar_type())
|
||||
return rhs;
|
||||
} else {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"implicitly sized arrays cannot be assigned");
|
||||
|
@@ -391,6 +391,34 @@ evaluate_if_condition(nir_if *nif, nir_cursor cursor, bool *value)
|
||||
}
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
clone_alu_and_replace_src_defs(nir_builder *b, const nir_alu_instr *alu,
|
||||
nir_ssa_def **src_defs)
|
||||
{
|
||||
nir_alu_instr *nalu = nir_alu_instr_create(b->shader, alu->op);
|
||||
nalu->exact = alu->exact;
|
||||
|
||||
nir_ssa_dest_init(&nalu->instr, &nalu->dest.dest,
|
||||
alu->dest.dest.ssa.num_components,
|
||||
alu->dest.dest.ssa.bit_size, alu->dest.dest.ssa.name);
|
||||
|
||||
nalu->dest.saturate = alu->dest.saturate;
|
||||
nalu->dest.write_mask = alu->dest.write_mask;
|
||||
|
||||
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
|
||||
assert(alu->src[i].src.is_ssa);
|
||||
nalu->src[i].src = nir_src_for_ssa(src_defs[i]);
|
||||
nalu->src[i].negate = alu->src[i].negate;
|
||||
nalu->src[i].abs = alu->src[i].abs;
|
||||
memcpy(nalu->src[i].swizzle, alu->src[i].swizzle,
|
||||
sizeof(nalu->src[i].swizzle));
|
||||
}
|
||||
|
||||
nir_builder_instr_insert(b, &nalu->instr);
|
||||
|
||||
return &nalu->dest.dest.ssa;;
|
||||
}
|
||||
|
||||
/*
|
||||
* This propagates if condition evaluation down the chain of some alu
|
||||
* instructions. For example by checking the use of some of the following alu
|
||||
@@ -448,7 +476,7 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
|
||||
if (!evaluate_if_condition(nif, b->cursor, &bool_value))
|
||||
return false;
|
||||
|
||||
nir_ssa_def *def[2] = {0};
|
||||
nir_ssa_def *def[4] = {0};
|
||||
for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
|
||||
if (alu->src[i].src.ssa == use_src->ssa) {
|
||||
def[i] = nir_imm_bool(b, bool_value);
|
||||
@@ -456,7 +484,8 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
|
||||
def[i] = alu->src[i].src.ssa;
|
||||
}
|
||||
}
|
||||
nir_ssa_def *nalu = nir_build_alu(b, alu->op, def[0], def[1], NULL, NULL);
|
||||
|
||||
nir_ssa_def *nalu = clone_alu_and_replace_src_defs(b, alu, def);
|
||||
|
||||
/* Rewrite use to use new alu instruction */
|
||||
nir_src new_src = nir_src_for_ssa(nalu);
|
||||
@@ -472,14 +501,21 @@ propagate_condition_eval(nir_builder *b, nir_if *nif, nir_src *use_src,
|
||||
static bool
|
||||
can_propagate_through_alu(nir_src *src)
|
||||
{
|
||||
if (src->parent_instr->type == nir_instr_type_alu &&
|
||||
(nir_instr_as_alu(src->parent_instr)->op == nir_op_ior ||
|
||||
nir_instr_as_alu(src->parent_instr)->op == nir_op_iand ||
|
||||
nir_instr_as_alu(src->parent_instr)->op == nir_op_inot ||
|
||||
nir_instr_as_alu(src->parent_instr)->op == nir_op_b2i))
|
||||
return true;
|
||||
if (src->parent_instr->type != nir_instr_type_alu)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
nir_alu_instr *alu = nir_instr_as_alu(src->parent_instr);
|
||||
switch (alu->op) {
|
||||
case nir_op_ior:
|
||||
case nir_op_iand:
|
||||
case nir_op_inot:
|
||||
case nir_op_b2i:
|
||||
return true;
|
||||
case nir_op_bcsel:
|
||||
return src == &alu->src[0].src;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@@ -1661,8 +1661,8 @@ swrast_update_buffers(struct dri2_egl_surface *dri2_surf)
|
||||
if (dri2_surf->back)
|
||||
return 0;
|
||||
|
||||
if (dri2_surf->base.Width != dri2_surf->wl_win->attached_width ||
|
||||
dri2_surf->base.Height != dri2_surf->wl_win->attached_height) {
|
||||
if (dri2_surf->base.Width != dri2_surf->wl_win->width ||
|
||||
dri2_surf->base.Height != dri2_surf->wl_win->height) {
|
||||
|
||||
dri2_wl_release_buffers(dri2_surf);
|
||||
|
||||
|
@@ -199,5 +199,12 @@ EGL_FUNCTIONS = (
|
||||
# EGL_EXT_image_dma_buf_import_modifiers
|
||||
_eglFunc("eglQueryDmaBufFormatsEXT", "display"),
|
||||
_eglFunc("eglQueryDmaBufModifiersEXT", "display"),
|
||||
|
||||
# EGL_EXT_device_base
|
||||
_eglFunc("eglQueryDeviceAttribEXT", "device"),
|
||||
_eglFunc("eglQueryDeviceStringEXT", "device"),
|
||||
_eglFunc("eglQueryDevicesEXT", "none"),
|
||||
_eglFunc("eglQueryDisplayAttribEXT", "display"),
|
||||
|
||||
)
|
||||
|
||||
|
@@ -59,6 +59,11 @@ static __eglMustCastToProperFunctionPointerType FetchVendorFunc(__EGLvendorInfo
|
||||
}
|
||||
if (func == NULL) {
|
||||
if (errorCode != EGL_SUCCESS) {
|
||||
// Since we have no vendor, the follow-up eglGetError() call will
|
||||
// end up using the GLVND error code. Set it here.
|
||||
if (vendor == NULL) {
|
||||
exports->setEGLError(errorCode);
|
||||
}
|
||||
_eglError(errorCode, __EGL_DISPATCH_FUNC_NAMES[index]);
|
||||
}
|
||||
return NULL;
|
||||
|
@@ -36,7 +36,8 @@ LOCAL_SRC_FILES := \
|
||||
util/u_debug_stack_android.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(GALLIUM_TOP)/auxiliary/util
|
||||
$(GALLIUM_TOP)/auxiliary/util \
|
||||
$(MESA_TOP)/src/util
|
||||
|
||||
ifeq ($(MESA_ENABLE_LLVM),true)
|
||||
LOCAL_SRC_FILES += \
|
||||
|
@@ -567,7 +567,7 @@ int bc_builder::build_fetch_gds(fetch_node *n) {
|
||||
const fetch_op_info *fop = bc.op_ptr;
|
||||
unsigned gds_op = (ctx.fetch_opcode(bc.op) >> 8) & 0x3f;
|
||||
unsigned mem_op = 4;
|
||||
assert(fop->flags && FF_GDS);
|
||||
assert(fop->flags & FF_GDS);
|
||||
|
||||
if (bc.op == FETCH_OP_TF_WRITE) {
|
||||
mem_op = 5;
|
||||
|
@@ -598,10 +598,8 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface,
|
||||
return VA_STATUS_SUCCESS;
|
||||
|
||||
fail:
|
||||
for (i = 0; i < VL_NUM_COMPONENTS; i++) {
|
||||
if (resources[i])
|
||||
pscreen->resource_destroy(pscreen, resources[i]);
|
||||
}
|
||||
for (i = 0; i < VL_NUM_COMPONENTS; i++)
|
||||
pipe_resource_reference(&resources[i], NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -53,7 +53,7 @@ libgallium_nine = shared_library(
|
||||
libswkmsdri,
|
||||
],
|
||||
dependencies : [
|
||||
dep_selinux, dep_expat, dep_libdrm, dep_llvm,
|
||||
dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_thread,
|
||||
driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
|
||||
driver_i915, driver_svga,
|
||||
],
|
||||
|
@@ -559,7 +559,7 @@ virgl_cs_create_fence(struct virgl_winsys *vws)
|
||||
res = virgl_vtest_winsys_resource_cache_create(vws,
|
||||
PIPE_BUFFER,
|
||||
PIPE_FORMAT_R8_UNORM,
|
||||
PIPE_BIND_CUSTOM,
|
||||
VIRGL_BIND_CUSTOM,
|
||||
8, 1, 1, 0, 0, 0, 8);
|
||||
|
||||
return (struct pipe_fence_handle *)res;
|
||||
|
@@ -214,7 +214,7 @@ handle_state_base_address(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
|
||||
surface_modify = iter.raw_value;
|
||||
} else if (strcmp(iter.name, "Dynamic State Base Address Modify Enable") == 0) {
|
||||
dynamic_modify = iter.raw_value;
|
||||
} else if (strcmp(iter.name, "Insntruction Base Address Modify Enable") == 0) {
|
||||
} else if (strcmp(iter.name, "Instruction Base Address Modify Enable") == 0) {
|
||||
instruction_modify = iter.raw_value;
|
||||
}
|
||||
}
|
||||
|
@@ -172,7 +172,7 @@ handle_state_base_address(struct aub_viewer_decode_ctx *ctx,
|
||||
surface_modify = iter.raw_value;
|
||||
} else if (strcmp(iter.name, "Dynamic State Base Address Modify Enable") == 0) {
|
||||
dynamic_modify = iter.raw_value;
|
||||
} else if (strcmp(iter.name, "Insntruction Base Address Modify Enable") == 0) {
|
||||
} else if (strcmp(iter.name, "Instruction Base Address Modify Enable") == 0) {
|
||||
instruction_modify = iter.raw_value;
|
||||
}
|
||||
}
|
||||
|
@@ -128,7 +128,7 @@ anv_image_from_gralloc(VkDevice device_h,
|
||||
*/
|
||||
int dma_buf = gralloc_info->handle->data[0];
|
||||
|
||||
uint64_t bo_flags = 0;
|
||||
uint64_t bo_flags = ANV_BO_EXTERNAL;
|
||||
if (device->instance->physicalDevice.supports_48bit_addresses)
|
||||
bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
|
||||
if (device->instance->physicalDevice.use_softpin)
|
||||
|
@@ -60,7 +60,8 @@ libmesautil_la_LIBADD = \
|
||||
$(PTHREAD_LIBS) \
|
||||
$(CLOCK_LIB) \
|
||||
$(ZLIB_LIBS) \
|
||||
$(LIBATOMIC_LIBS)
|
||||
$(LIBATOMIC_LIBS) \
|
||||
-lm
|
||||
|
||||
libxmlconfig_la_SOURCES = $(XMLCONFIG_FILES)
|
||||
libxmlconfig_la_CFLAGS = \
|
||||
|
@@ -119,7 +119,7 @@ libmesa_util = static_library(
|
||||
'mesa_util',
|
||||
[files_mesa_util, format_srgb],
|
||||
include_directories : inc_common,
|
||||
dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic],
|
||||
dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
|
||||
c_args : [c_msvc_compat_args, c_vis_args],
|
||||
build_by_default : false
|
||||
)
|
||||
|
@@ -455,10 +455,11 @@ wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
|
||||
(struct wsi_wayland *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND];
|
||||
|
||||
struct wsi_wl_display display;
|
||||
int ret = wsi_wl_display_init(wsi, &display, wl_display, false);
|
||||
wsi_wl_display_finish(&display);
|
||||
VkResult ret = wsi_wl_display_init(wsi, &display, wl_display, false);
|
||||
if (ret == VK_SUCCESS)
|
||||
wsi_wl_display_finish(&display);
|
||||
|
||||
return ret == 0;
|
||||
return ret == VK_SUCCESS;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
|
Reference in New Issue
Block a user