Do not output layouts for uniforms in HLSL

This commit is contained in:
Robert Konrad 2017-01-24 09:23:22 +01:00
parent 99469f0690
commit c3268c9410
3 changed files with 9 additions and 1 deletions

View File

@ -178,6 +178,7 @@ protected:
virtual std::string clean_func_name(std::string func_name);
virtual void emit_buffer_block(const SPIRVariable &type);
virtual void emit_push_constant_block(const SPIRVariable &var);
virtual void emit_uniform(const SPIRVariable &var);
std::unique_ptr<std::ostringstream> buffer;
@ -283,7 +284,6 @@ protected:
void emit_specialization_constant(const SPIRConstant &constant);
std::string emit_continue_block(uint32_t continue_block);
bool attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method method);
void emit_uniform(const SPIRVariable &var);
void propagate_loop_dominators(const SPIRBlock &block);
void branch(uint32_t from, uint32_t to);

View File

@ -937,6 +937,13 @@ void CompilerHLSL::emit_binary_func_op_transpose_all(uint32_t result_type, uint3
}
}
void CompilerHLSL::emit_uniform(const SPIRVariable &var)
{
auto &type = get<SPIRType>(var.basetype);
add_resource_name(var.self);
statement("uniform ", variable_decl(var), ";");
}
void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t count)
{
GLSLstd450 op = static_cast<GLSLstd450>(eop);

View File

@ -68,6 +68,7 @@ private:
uint32_t count) override;
void emit_buffer_block(const SPIRVariable &type) override;
void emit_push_constant_block(const SPIRVariable &var) override;
void emit_uniform(const SPIRVariable &var) override;
Options options;
bool requires_op_fmod = false;