summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader
diff options
context:
space:
mode:
authornamkazy <nam.kazt.91@gmail.com>2020-03-22 15:13:07 +0100
committernamkazy <nam.kazt.91@gmail.com>2020-04-05 05:31:32 +0200
commitacd3f0ab37520e449471040c1b7ccc6208f8e823 (patch)
tree1e08795a446c7af18d9b53f1834d69fa92bb917a /src/video_core/shader
parentclang-format (diff)
downloadyuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.tar
yuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.tar.gz
yuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.tar.bz2
yuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.tar.lz
yuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.tar.xz
yuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.tar.zst
yuzu-acd3f0ab37520e449471040c1b7ccc6208f8e823.zip
Diffstat (limited to 'src/video_core/shader')
-rw-r--r--src/video_core/shader/decode/image.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/shader/decode/image.cpp b/src/video_core/shader/decode/image.cpp
index cc5d2424c..07eb36153 100644
--- a/src/video_core/shader/decode/image.cpp
+++ b/src/video_core/shader/decode/image.cpp
@@ -2,8 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#pragma optimize("", off)
-
#include <algorithm>
#include <vector>
#include <fmt/format.h>
@@ -323,6 +321,7 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
switch (instr.suldst.GetStoreDataLayout()) {
case StoreType::Bits32: {
u32 shifted_counter = 0;
+ // value should be RGBA format
Node value = Immediate(0);
for (u32 element = 0; element < 4; ++element) {
if (!IsComponentEnabled(comp_mask, element)) {
@@ -334,6 +333,7 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
MetaImage meta{image, {}, element};
const Node original_value =
Operation(OperationCode::ImageLoad, meta, GetCoordinates(type));
+
Node converted_value = [&] {
switch (component_type) {
case ComponentType::SNORM: {
@@ -346,7 +346,7 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
case ComponentType::UNORM: {
// range [0.0, 1.0]
auto cnv_value =
- Operation(OperationCode::FMul, original_value, Immediate(255.f));
+ Operation(OperationCode::FMul, original_value, Immediate(256.f));
is_signed = false;
return SignedOperation(OperationCode::ICastFloat, is_signed,
std::move(cnv_value));