diff options
| author | 2019-03-27 14:59:00 -0400 | |
|---|---|---|
| committer | 2019-04-07 07:52:01 -0400 | |
| commit | 021cd56bc98aec220b85c2049e1edb5c02714294 (patch) | |
| tree | 815d65ee43f554d4dd44f65b81f3428c7bbf492d /src/video_core | |
| parent | Merge pull request #2285 from lioncash/unused-struct (diff) | |
| download | yuzu-021cd56bc98aec220b85c2049e1edb5c02714294.tar.gz yuzu-021cd56bc98aec220b85c2049e1edb5c02714294.tar.xz yuzu-021cd56bc98aec220b85c2049e1edb5c02714294.zip | |
Permit a Null Shader in case of a bad host_ptr.
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 1f8eca6f0..a9d88000e 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -41,6 +41,10 @@ GPUVAddr GetShaderAddress(Maxwell::ShaderProgram program) { | |||
| 41 | /// Gets the shader program code from memory for the specified address | 41 | /// Gets the shader program code from memory for the specified address |
| 42 | ProgramCode GetShaderCode(const u8* host_ptr) { | 42 | ProgramCode GetShaderCode(const u8* host_ptr) { |
| 43 | ProgramCode program_code(VideoCommon::Shader::MAX_PROGRAM_LENGTH); | 43 | ProgramCode program_code(VideoCommon::Shader::MAX_PROGRAM_LENGTH); |
| 44 | ASSERT_OR_EXECUTE(host_ptr != nullptr, { | ||
| 45 | std::fill(program_code.begin(), program_code.end(), 0); | ||
| 46 | return program_code; | ||
| 47 | }); | ||
| 44 | std::memcpy(program_code.data(), host_ptr, program_code.size() * sizeof(u64)); | 48 | std::memcpy(program_code.data(), host_ptr, program_code.size() * sizeof(u64)); |
| 45 | return program_code; | 49 | return program_code; |
| 46 | } | 50 | } |