mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-06 14:48:17 +01:00
whb: Add missing GX2Invalidate call.
GX2RUnlockBuffer is supposed to be calling invalidate for us.... but it does not seem to work and we require an explicit invalidate instead?!?!
This commit is contained in:
parent
38ae220cd6
commit
4e2099a2e4
@ -799,6 +799,7 @@ GFDGetGX2RTexture(GX2Texture *texture,
|
||||
|
||||
GX2RCreateSurface(&texture->surface,
|
||||
GX2R_RESOURCE_BIND_TEXTURE
|
||||
| GX2R_RESOURCE_USAGE_CPU_READ
|
||||
| GX2R_RESOURCE_USAGE_CPU_WRITE
|
||||
| GX2R_RESOURCE_USAGE_GPU_READ);
|
||||
|
||||
|
@ -42,7 +42,10 @@ WHBGfxLoadGFDPixelShader(uint32_t index,
|
||||
goto error;
|
||||
}
|
||||
|
||||
shader->gx2rBuffer.flags = GX2R_RESOURCE_BIND_SHADER_PROGRAM | GX2R_RESOURCE_USAGE_CPU_WRITE | GX2R_RESOURCE_USAGE_GPU_READ;
|
||||
shader->gx2rBuffer.flags = GX2R_RESOURCE_BIND_SHADER_PROGRAM |
|
||||
GX2R_RESOURCE_USAGE_CPU_READ |
|
||||
GX2R_RESOURCE_USAGE_CPU_WRITE |
|
||||
GX2R_RESOURCE_USAGE_GPU_READ;
|
||||
shader->gx2rBuffer.elemSize = programSize;
|
||||
shader->gx2rBuffer.elemCount = 1;
|
||||
shader->gx2rBuffer.buffer = NULL;
|
||||
@ -64,6 +67,10 @@ WHBGfxLoadGFDPixelShader(uint32_t index,
|
||||
}
|
||||
|
||||
GX2RUnlockBufferEx(&shader->gx2rBuffer, 0);
|
||||
|
||||
// For some reason we still need to manually invalidate the buffers,
|
||||
// even though GX2RUnlockBuffer SHOULD be doing that for us
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_SHADER, shader->program, shader->size);
|
||||
return shader;
|
||||
|
||||
error:
|
||||
@ -122,7 +129,10 @@ WHBGfxLoadGFDVertexShader(uint32_t index,
|
||||
goto error;
|
||||
}
|
||||
|
||||
shader->gx2rBuffer.flags = GX2R_RESOURCE_BIND_SHADER_PROGRAM | GX2R_RESOURCE_USAGE_CPU_WRITE | GX2R_RESOURCE_USAGE_GPU_READ;
|
||||
shader->gx2rBuffer.flags = GX2R_RESOURCE_BIND_SHADER_PROGRAM |
|
||||
GX2R_RESOURCE_USAGE_CPU_READ |
|
||||
GX2R_RESOURCE_USAGE_CPU_WRITE |
|
||||
GX2R_RESOURCE_USAGE_GPU_READ;
|
||||
shader->gx2rBuffer.elemSize = programSize;
|
||||
shader->gx2rBuffer.elemCount = 1;
|
||||
shader->gx2rBuffer.buffer = NULL;
|
||||
@ -144,6 +154,10 @@ WHBGfxLoadGFDVertexShader(uint32_t index,
|
||||
}
|
||||
|
||||
GX2RUnlockBufferEx(&shader->gx2rBuffer, 0);
|
||||
|
||||
// For some reason we still need to manually invalidate the buffers,
|
||||
// even though GX2RUnlockBuffer SHOULD be doing that for us
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_SHADER, shader->program, shader->size);
|
||||
return shader;
|
||||
|
||||
error:
|
||||
|
Loading…
Reference in New Issue
Block a user