Skip to content

Commit c7ec08a

Browse files
committed
shaders: Fix curvature shader
1 parent 5dc9acb commit c7ec08a

File tree

4 files changed

+50
-64
lines changed

4 files changed

+50
-64
lines changed

deps/imgui

Submodule imgui updated 72 files

frontend/iris.hpp

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -241,54 +241,54 @@ struct vulkan_gpu {
241241
uint32_t api_version = 0;
242242
};
243243

244-
template <typename Key, typename Value> class bidirectional_map {
245-
std::unordered_map<Key, Value> m_forward_map;
246-
std::unordered_map<Value, Key> m_reverse_map;
244+
// template <typename Key, typename Value> class bidirectional_map {
245+
// std::unordered_map<Key, Value> m_forward_map;
246+
// std::unordered_map<Value, Key> m_reverse_map;
247247

248-
public:
249-
void insert(const Key& key, const Value& value) {
250-
m_forward_map[key] = value;
251-
m_reverse_map[value] = key;
252-
}
253-
254-
bool erase_by_key(const Key& key) {
255-
auto it = m_forward_map.find(key);
256-
if (it != m_forward_map.end()) {
257-
Value value = it->second;
258-
m_forward_map.erase(it);
259-
m_reverse_map.erase(value);
260-
return true;
261-
}
262-
return false;
263-
}
264-
265-
bool erase_by_value(const Value& value) {
266-
auto it = m_reverse_map.find(value);
267-
if (it != m_reverse_map.end()) {
268-
Key key = it->second;
269-
m_reverse_map.erase(it);
270-
m_forward_map.erase(key);
271-
return true;
272-
}
273-
return false;
274-
}
275-
276-
Value* get_value(const Key& key) {
277-
auto it = m_forward_map.find(key);
278-
if (it != m_forward_map.end()) {
279-
return &it->second;
280-
}
281-
return nullptr;
282-
}
283-
284-
Key* get_key(const Value& value) {
285-
auto it = m_reverse_map.find(value);
286-
if (it != m_reverse_map.end()) {
287-
return &it->second;
288-
}
289-
return nullptr;
290-
}
291-
};
248+
// public:
249+
// void insert(const Key& key, const Value& value) {
250+
// m_forward_map[key] = value;
251+
// m_reverse_map[value] = key;
252+
// }
253+
254+
// bool erase_by_key(const Key& key) {
255+
// auto it = m_forward_map.find(key);
256+
// if (it != m_forward_map.end()) {
257+
// Value value = it->second;
258+
// m_forward_map.erase(it);
259+
// m_reverse_map.erase(value);
260+
// return true;
261+
// }
262+
// return false;
263+
// }
264+
265+
// bool erase_by_value(const Value& value) {
266+
// auto it = m_reverse_map.find(value);
267+
// if (it != m_reverse_map.end()) {
268+
// Key key = it->second;
269+
// m_reverse_map.erase(it);
270+
// m_forward_map.erase(key);
271+
// return true;
272+
// }
273+
// return false;
274+
// }
275+
276+
// Value* get_value(const Key& key) {
277+
// auto it = m_forward_map.find(key);
278+
// if (it != m_forward_map.end()) {
279+
// return &it->second;
280+
// }
281+
// return nullptr;
282+
// }
283+
284+
// Key* get_key(const Value& value) {
285+
// auto it = m_reverse_map.find(value);
286+
// if (it != m_reverse_map.end()) {
287+
// return &it->second;
288+
// }
289+
// return nullptr;
290+
// }
291+
// };
292292

293293
struct instance {
294294
SDL_Window* window = nullptr;
@@ -493,7 +493,7 @@ struct instance {
493493
bool screenshot_shader_processing = false;
494494
input_device* input_devices[2] = { nullptr };
495495
std::unordered_map <SDL_JoystickID, SDL_Gamepad*> gamepads;
496-
bidirectional_map <input_event, input_action> input_map;
496+
// bidirectional_map <input_event, input_action> input_map;
497497
bool limit_fps = true;
498498
float fps_cap = 60.0f;
499499

shaders/curvature.frag

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,12 @@ float sinc(float x) {
4545

4646
void main() {
4747
vec2 uv = curvature(TexCoord, 5.5);
48-
vec3 rgb = texture(input_tex, uv).xyz;
4948

5049
if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {
5150
FragColor = vec4(0.0);
5251

5352
return;
5453
}
5554

56-
// uv *= PushConstants.resolution;
57-
58-
// for (int y = -FIR_WIDTH; y < FIR_WIDTH; y++) {
59-
// for (int x = -FIR_WIDTH; x < FIR_WIDTH; x++) {
60-
// vec2 p = vec2(uv.x + float(x), uv.y + float(y));
61-
// vec3 c = texture(input_tex, p / PushConstants.resolution).xyz;
62-
63-
// rgb += c;
64-
// }
65-
// }
66-
67-
// rgb /= 4.0;
68-
69-
FragColor = vec4(rgb, 1.0);
55+
FragColor = texture(input_tex, uv).xyzw;
7056
}

shaders/curvature.spv

-296 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)