D3DCommon/Shader: Use std::optional with CompileShader()

Allows removing the use of an out parameter, making it nicer to use.
This commit is contained in:
Lioncash
2019-07-26 19:34:27 -04:00
parent 0ce6264f90
commit aca02f9734
4 changed files with 13 additions and 14 deletions

View File

@ -4,6 +4,7 @@
#pragma once
#include <optional>
#include <string_view>
#include "VideoBackends/D3DCommon/Common.h"
#include "VideoCommon/AbstractShader.h"
@ -19,8 +20,8 @@ public:
BinaryData GetBinary() const override;
static bool CompileShader(D3D_FEATURE_LEVEL feature_level, BinaryData* out_bytecode,
ShaderStage stage, std::string_view source);
static std::optional<BinaryData> CompileShader(D3D_FEATURE_LEVEL feature_level, ShaderStage stage,
std::string_view source);
static BinaryData CreateByteCode(const void* data, size_t length);