From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com ---
It should be useful when vkd3d-shader is used outside D3D12.
--- include/private/vkd3d_shader.h | 2 ++ libs/vkd3d-shader/spirv.c | 2 ++ 2 files changed, 4 insertions(+)
diff --git a/include/private/vkd3d_shader.h b/include/private/vkd3d_shader.h index d55ed9f89825..bb137baba95b 100644 --- a/include/private/vkd3d_shader.h +++ b/include/private/vkd3d_shader.h @@ -55,6 +55,8 @@ enum vkd3d_shader_visibility VKD3D_SHADER_VISIBILITY_GEOMETRY = 4, VKD3D_SHADER_VISIBILITY_PIXEL = 5,
+ VKD3D_SHADER_VISIBILITY_COMPUTE = 1000000000, + VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_VISIBILITY), };
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 79af890a2353..09c6f9f799e4 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2000,6 +2000,8 @@ static bool vkd3d_dxbc_compiler_check_shader_visibility(const struct vkd3d_dxbc_ return compiler->shader_type == VKD3D_SHADER_TYPE_GEOMETRY; case VKD3D_SHADER_VISIBILITY_PIXEL: return compiler->shader_type == VKD3D_SHADER_TYPE_PIXEL; + case VKD3D_SHADER_VISIBILITY_COMPUTE: + return compiler->shader_type == VKD3D_SHADER_TYPE_COMPUTE; default: ERR("Invalid shader visibility %#x.\n", visibility); return false;
On Mon, 29 Oct 2018 at 13:50, Józef Kucia joseph.kucia@gmail.com wrote:
- VKD3D_SHADER_VISIBILITY_COMPUTE = 1000000000,
We can of course pick any value we like, but any reason for this particular one?
On Mon, Oct 29, 2018 at 4:37 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 29 Oct 2018 at 13:50, Józef Kucia joseph.kucia@gmail.com wrote:
- VKD3D_SHADER_VISIBILITY_COMPUTE = 1000000000,
We can of course pick any value we like, but any reason for this particular one?
It isn't very important, but vkd3d_shader_visibility is currently compatible with D3D12_SHADER_VISIBILITY. If we use higher values for our additions, we should be able to preserve compatibility with the D3D12_SHADER_VISIBILITY enum in the future.
On Mon, 29 Oct 2018 at 19:16, Józef Kucia joseph.kucia@gmail.com wrote:
On Mon, Oct 29, 2018 at 4:37 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 29 Oct 2018 at 13:50, Józef Kucia joseph.kucia@gmail.com wrote:
- VKD3D_SHADER_VISIBILITY_COMPUTE = 1000000000,
We can of course pick any value we like, but any reason for this particular one?
It isn't very important, but vkd3d_shader_visibility is currently compatible with D3D12_SHADER_VISIBILITY. If we use higher values for our additions, we should be able to preserve compatibility with the D3D12_SHADER_VISIBILITY enum in the future.
Yeah, I got that, but was curious about why "1000000000" as opposed to e.g. "0x10000" or any other arbitrary value.
On Mon, Oct 29, 2018 at 4:49 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 29 Oct 2018 at 19:16, Józef Kucia joseph.kucia@gmail.com wrote:
On Mon, Oct 29, 2018 at 4:37 PM Henri Verbeet hverbeet@gmail.com wrote:
On Mon, 29 Oct 2018 at 13:50, Józef Kucia joseph.kucia@gmail.com wrote:
- VKD3D_SHADER_VISIBILITY_COMPUTE = 1000000000,
We can of course pick any value we like, but any reason for this particular one?
It isn't very important, but vkd3d_shader_visibility is currently compatible with D3D12_SHADER_VISIBILITY. If we use higher values for our additions, we should be able to preserve compatibility with the D3D12_SHADER_VISIBILITY enum in the future.
Yeah, I got that, but was curious about why "1000000000" as opposed to e.g. "0x10000" or any other arbitrary value.
0x10000 would be fine as well. We can change it if there is any reason to prefer 0x10000 over 1000000000.