My compositors don't work with intel A770 GPU or Radeon Vega 8

Problems building or running the engine, queries about how to use features etc.
User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

Ogre Version: 13.6.5
Operating System: windows
Render System: Dx11

Hi,

I updated the SHMUP Creator to DirectX11, and if the update works well for most users, some others complain about the post-processing not working anymore.
I don't reproduce with my PCs, but for example, if an user uses the Pixelate compositor effect:

Ogre.log

Code: Select all

21:20:45: -------------------------
21:20:45: D3D11: Subsystem Initialising
21:20:45: D3D11: Driver Detection Starts
21:20:45: D3D11: "Intel(R) Arc(TM) A770 Graphics"
21:20:45: D3D11: "Intel(R) UHD Graphics 770"
21:20:45: D3D11: "Microsoft Basic Render Driver (software)"
21:20:45: D3D11: Driver Detection Ends
21:20:45: D3D11: Requested "(default)", selected "Intel(R) Arc(TM) A770 Graphics"
21:20:45: D3D11: Device Feature Level 11.1
21:20:45: ***************************************
21:20:45: *** D3D11: Subsystem Initialized OK ***
21:20:45: ***************************************
21:20:45: Display DPI - ddpi: 96 - hdpi: 96 - vdpi: 96
21:20:45: DesktopDisplayMode - w: 2560 - h: 1440
21:20:45: CurrentDesktopDisplayMode - w: 2560 - h: 1440
21:20:45: Screen mode: Windowed
21:20:45: GL_getDrawableSize - w: 1280 - h: 1240
21:20:45: RenderSystem::_createRenderWindow "SHMUP CREATOR by bulo studio - v1.6.1.5", 1280x1240 windowed  miscParams: FSAA=4 border=fixed externalWindowHandle=199704 gamma=false monitorIndex=0 title=SHMUP CREATOR by bulo studio - v1.6.1.5 vsync=true 
21:20:45: D3D11: Created D3D11 Rendering Window 'SHMUP CREATOR by bulo studio - v1.6.1.5' : 1280x1240
21:20:45: Registering ResourceManager for type Texture
21:20:45: RenderSystem capabilities
21:20:45: -------------------------
21:20:45: RenderSystem Name: Direct3D11 Rendering Subsystem
21:20:45: GPU Vendor: intel
21:20:45: Device Name: Intel(R) Arc(TM) A770 Graphics
21:20:45: Driver Version: 31.0.101.4502
21:20:45:  * Fixed function pipeline: no
21:20:45:  * 32-bit index buffers: yes
21:20:45:  * Hardware stencil buffer: yes
21:20:45:    - Two sided stencil support: yes
21:20:45:    - Wrap stencil values: yes
21:20:45:  * Vertex programs: yes
21:20:45:    - Number of constant 4-vectors: 4096
21:20:45:  * Fragment programs: yes
21:20:45:    - Number of constant 4-vectors: 4096
21:20:45:  * Geometry programs: yes
21:20:45:    - Number of constant 4-vectors: 4096
21:20:45:  * Tessellation Hull programs: yes
21:20:45:    - Number of constant 4-vectors: 4096
21:20:45:  * Tessellation Domain programs: yes
21:20:45:    - Number of constant 4-vectors: 4096
21:20:45:  * Compute programs: yes
21:20:45:    - Number of constant 4-vectors: 4096
21:20:45:  * Supported Shader Profiles: cs_4_0 cs_4_1 cs_5_0 ds_5_0 gs_4_0 gs_4_1 gs_5_0 hlsl hs_5_0 ps_2_0 ps_2_a ps_2_b ps_3_0 ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3 ps_4_1 ps_5_0 vs_2_0 vs_2_a vs_3_0 vs_4_0 vs_4_0_level_9_1 vs_4_0_level_9_3 vs_4_1 vs_5_0
21:20:45:  * Read-back compiled shader: yes
21:20:45:  * Number of vertex attributes: 32
21:20:45:  * Textures
21:20:45:    - Number of texture units: 16
21:20:45:    - Floating point: yes
21:20:45:    - Non-power-of-two: yes
21:20:45:    - 1D textures: yes
21:20:45:    - 2D array textures: yes
21:20:45:    - 3D textures: yes
21:20:45:    - Anisotropic filtering: yes
21:20:45:  * Texture Compression: yes
21:20:45:    - DXT: yes
21:20:45:    - VTC: no
21:20:45:    - PVRTC: no
21:20:45:    - ATC: no
21:20:45:    - ETC1: no
21:20:45:    - ETC2: no
21:20:45:    - BC4/BC5: no
21:20:45:    - BC6H/BC7: yes
21:20:45:    - ASTC: no
21:20:45:    - Automatic mipmap generation: no
21:20:45:  * Vertex Buffers
21:20:45:    - Render to Vertex Buffer: yes
21:20:45:    - Instance Data: yes
21:20:45:    - Primitive Restart: yes
21:20:45:    - INT_10_10_10_2_NORM element type: no
21:20:45:  * Vertex texture fetch: yes
21:20:45:    - Max vertex textures: 4
21:20:45:    - Vertex textures shared: no
21:20:45:  * Read/Write Buffers: no
21:20:45:  * Hardware Occlusion Query: yes
21:20:45:  * User clip planes: yes
21:20:45:  * Depth clamping: yes
21:20:45:  * Hardware render-to-texture: yes
21:20:45:    - Multiple Render Targets: 8
21:20:45:    - With different bit depths: yes
21:20:45:  * Point Sprites: no
21:20:45:  * Wide Lines: no
21:20:45:  * Hardware Gamma: no

