d3d12: Misc fixes caught by GCC warnings / code inspection

* A const-correctness issue
* Some uninitialized variables
* A missing copyright header
* A comment with a /* in it when only * was needed

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
This commit is contained in:
Jesse Natalie 2020-11-25 17:15:11 -08:00 committed by Marge Bot
parent 4e481a1f65
commit 456620a6ad
4 changed files with 27 additions and 3 deletions

View File

@ -1437,7 +1437,7 @@ d3d12_disable_fake_so_buffers(struct d3d12_context *ctx)
for (unsigned i = 0; i < ctx->gfx_pipeline_state.num_so_targets; ++i) {
struct d3d12_stream_output_target *target = (struct d3d12_stream_output_target *)ctx->so_targets[i];
struct d3d12_stream_output_target *fake_target = (struct d3d12_stream_output_target *)ctx->fake_so_targets[i];
uint64_t filled_size;
uint64_t filled_size = 0;
struct pipe_transfer *src_transfer, *dst_transfer;
uint8_t *src, *dst;

View File

@ -1,3 +1,25 @@
/*
* Copyright © Microsoft Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "d3d12_fence.h"

View File

@ -572,7 +572,7 @@ d3d12_create_bare_samplers(nir_shader *nir)
const struct glsl_type *type = glsl_without_array(var->type);
if (glsl_type_is_sampler(type) && glsl_get_sampler_result_type(type) != GLSL_TYPE_VOID) {
/* Since samplers are already lowered to be accessed by index, all we need to do
/* here is create a bare sampler with the same binding */
* here is create a bare sampler with the same binding */
nir_variable *clone = nir_variable_clone(var, nir);
clone->type = get_bare_samplers_for_type(var->type);
nir_shader_add_variable(nir, clone);
@ -792,7 +792,7 @@ lower_load_ubo_packed_filter(const nir_instr *instr,
static nir_ssa_def *
lower_load_ubo_packed_impl(nir_builder *b, nir_instr *instr,
UNUSED const void *_options) {
UNUSED void *_options) {
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
nir_ssa_def *buffer = intr->src[0].ssa;

View File

@ -897,6 +897,8 @@ d3d12_transfer_map(struct pipe_context *pctx,
ptr = read_zs_surface(ctx, res, box, trans);
} else if (usage & PIPE_MAP_WRITE){
ptr = prepare_write_zs_surface(res, box, trans);
} else {
ptr = nullptr;
}
} else {
ptrans->stride = align(util_format_get_stride(pres->format, box->width),