[HLSL] inefficent function

Started by
16 comments, last by tr0x 12 years, 11 months ago
the program throws an error at startup..
What's the actual error that you get?

BTW, 17*31 is 527 registers, which is a lot. Why do you need so many temp registers?
Advertisement

BTW, 17*31 is 527 registers, which is a lot. Why do you need so many temp registers?

As recursion is not supported in HLSL, this function solves a recursion formula using an iterative approach.

To accomplish that, I use the array as a binary tree, where the value of (x,y) is based on the values of (x,y-1) and (x+1, y-1).

As result the function returns two arrays.
Hi there. Could you use texture to hold your data and not an array
What's the actual error that you get?

Hi there. Could you use texture to hold your data and not an array

It is important not only to read but also to write the data in the shader function. As far as I know that is not really possible with textures, is it?



[quote name='MJP' timestamp='1304546050' post='4806605']What's the actual error that you get?

[/quote]
I get pretty much the the "standard" error messages, that always pop up, when there's something wrong with the shader code:

"The Direct3D device has a non-zero reference count, meaning some objects were not released."
"An error occurred in the device create callback function."
(from DXUT)

Since this error also appears if there's a missing semicolon or whatever, I don't think it really helps here.

I was able to increase the performance dramatically by using an array with just two rows, as the values of each hierarchy level are only dependent on its child-level.

Though I still think it is bad style of coding to do it statically.
They mean the shader error, not the debug output.

When you call the compileFromFile function (not sure which one exactly you use) it returns an error blob on DX11 and 10 (not sure how you get it on DX9).

They mean the shader error, not the debug output.

When you call the compileFromFile function (not sure which one exactly you use) it returns an error blob on DX11 and 10 (not sure how you get it on DX9).


Or you can use the fxc compiler directly from the command line window. That outputs error messages on the fly.
Oh dear.. I didn't even know about this feature. :unsure: Thanks for pointing it out, it should make life a lot easier!

The actual error code is x4580. It states that the shader that uses the concerned function does not return the values it should.

I guess that just means that there is an error during the execution of the shader, doesn't it?

This topic is closed to new replies.

Advertisement