mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-07 16:33:05 +00:00
Resolve warnings
This commit is contained in:
parent
ccb3b08333
commit
eff2d891c5
3 changed files with 22 additions and 9 deletions
|
@ -23,7 +23,8 @@ namespace Ryujinx.Graphics.OpenGL.Effects
|
||||||
public static uint CompileProgram(GL api, string[] shaders, ShaderType shaderType)
|
public static uint CompileProgram(GL api, string[] shaders, ShaderType shaderType)
|
||||||
{
|
{
|
||||||
var shader = api.CreateShader(shaderType);
|
var shader = api.CreateShader(shaderType);
|
||||||
api.ShaderSource(shader, (uint)shaders.Length, shaders, 0);
|
var length = 0;
|
||||||
|
api.ShaderSource(shader, (uint)shaders.Length, shaders, in length);
|
||||||
api.CompileShader(shader);
|
api.CompileShader(shader);
|
||||||
|
|
||||||
var program = api.CreateProgram();
|
var program = api.CreateProgram();
|
||||||
|
|
|
@ -419,11 +419,13 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
{
|
{
|
||||||
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
||||||
{
|
{
|
||||||
|
var indices = indexBaseOffset + quadIndex * 4 * indexElemSize;
|
||||||
|
|
||||||
_gd.Api.DrawElementsInstancedBaseVertexBaseInstance(
|
_gd.Api.DrawElementsInstancedBaseVertexBaseInstance(
|
||||||
PrimitiveType.TriangleFan,
|
PrimitiveType.TriangleFan,
|
||||||
4,
|
4,
|
||||||
_elementsType,
|
_elementsType,
|
||||||
indexBaseOffset + quadIndex * 4 * indexElemSize,
|
in indices,
|
||||||
(uint)instanceCount,
|
(uint)instanceCount,
|
||||||
firstVertex,
|
firstVertex,
|
||||||
(uint)firstInstance);
|
(uint)firstInstance);
|
||||||
|
@ -433,11 +435,13 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
{
|
{
|
||||||
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
||||||
{
|
{
|
||||||
|
var indices = indexBaseOffset + quadIndex * 4 * indexElemSize;
|
||||||
|
|
||||||
_gd.Api.DrawElementsInstancedBaseInstance(
|
_gd.Api.DrawElementsInstancedBaseInstance(
|
||||||
PrimitiveType.TriangleFan,
|
PrimitiveType.TriangleFan,
|
||||||
4,
|
4,
|
||||||
_elementsType,
|
_elementsType,
|
||||||
indexBaseOffset + quadIndex * 4 * indexElemSize,
|
in indices,
|
||||||
(uint)instanceCount,
|
(uint)instanceCount,
|
||||||
(uint)firstInstance);
|
(uint)firstInstance);
|
||||||
}
|
}
|
||||||
|
@ -446,11 +450,13 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
{
|
{
|
||||||
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
||||||
{
|
{
|
||||||
|
var indices = indexBaseOffset + quadIndex * 4 * indexElemSize;
|
||||||
|
|
||||||
_gd.Api.DrawElementsInstanced(
|
_gd.Api.DrawElementsInstanced(
|
||||||
PrimitiveType.TriangleFan,
|
PrimitiveType.TriangleFan,
|
||||||
4,
|
4,
|
||||||
_elementsType,
|
_elementsType,
|
||||||
indexBaseOffset + quadIndex * 4 * indexElemSize,
|
in indices,
|
||||||
(uint)instanceCount);
|
(uint)instanceCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -609,7 +615,8 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
|
|
||||||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||||
|
|
||||||
_gd.Api.DrawElementsIndirect(_primitiveType, _elementsType, indirectBuffer.Offset);
|
var offset = indirectBuffer.Offset;
|
||||||
|
_gd.Api.DrawElementsIndirect(_primitiveType, _elementsType, in offset);
|
||||||
|
|
||||||
_vertexArray.RestoreIndexBuffer();
|
_vertexArray.RestoreIndexBuffer();
|
||||||
|
|
||||||
|
@ -631,10 +638,11 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||||
_gd.Api.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToUInt32());
|
_gd.Api.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToUInt32());
|
||||||
|
|
||||||
|
var offset = indirectBuffer.Offset;
|
||||||
_gd.Api.MultiDrawElementsIndirectCount(
|
_gd.Api.MultiDrawElementsIndirectCount(
|
||||||
_primitiveType,
|
_primitiveType,
|
||||||
_elementsType,
|
_elementsType,
|
||||||
indirectBuffer.Offset,
|
in offset,
|
||||||
parameterBuffer.Offset,
|
parameterBuffer.Offset,
|
||||||
(uint)maxDrawCount,
|
(uint)maxDrawCount,
|
||||||
(uint)stride);
|
(uint)stride);
|
||||||
|
@ -656,7 +664,8 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
|
|
||||||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||||
|
|
||||||
_gd.Api.DrawArraysIndirect(_primitiveType, indirectBuffer.Offset);
|
var offset = indirectBuffer.Offset;
|
||||||
|
_gd.Api.DrawArraysIndirect(_primitiveType, in offset);
|
||||||
|
|
||||||
PostDraw();
|
PostDraw();
|
||||||
}
|
}
|
||||||
|
@ -674,9 +683,10 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||||
_gd.Api.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToUInt32());
|
_gd.Api.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToUInt32());
|
||||||
|
|
||||||
|
var offset = indirectBuffer.Offset;
|
||||||
_gd.Api.MultiDrawArraysIndirectCount(
|
_gd.Api.MultiDrawArraysIndirectCount(
|
||||||
_primitiveType,
|
_primitiveType,
|
||||||
indirectBuffer.Offset,
|
in offset,
|
||||||
parameterBuffer.Offset,
|
parameterBuffer.Offset,
|
||||||
(uint)maxDrawCount,
|
(uint)maxDrawCount,
|
||||||
(uint)stride);
|
(uint)stride);
|
||||||
|
|
|
@ -27,7 +27,9 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
||||||
_type = type;
|
_type = type;
|
||||||
|
|
||||||
_api.BindBuffer(BufferTargetARB.QueryBuffer, _buffer);
|
_api.BindBuffer(BufferTargetARB.QueryBuffer, _buffer);
|
||||||
_api.BufferStorage(BufferStorageTarget.QueryBuffer, sizeof(long), DefaultValue, BufferStorageMask.MapReadBit | BufferStorageMask.MapWriteBit | BufferStorageMask.MapPersistentBit);
|
|
||||||
|
var defaultValue = DefaultValue;
|
||||||
|
_api.BufferStorage(BufferStorageTarget.QueryBuffer, sizeof(long), in defaultValue, BufferStorageMask.MapReadBit | BufferStorageMask.MapWriteBit | BufferStorageMask.MapPersistentBit);
|
||||||
|
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue