diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 7030db365..ab381932c 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -39,6 +39,10 @@ GPUVAddr GetShaderAddress(Maxwell::ShaderProgram program) { | |||
| 39 | /// Gets the shader program code from memory for the specified address | 39 | /// Gets the shader program code from memory for the specified address |
| 40 | ProgramCode GetShaderCode(const u8* host_ptr) { | 40 | ProgramCode GetShaderCode(const u8* host_ptr) { |
| 41 | ProgramCode program_code(VideoCommon::Shader::MAX_PROGRAM_LENGTH); | 41 | ProgramCode program_code(VideoCommon::Shader::MAX_PROGRAM_LENGTH); |
| 42 | ASSERT_OR_EXECUTE(host_ptr != nullptr, { | ||
| 43 | std::fill(program_code.begin(), program_code.end(), 0); | ||
| 44 | return program_code; | ||
| 45 | }); | ||
| 42 | std::memcpy(program_code.data(), host_ptr, program_code.size() * sizeof(u64)); | 46 | std::memcpy(program_code.data(), host_ptr, program_code.size() * sizeof(u64)); |
| 43 | return program_code; | 47 | return program_code; |
| 44 | } | 48 | } |