(No scripts compilation errors)

This is without the compositor:
Image

This is with the compositor:
Image

The Pixelate compositor:

Code: Select all

compositor pixelateFX
{
    technique
    {
        texture scene target_width target_height PF_A8R8G8B8
		
    // the scene we want to modulate
    target scene 
	{ 
		input previous
	}

    target_output
    {
        input none
		shadows off

        pass render_quad
        {
            material modulatePixelate_out
            input 0 scene
        }
    }
}
}

The Pixelate material:

Code: Select all

vertex_program pixelate_out_vs hlsl
{
	source pixelate.hlsl
	entry_point pixelate_out_vs
    target vs_3_0 
	
default_params
{
	param_named_auto worldViewProj worldviewproj_matrix
}
}

fragment_program pixelate_out_ps hlsl
{
	source pixelate.hlsl
	entry_point pixelate_out
    target ps_3_0
	
default_params
{
	 param_named pixelSize float 1
	 param_named_auto resoWidth viewport_width
	 param_named_auto resoHeigth viewport_height
}
}


material modulatePixelate_out
{
    technique
    {
        pass
        {
			cull_hardware none
			depth_check off
            depth_func always_pass
            polygon_mode_overrideable false
			

		vertex_program_ref pixelate_out_vs
		{
		}
		
		fragment_program_ref pixelate_out_ps
		{
		}

		texture_unit RT
		{
            tex_coord_set 0
			tex_address_mode clamp
			filtering linear linear linear
		}
    }
}
}

And the Pixelate shader:

Code: Select all

struct VIn
{
	float4 p : POSITION;
    float2 uv   : TEXCOORD0;
};

struct VOut
{
	float4 p    : SV_POSITION;
    float2 uv : TEXCOORD0;
};

struct PIn
{
	float4 p    : SV_POSITION;
    float2 uv   : TEXCOORD0;
};

struct POut
{
    half4 c : COLOR;
};

VOut pixelate_out_vs(VIn IN,
					uniform float4x4 worldViewProj)
{
	VOut OUT;
	
OUT.p = mul(worldViewProj, IN.p);
OUT.uv = IN.uv;
return OUT;
}

