Merge pull request #318 from KhronosGroup/warning-fix

Fix some warnings on older GCC.
This commit is contained in:
Hans-Kristian Arntzen 2017-11-06 10:12:55 +01:00 committed by GitHub
commit 42f9e76276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -2408,9 +2408,9 @@ uint32_t Compiler::get_work_group_size_specialization_constants(SpecializationCo
SpecializationConstant &z) const
{
auto &execution = get_entry_point();
x = {};
y = {};
z = {};
x = { 0, 0 };
y = { 0, 0 };
z = { 0, 0 };
if (execution.workgroup_size.constant != 0)
{

View File

@ -2609,21 +2609,21 @@ void CompilerHLSL::emit_atomic(const uint32_t *ops, uint32_t length, spv::Op op)
auto &data_type = expression_type(ops[2]);
auto *chain = maybe_get<SPIRAccessChain>(ops[2]);
SPIRType::BaseType expression_type;
SPIRType::BaseType expr_type;
if (data_type.storage == StorageClassImage || !chain)
{
statement(atomic_op, "(", to_expression(ops[2]), ", ", value_expr, ", ", to_name(id), ");");
expression_type = data_type.basetype;
expr_type = data_type.basetype;
}
else
{
// RWByteAddress buffer is always uint in its underlying type.
expression_type = SPIRType::UInt;
expr_type = SPIRType::UInt;
statement(chain->base, ".", atomic_op, "(", chain->dynamic_index, chain->static_index, ", ", value_expr, ", ",
to_name(id), ");");
}
auto expr = bitcast_expression(type, expression_type, to_name(id));
auto expr = bitcast_expression(type, expr_type, to_name(id));
set<SPIRExpression>(id, expr, result_type, true);
flush_all_atomic_capable_variables();
register_read(ops[1], ops[2], should_forward(ops[2]));

View File

@ -1348,7 +1348,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
string img_exp = to_expression(img_id);
auto &img_type = expression_type(img_id);
Dim img_dim = img_type.image.dim;
bool is_array = img_type.image.arrayed;
bool img_is_array = img_type.image.arrayed;
if (img_type.basetype != SPIRType::Image)
SPIRV_CROSS_THROW("Invalid type for OpImageQuerySize.");
@ -1371,7 +1371,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
if (img_dim == Dim3D)
expr += ", " + img_exp + ".get_depth(" + lod + ")";
if (is_array)
if (img_is_array)
expr += ", " + img_exp + ".get_array_size()";
expr += ")";