Comments (12)
Open GL !
from kinc.
Please use the issue template so I get the necessary info. What revision of Kinc are you on? Is this OpenGL?
from kinc.
Hi,
Kha commit 206d1ee3
Kinc commit b4d0aed
I pinpointed the issue to getTextureUnit().
It's possible to read / write to texture2 in the example only if the first set texture units is texture2. Subsequent calls seem to ignore bindings.
from kinc.
ok, you already answered 50% of my questions, good progress.
from kinc.
Hello, I looked into the code and I see that the getTextureUnit() has the job of allocation the computeTextureUnits, it gives these a binding point. What I can tell from further tests is that all compute textures seem to share the same binding point:
As I said, the only image that can be written / read is the first that we allocate, and I also noted that even when writing to another image in the compute shader, the operation will occur on the first allocated one anyway.
from kinc.
But when will you tell me what graphics backend you are using so I can check what you are talking about?
from kinc.
Hello, I have checked out Kha and Kinc to main and pulled the lattest changes.
There are compilations errors:
`../../../Kha/Backends/Kinc-hxcpp/main.cpp: In function ‘void {anonymous}::mix(kinc_a2_buffer_t*, int, void*)’:
../../../Kha/Backends/Kinc-hxcpp/main.cpp:229:74: error: ‘kinc_a2_buffer_t’ {aka ‘struct kinc_a2_buffer’} has no member named ‘format’
229 | ::kha::audio2::Audio_obj::_callCallback(samples, buffer->format.samples_per_second);
| ^~~~~~
../../../Kha/Backends/Kinc-hxcpp/main.cpp:239:44: error: ‘kinc_a2_buffer_t’ {aka ‘struct kinc_a2_buffer’} has no member named ‘data’
239 | *(float *)&buffer->data[buffer->write_location] = value;
| ^~~~
../../../Kha/Backends/Kinc-hxcpp/main.cpp: In function ‘void kha_kinc_init_audio()’:
../../../Kha/Backends/Kinc-hxcpp/main.cpp:343:30: error: invalid conversion from ‘void (*)(kinc_a2_buffer_t*, int, void*)’ {aka ‘void (*)(kinc_a2_buffer*, int, void*)’} to ‘void (*)(kinc_a2_buffer_t*, uint32_t, void*)’ {aka ‘void (*)(kinc_a2_buffer*, unsigned int, void*)’} [-fpermissive]
343 | kinc_a2_set_callback(mix, nullptr);
/Kha/Backends/Kinc-hxcpp/main.cpp:345:54: error: invalid conversion from ‘uint32_t (*)()’ {aka ‘unsigned int (*)()’} to ‘int’ [-fpermissive]
345 | ::kha::audio2::Audio_obj::samplesPerSecond = kinc_a2_samples_per_second;
from kinc.
I know, I'm currently merging and fixing up a feature-branch. Check the test status before pulling and especially before reporting, please - when it shows a red x, I already know about it. Also please don't add unrelated things into a GitHub issue.
from kinc.
Ok, thanks for reminding.
from kinc.
Hi rob,
I've added some printf statements to the kinc_g4_compute_shader_get_texture_unit() function in Kha/Kinc/Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/compute.c.h
This looks like:
int index = compute_findTexture(shader, name);
fprintf(stderr, "index=%d\n", index);
if (index < 0) {
int location = glGetUniformLocation(shader->impl._programid, name);
glCheckErrors();
fprintf(stderr, "location=%d\n", location);
index = shader->impl.textureCount;
shader->impl.textureValues[index] = location;
strcpy(shader->impl.textures[index], name);
++shader->impl.textureCount;
fprintf(stderr, "count=%d\n", shader->impl.textureCount);
}
And the output seems to reveal a bug:
Starting Kinc
Using OpenGL version 4.6 (forward-compatible).
index=-1
location=-1
count=1
index=-1
location=1
count=2
UPDATE:
Actually I thought there was an issue with the uniform location but it turns out the shader optimizes out the unused texture.
The issue's still the same though, the compute texture unit that we don't assign first can be writen / read to/from.
from kinc.
Don't worry, I don't need help debugging this. I'll get to it when I get to it.
from kinc.
Reminds me, if you want to come back to the Discord, feel free to - I opened up dedicated beginner channels for situations like this.
from kinc.
Related Issues (20)
- Vulkan: multiple render targets broken
- D3D12 crash when hiding/showing window multiple times HOT 7
- Screen tearing / Incomplete frames when instanced rendering (Vulkan on Android device (FP3)) HOT 1
- Can't compile Krom
- Weird drawing behavior with G4onG5 with Vulkan backend HOT 1
- Rendertarget defaults to magenta in Metal (but is transparent on HTML5) HOT 3
- Flickering/Possible Sync issue when reusing index buffer on Metal
- Keyboard input not working on Endeavour OS (Arch Linux) HOT 4
- Compute for Vulkan is missing
- Option to disable features HOT 1
- Ability to use Clang to compile for Windows HOT 6
- Kinc can't use a 3d image with compute shaders HOT 1
- Empty example doesn't work on X11 + Vulkan HOT 7
- kinc_g4_texture_init_*() vulkan errors HOT 3
- TextureFormat RGBA32 isn't working with compute. HOT 1
- Rendertarget samples broken with G4onG5 HOT 3
- Cross compilation from Linux to Windows HOT 4
- [Android] App crash at startup with Vulkan HOT 6
- Window under Linux+Wayland does not get native screen pixels
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kinc.