float4 pixelate_out( PIn IN,
		uniform float pixelSize,
		uniform float resoWidth ,
		uniform float resoHeigth ,
		uniform sampler RT: register(s0)
		) : SV_TARGET {
	
half dx = pixelSize*(1.0/resoWidth);
half dy = pixelSize*(1.0/resoHeigth);
float2 uv = IN.uv;
uv = half2(dx*floor(uv.x/dx), dy*floor(uv.y/dy));

float3 finalcol = tex2D(RT, uv).xyz;	
return float4(finalcol,1.0);
}

In my code, I create the compositor and sometimes use notifyResized();

Another user has a similar issue with its AMD Radeon Vega 8 Graphics:
Image

I really don't know what can be the issue: maybe UVs are wrong?
Suny

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
rpgplayerrobin
Orc Shaman
Posts: 724
Joined: Wed Mar 18, 2009 3:03 am
x 405

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by rpgplayerrobin »

In my game I also support both D3D9 and D3D11 and the biggest change there are the shader materials and the shaders themselves.

For example, your shader materials still use vs_3_0 and ps_3_0, which might be incorrect.
For my game I use vs_4_0 and ps_4_0 for Direct3D11.

I thought it was not even possible to use ps_3_0 for Direct3D11, because otherwise I would have done so as well, since it was a big hassle to get Direct3D11 shaders working from the normal Direct3D9 ones.

Also, in your actual shader, you still use tex2D, which is incorrect as well if you have to use ps_4_0.
This is how it is done for D3D9 for me:

Code: Select all

sampler NormalMap : register(s1);
...
float4 FetchedNormalColor = tex2D(NormalMap, uv);

And then for D3D11:

Code: Select all

SamplerState NormalMap_state : register(s1);
Texture2D NormalMap : register(t1);
...
float4 FetchedNormalColor = NormalMap.Sample(NormalMap_state, uv);
paroj
OGRE Team Member
OGRE Team Member
Posts: 2151
Joined: Sun Mar 30, 2014 2:51 pm
x 1156

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by paroj »

rpgplayerrobin wrote: Wed May 08, 2024 4:28 pm

I thought it was not even possible to use ps_3_0 for Direct3D11, because otherwise I would have done so as well, since it was a big hassle to get Direct3D11 shaders working from the normal Direct3D9 ones.

ps_3_0 is automatically mapped to ps_4_0 on recent ogre

rpgplayerrobin wrote: Wed May 08, 2024 4:28 pm

Also, in your actual shader, you still use tex2D, which is incorrect as well if you have to use ps_4_0.

again, recent ogre comes with HLSL_SM4Support.hlsl that enables tex2D etc. on ps_4_0.

also see: https://ogrecave.github.io/ogre/api/lat ... fiedShader

User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

Thanks, Paroj!

I'll make changes by hand first to quickly confirm this fixes my issues, but clearly, I will use Ogre Cross-platform shader system: this looks quite promising.

Is there an example somewhere of how to properly use the HLSL_SM4Support.hlsl macros?

S.

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

Thanks, Paroj, and rpgplayerrobin.
I modified the shader and updated my engine, but there is no difference: users still have the same result.

The shader is now:

Code: Select all

struct VIn
{
	float4 p : POSITION;
    float2 uv   : TEXCOORD0;
};

struct VOut
{
	float4 p    : SV_POSITION;
    float2 uv : TEXCOORD0;
};

struct PIn
{
	float4 p    : SV_POSITION;
    float2 uv   : TEXCOORD0;
};

struct POut
{
    float4 c : COLOR;
};

VOut pixelate_out_vs(VIn IN,
					uniform float4x4 worldViewProj)
{
	VOut OUT;
	
OUT.p = mul(worldViewProj, IN.p);
OUT.uv = IN.uv;
return OUT;
}

Texture2D screenMap : register(t0);
SamplerState screenSampler : register(s0);

