diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-12-04 23:58:38 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-12-05 00:15:37 -0500 |
| commit | fff445cc104757b0c75daa8bbeff685c85d88e70 (patch) | |
| tree | e7cc913171e8a70755224a231e2ead60a2adb244 /Source/Core/VideoCommon | |
| parent | 3405815f0904eb2113be89f4eab4198d8a409ae1 (diff) | |
VideoCommon/FramebufferShaderGen: Make use of std::string_view where applicable
Prevents the use of the null pointer as an input to any functions.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferShaderGen.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/FramebufferShaderGen.cpp b/Source/Core/VideoCommon/FramebufferShaderGen.cpp index 7b8e729a35..f0d86fbbbc 100644 --- a/Source/Core/VideoCommon/FramebufferShaderGen.cpp +++ b/Source/Core/VideoCommon/FramebufferShaderGen.cpp @@ -5,6 +5,7 @@ #include "VideoCommon/FramebufferShaderGen.h" #include <sstream> +#include <string_view> #include "VideoCommon/FramebufferManager.h" #include "VideoCommon/TextureDecoder.h" @@ -59,7 +60,7 @@ void EmitSamplerDeclarations(std::stringstream& ss, u32 start = 0, u32 end = 1, } } -void EmitSampleTexture(std::stringstream& ss, u32 n, const char* coords) +void EmitSampleTexture(std::stringstream& ss, u32 n, std::string_view coords) { switch (GetAPIType()) { @@ -79,7 +80,7 @@ void EmitSampleTexture(std::stringstream& ss, u32 n, const char* coords) // Emits a texel fetch/load instruction. Assumes that "coords" is a 4-element vector, with z // containing the layer, and w containing the mipmap level. -void EmitTextureLoad(std::stringstream& ss, u32 n, const char* coords) +void EmitTextureLoad(std::stringstream& ss, u32 n, std::string_view coords) { switch (GetAPIType()) { @@ -99,7 +100,7 @@ void EmitTextureLoad(std::stringstream& ss, u32 n, const char* coords) void EmitVertexMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, u32 num_color_inputs, bool position_input, u32 num_tex_outputs, u32 num_color_outputs, - const char* extra_inputs = "") + std::string_view extra_inputs = {}) { switch (GetAPIType()) { @@ -164,8 +165,8 @@ void EmitVertexMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, u32 nu } void EmitPixelMainDeclaration(std::stringstream& ss, u32 num_tex_inputs, u32 num_color_inputs, - const char* output_type = "float4", const char* extra_vars = "", - bool emit_frag_coord = false) + std::string_view output_type = "float4", + std::string_view extra_vars = {}, bool emit_frag_coord = false) { switch (GetAPIType()) { |
