First pass ShaderTranslator base type, able to disasm in msft style.

This commit is contained in:
Ben Vanik
2015-11-28 16:19:04 -08:00
parent bea8870700
commit 65130edaa1
11 changed files with 2796 additions and 716 deletions

View File

@@ -1151,6 +1151,17 @@ Id SpirvEmitter::CreateExtendedInstructionCall(spv::Decoration precision,
return instr->result_id();
}
Id SpirvEmitter::CreateGlslStd450InstructionCall(
spv::Decoration precision, Id result_type,
spv::GLSLstd450 instruction_ordinal, std::initializer_list<Id> args) {
if (!glsl_std_450_instruction_set_) {
glsl_std_450_instruction_set_ = ImportExtendedInstructions("GLSL.std.450");
}
return CreateExtendedInstructionCall(
precision, result_type, glsl_std_450_instruction_set_,
static_cast<int>(instruction_ordinal), args);
}
// Accept all parameters needed to create a texture instruction.
// Create the correct instruction based on the inputs, and make the call.
Id SpirvEmitter::CreateTextureCall(spv::Decoration precision, Id result_type,

View File

@@ -373,6 +373,10 @@ class SpirvEmitter {
Id CreateExtendedInstructionCall(spv::Decoration precision, Id result_type,
Id instruction_set, int instruction_ordinal,
std::initializer_list<Id> args);
// Executes an instruction from the extended GLSL set.
Id CreateGlslStd450InstructionCall(spv::Decoration precision, Id result_type,
spv::GLSLstd450 instruction_ordinal,
std::initializer_list<Id> args);
// List of parameters used to create a texture operation
struct TextureParameters {
@@ -655,6 +659,7 @@ class SpirvEmitter {
Id unique_id_ = 0;
Function* main_function_ = nullptr;
AccessChain access_chain_;
Id glsl_std_450_instruction_set_ = 0;
// special blocks of instructions for output
std::vector<Instruction*> imports_;