float4 pixelate_out( PIn IN,
		uniform float pixelSize,
		uniform float resoWidth ,
		uniform float resoHeigth
		) : SV_TARGET {
	
float dx = pixelSize*(1.0/resoWidth);
float dy = pixelSize*(1.0/resoHeigth);
float2 uv = IN.uv;
uv = float2(dx*floor(uv.x/dx), dy*floor(uv.y/dy));

float3 finalcol = screenMap.Sample(screenSampler, uv).xyz;
return float4(finalcol,1.0);
}

But I'm wondering if the issue doesn't come from the result of input previous in the compositor?

In this picture, I'm using one compositor which uses input previous and 2 textures (where I only render selected objects) to create a selection outline. In the compositor shader, I'm doing a sobel filter to compute the outline and then composite it to the texture from Input previous, and you can see the outline is correct. So the compositor is working, the UVs are ok, the 2 textures buffers are OK, but the texture from the viewport is messed up.

Image

I'm pretty sure I'll have the same incorrect result with a shader like this:

Code: Select all

Texture2D screenMap : register(t0);
SamplerState screenSampler : register(s0);
float4 pixelate_out( PIn IN) : SV_TARGET 
{
	return screenMap.Sample(screenSampler, IN.uv);
}

I'm trying to think of what weird things I do, but I have no idea. The viewport sometimes changes its dimension, could this be an issue with some GPUs?

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
paroj
OGRE Team Member
OGRE Team Member
Posts: 2151
Joined: Sun Mar 30, 2014 2:51 pm
x 1156

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by paroj »

since you are finally on D3D11, you can use https://renderdoc.org/ to debug this. Maybe your user can capture the error. It might not show in the replay on your machine, but maybe you can spot something odd.

User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

I tried to reproduce the issue on all my PCs (I even replugged my old 2011 Shuttle with an integrated Intel GPU and was pleasantly surprised that the engine ran at a solid 60fps :) ) but didn't reproduce.
My only chance to see what's wrong seems to be to ask users to use RenderDoc, but I need to guide them to investigate the right thing.

Should I ask them to display the input texture of the compositor pass, like this?
Or could there be something else to investigate?

Image

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
paroj
OGRE Team Member
OGRE Team Member
Posts: 2151
Joined: Sun Mar 30, 2014 2:51 pm
x 1156

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by paroj »

renderdoc allows you to store the capture, that you could then open on your PC

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5488
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1361

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by dark_sylinc »

Have you enabled DX11 Debug/Validation Layers?

They are off by default in Release, and on by default debug builds of Ogre/OgreNext.

Running a full debug build of Ogre may catch more errors.

Set Information Queue Exceptions Bottom Level to Info (exception on any message).

You don't need to run your app in the broken machine. If there is something that is non-compliant, the debug layers will complain in any PC (unless for some reason a different code path is being taken in those machines, but AFAIK D3D11 RenderSystem doesn't have many variations).

rpgplayerrobin
Orc Shaman
Posts: 724
Joined: Wed Mar 18, 2009 3:03 am
x 405

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by rpgplayerrobin »

suny2000 wrote: Thu May 09, 2024 7:32 pm

Thanks, Paroj, and rpgplayerrobin.
I modified the shader and updated my engine, but there is no difference: users still have the same result.

The shader is now:

Code: Select all

struct VIn
{
	float4 p : POSITION;
    float2 uv   : TEXCOORD0;
};

struct VOut
{
	float4 p    : SV_POSITION;
    float2 uv : TEXCOORD0;
};

struct PIn
{
	float4 p    : SV_POSITION;
    float2 uv   : TEXCOORD0;
};

struct POut
{
    float4 c : COLOR;
};

VOut pixelate_out_vs(VIn IN,
					uniform float4x4 worldViewProj)
{
	VOut OUT;
	
OUT.p = mul(worldViewProj, IN.p);
OUT.uv = IN.uv;
return OUT;
}

Texture2D screenMap : register(t0);
SamplerState screenSampler : register(s0);

float4 pixelate_out( PIn IN,
		uniform float pixelSize,
		uniform float resoWidth ,
		uniform float resoHeigth
		) : SV_TARGET {
	
float dx = pixelSize*(1.0/resoWidth);
float dy = pixelSize*(1.0/resoHeigth);
float2 uv = IN.uv;
uv = float2(dx*floor(uv.x/dx), dy*floor(uv.y/dy));

float3 finalcol = screenMap.Sample(screenSampler, uv).xyz;
return float4(finalcol,1.0);
}

But I'm wondering if the issue doesn't come from the result of input previous in the compositor?

In this picture, I'm using one compositor which uses input previous and 2 textures (where I only render selected objects) to create a selection outline. In the compositor shader, I'm doing a sobel filter to compute the outline and then composite it to the texture from Input previous, and you can see the outline is correct. So the compositor is working, the UVs are ok, the 2 textures buffers are OK, but the texture from the viewport is messed up.

Image

I'm pretty sure I'll have the same incorrect result with a shader like this:

Code: Select all

Texture2D screenMap : register(t0);
SamplerState screenSampler : register(s0);
float4 pixelate_out( PIn IN) : SV_TARGET 
{
	return screenMap.Sample(screenSampler, IN.uv);
}

I'm trying to think of what weird things I do, but I have no idea. The viewport sometimes changes its dimension, could this be an issue with some GPUs?

As a test, could you also attempt to set to ps_4_0 and vs_4_0 in the shader material?

Also, could you try this shader? Because I also had some trouble with Direct3D11 with the vertex shader, so I had to adjust some there:

Code: Select all

float4x4 worldMatrix;
float4x4 modelViewProj;
float4x4 texturemat;

struct VS_OUTPUT
{
	float3 oVertexPos : TEXCOORD0;
	float2 oUV : TEXCOORD1;
};

VS_OUTPUT main_vs( float4 position : POSITION,
				   out float4 oPosition : POSITION,
				   float2 iUV : TEXCOORD0 )
{
	VS_OUTPUT Out;

float3 worldPos = mul(worldMatrix, position).xyz;

oPosition = mul(modelViewProj, position);
Out.oVertexPos = worldPos;
Out.oUV = iUV;

Out.oUV = mul(texturemat,float4(Out.oUV,0,1)).xy;

return Out;
}

Code: Select all

float4 fogParams;

SamplerState DiffuseMap_state : register(s0);
Texture2D DiffuseMap : register(t0);

float4 main_ps( float3 position : TEXCOORD0,
				float2 uv : TEXCOORD1 ) : COLOR0
{
	float4 color = DiffuseMap.Sample(DiffuseMap_state, uv);

float fogEnabled = fogParams.x; // x is expDensity, which holds whether or not it is enabled
float fogStart = fogParams.y;
float fogEnd = fogParams.z;
float distanceFromCamera = length(position);
float fogFactor = (1.0 - saturate((fogEnd - distanceFromCamera) / (fogEnd - fogStart))) * fogEnabled;
color.xyz *= 1.0 - fogFactor;

return color;
}

Code: Select all

vertex_program FixedFunctionShader_Diffuse_VS hlsl
{
	source FixedFunctionShader_Diffuse_VS.hlsl
	entry_point main_vs
	target vs_4_0

default_params
{
	param_named_auto modelViewProj worldviewproj_matrix
	param_named_auto texturemat texture_matrix 0
}
}

fragment_program FixedFunctionShader_Diffuse_PS hlsl
{
	source FixedFunctionShader_Diffuse_PS.hlsl
	entry_point main_ps
	target ps_4_0

default_params
{
	param_named fixedFunctionShader_color float4 1.0 1.0 1.0 1.0
	param_named globalAmbient float4 1.0 1.0 1.0 1.0

	param_named_auto fogColour fog_colour
	param_named_auto fogParams fog_params
	param_named_auto eyePosition camera_position_object_space
}
}
User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

rpgplayerrobin:
Yes, I changed to SM4.0.

dark_sylinc:
This is very promising. However (Excuse my ignorance, I'm a tech artist by trade, not really a gfx coder :) ), how can I use the API Validation layer?
I tried to enable the Enable API Validation checkbox in RenderDoc, but my debug .exe is closing immediately after Launch, just after
D3D11: Direct3D11 Rendering Subsystem created.

There seems to be an exception there:
OGRE_EXCEPT_EX(Exception::ERR_RENDERINGAPI_ERROR, hr, "Failed to create Direct3D11 device", "D3D11RenderSystem::D3D11RenderSystem");

S.

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
rpgplayerrobin
Orc Shaman
Posts: 724
Joined: Wed Mar 18, 2009 3:03 am
x 405

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by rpgplayerrobin »

suny2000 wrote: Fri May 10, 2024 5:23 pm

This is very promising. However (Excuse my ignorance, I'm a tech artist by trade, not really a gfx coder :) ), how can I use the API Validation layer?

I guess this is what he means?:

Code: Select all

D3D11Device::setExceptionsErrorLevel(D3D11Device::eExceptionsErrorLevel::D3D_INFO);

Note that you might have to include this file though:

Code: Select all

#include "RenderSystems/Direct3D11/OgreD3D11Device.h"

And by the way, in Visual Studio you can also use Debug->Graphics->Start Graphics Debugging for Direct3D11 with Ogre as well. There you can see the entire chain of events of a frame and you can even debug individual shaders by actually going through them line-by-line to see/understand why they don't work. It has helped me many times.

rpgplayerrobin
Orc Shaman
Posts: 724
Joined: Wed Mar 18, 2009 3:03 am
x 405

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by rpgplayerrobin »

I also tried to set debug layers to be true, but I am not sure if there is a good way to do that.
I just did this before creation of the root:

Code: Select all

D3D11RenderSystem* tmpSpecificRenderSystem = static_cast<D3D11RenderSystem*>(app->m_RenderSystem);
tmpSpecificRenderSystem->setConfigOption("Debug Layer", "On");

You might also need to include this file though:

Code: Select all

#include "RenderSystems/Direct3D11/OgreD3D11RenderSystem.h"

Note however that even my game gives me a lot of errors/warnings with that, even though the game runs just fine without it, even with a higher tolerance for warnings with D3D11Device::setExceptionsErrorLevel(D3D11Device::eExceptionsErrorLevel::D3D_ERROR).

Also note that my code to receive these error message actually only happens when I start in debug.

User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

Thanks!

I tried:

Code: Select all

	rsys->setConfigOption("Debug Layer", "On");
	rsys->setConfigOption("Information Queue Exceptions Bottom Level", "Info (exception on any message)");
	root->setRenderSystem(mgr.rsys);
	D3D11Device::setExceptionsErrorLevel(D3D11Device::eExceptionsErrorLevel::D3D_INFO);

But I don't see anything more in the Output logs in VC++ :/

Also, exported games from the engine work with no problem: I wonder if the only real difference in the editor is the Steam layer added on top...
I'm waiting for a GPU trace from a helpful user in a few hours.

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
rpgplayerrobin
Orc Shaman
Posts: 724
Joined: Wed Mar 18, 2009 3:03 am
x 405

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by rpgplayerrobin »

But I don't see anything more in the Output logs in VC++ :/

For me, the errors/warnings occurred as message boxes, but if there are none you have no errors.

But it could also mean that you put those lines of code too late in the process, and if I were you I would debug it in D3D11Device::getErrorDescription to see if the errors/warnings/info is enabled and debug D3D11RenderSystem::createD3D11Device to see if it was actually created with debug layers.

Also, exported games from the engine work with no problem: I wonder if the only real difference in the editor is the Steam layer added on top...

If the engine is for Windows using D3D11, what exactly is the Steam layer doing? I don't understand that exactly.

If you want, I can also look at this, in that case just send me a version of the shader, compositor and shader materials to make it happen and what code (if any) to reproduce it.
However, the current shader material is still the old version (ps/vs 3 instead of 4+) so I would want the latest version you use that still has the issue in it.

User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

Thanks for your help!
-The last shaders I posted above are SM4. Only a few people are reproducing the issue, I'm trying to get captures from them but it's hard to motivate them :)
-The Steam layer is a layer of UI on top of the game. I have no idea how it's added to the game.

Right now I decided to allow users to go back to DirectX9 for the game editor.

S.

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!
rpgplayerrobin
Orc Shaman
Posts: 724
Joined: Wed Mar 18, 2009 3:03 am
x 405

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by rpgplayerrobin »

-The last shaders I posted above are SM4

The materials posted above are still showing ps_3_0 and vs_3_0 though.

-The Steam layer is a layer of UI on top of the game

You mean the Steam Overlay? It had no effect for me at least and it should not be an issue.

Anyway, when I copied your shaders, shader materials (and made them SM4 instead of SM3 that yours had) and compositor it behaved very strangely for me, very weird artifacts basically.
But then when I split the loading order it worked.

In my game I always load a resource group that first contains the hlsl files and also the shader materials that defines how the shaders should be compiled and such.
Then after that I create a new resource group that contains the materials themselves.

So for example, when I loaded all of these at once, it did not work correctly for me:

Code: Select all

vertex_program pixelate_out_vs hlsl
{
	source Pixelate.hlsl
	entry_point pixelate_out_vs
    target vs_4_0 

default_params
{
	param_named_auto worldViewProj worldviewproj_matrix
}
}

fragment_program pixelate_out_ps hlsl
{
	source Pixelate.hlsl
	entry_point pixelate_out
    target ps_4_0

default_params
{
	 param_named pixelSize float 1
	 param_named_auto resoWidth viewport_width
	 param_named_auto resoHeigth viewport_height
}
}


material modulatePixelate_out
{
    technique
    {
        pass
        {
			cull_hardware none
			cull_software none
			depth_check off
            polygon_mode_overrideable false

		vertex_program_ref pixelate_out_vs
		{
		}

		fragment_program_ref pixelate_out_ps
		{
		}

		texture_unit RT
		{
			tex_coord_set 0
			tex_address_mode clamp
			filtering linear linear linear
		}
	}
}
}

I had to split the files into two, first loading this file:

Code: Select all

vertex_program pixelate_out_vs hlsl
{
	source Pixelate.hlsl
	entry_point pixelate_out_vs
    target vs_4_0 

default_params
{
	param_named_auto worldViewProj worldviewproj_matrix
}
}

fragment_program pixelate_out_ps hlsl
{
	source Pixelate.hlsl
	entry_point pixelate_out
    target ps_4_0

default_params
{
	 param_named pixelSize float 1
	 param_named_auto resoWidth viewport_width
	 param_named_auto resoHeigth viewport_height
}
}

And then this file later:

Code: Select all

material modulatePixelate_out
{
    technique
    {
        pass
        {
			cull_hardware none
			cull_software none
			depth_check off
            polygon_mode_overrideable false

		vertex_program_ref pixelate_out_vs
		{
		}

		fragment_program_ref pixelate_out_ps
		{
		}

		texture_unit RT
		{
			tex_coord_set 0
			tex_address_mode clamp
			filtering linear linear linear
		}
	}
}
}
User avatar
suny2000
Halfling
Posts: 89
Joined: Sun Sep 06, 2009 12:36 pm
x 18

Re: My compositors don't work with intel A770 GPU or Radeon Vega 8

Post by suny2000 »

Interesting!

Do you think splitting the code into a .material and .programm would fix the issue? (This is what I do for other materials, I don't remember why I added the program and material into the same file... This looks like a very bad idea now that I think about it...)

Also, I don't have any Steam overlay anymore since my last update. EDIT: I discovered that Steam recently disabled overlay with non-game apps by default, so I just had to re-enable it.

I'll try to update the compositor today and see if this helps.
Thanks for your help!
S.

http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!